Merge pull request #3658 from ethereum/mkalinin-patch-6

EIP-7251: Fix has_sufficient_effective_balance computation
This commit is contained in:
Alex Stokes 2024-04-07 09:29:06 -06:00 committed by GitHub
commit e6092db3fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -686,7 +686,7 @@ def get_expected_withdrawals(state: BeaconState) -> Tuple[Sequence[Withdrawal],
break
validator = state.validators[withdrawal.index]
has_sufficient_effective_balance = validator.effective_balance == MIN_ACTIVATION_BALANCE
has_sufficient_effective_balance = validator.effective_balance >= MIN_ACTIVATION_BALANCE
has_excess_balance = state.balances[withdrawal.index] > MIN_ACTIVATION_BALANCE
if validator.exit_epoch == FAR_FUTURE_EPOCH and has_sufficient_effective_balance and has_excess_balance:
withdrawable_balance = min(state.balances[withdrawal.index] - MIN_ACTIVATION_BALANCE, withdrawal.amount)