Merge pull request #3637 from ethDreamer/max_eb_get_active_balance_bug
Fix bug in get_active_balance()
This commit is contained in:
commit
a2c4c273f0
|
@ -404,12 +404,8 @@ def get_consolidation_churn_limit(state: BeaconState) -> Gwei:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def get_active_balance(state: BeaconState, validator_index: ValidatorIndex) -> Gwei:
|
def get_active_balance(state: BeaconState, validator_index: ValidatorIndex) -> Gwei:
|
||||||
active_balance_ceil = (
|
max_effective_balance = get_validator_max_effective_balance(state.validators[validator_index])
|
||||||
MIN_ACTIVATION_BALANCE
|
return min(state.balances[validator_index], max_effective_balance)
|
||||||
if has_eth1_withdrawal_credential(state.validators[validator_index])
|
|
||||||
else MAX_EFFECTIVE_BALANCE_EIP7251
|
|
||||||
)
|
|
||||||
return min(state.balances[validator_index], active_balance_ceil)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Beacon state mutators
|
### Beacon state mutators
|
||||||
|
|
Loading…
Reference in New Issue