mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 03:34:20 +00:00
Fix effective balance
This commit is contained in:
parent
3d2eaa22cb
commit
d329e90aa5
@ -1139,7 +1139,9 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash,
|
|||||||
|
|
||||||
# Process activations
|
# Process activations
|
||||||
for index, validator in enumerate(state.validators):
|
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_eligibility_epoch = GENESIS_EPOCH
|
||||||
validator.activation_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,
|
activation_epoch=FAR_FUTURE_EPOCH,
|
||||||
exit_epoch=FAR_FUTURE_EPOCH,
|
exit_epoch=FAR_FUTURE_EPOCH,
|
||||||
withdrawable_epoch=FAR_FUTURE_EPOCH,
|
withdrawable_epoch=FAR_FUTURE_EPOCH,
|
||||||
effective_balance=min(amount - amount % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE)
|
|
||||||
))
|
))
|
||||||
state.balances.append(amount)
|
state.balances.append(amount)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user