Skip to content

Commit bda8957

Browse files
authored
Merge pull request #3948 from ppopth/refactor-get-max-effective-balance
EIP7251: Revamp process_effective_balance_updates
2 parents a9e3aad + 0301ec7 commit bda8957

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

specs/electra/beacon-chain.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -906,16 +906,13 @@ def process_effective_balance_updates(state: BeaconState) -> None:
906906
DOWNWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_DOWNWARD_MULTIPLIER
907907
UPWARD_THRESHOLD = HYSTERESIS_INCREMENT * HYSTERESIS_UPWARD_MULTIPLIER
908908
# [Modified in Electra:EIP7251]
909-
EFFECTIVE_BALANCE_LIMIT = (
910-
MAX_EFFECTIVE_BALANCE_ELECTRA if has_compounding_withdrawal_credential(validator)
911-
else MIN_ACTIVATION_BALANCE
912-
)
909+
max_effective_balance = get_max_effective_balance(validator)
913910

914911
if (
915912
balance + DOWNWARD_THRESHOLD < validator.effective_balance
916913
or validator.effective_balance + UPWARD_THRESHOLD < balance
917914
):
918-
validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, EFFECTIVE_BALANCE_LIMIT)
915+
validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, max_effective_balance)
919916
```
920917

921918
### Execution engine

0 commit comments

Comments
 (0)