mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 17:35:03 -05:00
Fix effective balance
This commit is contained in:
@@ -1139,7 +1139,9 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash,
|
||||
|
||||
# Process activations
|
||||
for index, validator in enumerate(state.validators):
|
||||
if state.balances[index] >= MAX_EFFECTIVE_BALANCE:
|
||||
balance = state.balances[index]
|
||||
validator.effective_balance = min(balance - balance % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE)
|
||||
if validator.effective_balance == MAX_EFFECTIVE_BALANCE:
|
||||
validator.activation_eligibility_epoch = GENESIS_EPOCH
|
||||
validator.activation_epoch = GENESIS_EPOCH
|
||||
|
||||
@@ -1689,7 +1691,6 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
|
||||
activation_epoch=FAR_FUTURE_EPOCH,
|
||||
exit_epoch=FAR_FUTURE_EPOCH,
|
||||
withdrawable_epoch=FAR_FUTURE_EPOCH,
|
||||
effective_balance=min(amount - amount % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE)
|
||||
))
|
||||
state.balances.append(amount)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user