Applied suggestions by @hwwhww

Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
This commit is contained in:
Mikhail Kalinin 2024-06-03 14:56:39 +06:00 committed by GitHub
parent a0a23245f0
commit 3fd125f078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1442,6 +1442,7 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
# Process activations
for index, validator in enumerate(state.validators):
balance = state.balances[index]
# [Modified in Electra:EIP7251]
validator.effective_balance = min(
balance - balance % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE_ELECTRA)
if validator.effective_balance >= MIN_ACTIVATION_BALANCE: