From 52e9552bbd4735563b948da3ecbc583b2ea10cfe Mon Sep 17 00:00:00 2001 From: Mark Mackey Date: Fri, 29 Mar 2024 11:59:16 -0600 Subject: [PATCH] Fix bug in get_active_balance() --- specs/_features/eip7251/beacon-chain.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/specs/_features/eip7251/beacon-chain.md b/specs/_features/eip7251/beacon-chain.md index c4aad0a6f..e0ae0c803 100644 --- a/specs/_features/eip7251/beacon-chain.md +++ b/specs/_features/eip7251/beacon-chain.md @@ -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