Skip to content

Commit

Permalink
Fix bug in get_active_balance()
Browse files Browse the repository at this point in the history
  • Loading branch information
ethDreamer committed Mar 29, 2024
1 parent 1a65d4f commit 52e9552
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions specs/_features/eip7251/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,8 @@ def get_consolidation_churn_limit(state: BeaconState) -> Gwei:

```python
def get_active_balance(state: BeaconState, validator_index: ValidatorIndex) -> Gwei:
active_balance_ceil = (
MIN_ACTIVATION_BALANCE
if has_eth1_withdrawal_credential(state.validators[validator_index])
else MAX_EFFECTIVE_BALANCE_EIP7251
)
return min(state.balances[validator_index], active_balance_ceil)
max_effective_balance = get_validator_max_effective_balance(state.validators[validator_index])
return min(state.balances[validator_index], max_effective_balance)
```

### Beacon state mutators
Expand Down

0 comments on commit 52e9552

Please sign in to comment.