From 0301ec7ae0d67b445c80f16955d157763af88ab7 Mon Sep 17 00:00:00 2001 From: Suphanat Chunhapanya Date: Sun, 29 Sep 2024 10:54:39 +0700 Subject: [PATCH] EIP7251: Revamp process_effective_balance_updates Use get_max_effective_balance in process_effective_balance_updates since the logic is the same. --- specs/electra/beacon-chain.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index dbf84d8de..745148be8 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -906,16 +906,13 @@ def process_effective_balance_updates(state: BeaconState) -> None: DOWNWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_DOWNWARD_MULTIPLIER UPWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_UPWARD_MULTIPLIER # [Modified in Electra:EIP7251] - EFFECTIVE_BALANCE_LIMIT = ( - MAX_EFFECTIVE_BALANCE_ELECTRA if has_compounding_withdrawal_credential(validator) - else MIN_ACTIVATION_BALANCE - ) + max_effective_balance = get_max_effective_balance(validator) if ( balance + DOWNWARD_THRESHOLD < validator.effective_balance or validator.effective_balance + UPWARD_THRESHOLD < balance ): - validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, EFFECTIVE_BALANCE_LIMIT) + validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, max_effective_balance) ``` ### Execution engine