Preserve deposits per epoch boundary

This commit is contained in:
Mikhail Kalinin 2022-12-07 12:05:24 +06:00
parent c53ab45e19
commit b3c771c46d

View File

@ -244,10 +244,14 @@ def process_pending_deposits(state: BeaconState) -> None:
next_pending_deposit_index = 0 next_pending_deposit_index = 0
for pending_deposit in state.pending_deposits: for pending_deposit in state.pending_deposits:
# Apply only finalized deposits # Preserve deposits per epoch boundary
if pending_deposit.epoch > finalized_epoch if next_pending_deposit_index >= MAX_DEPOSITS * SLOTS_PER_EPOCH:
break break
# Apply only finalized deposits
if pending_deposit.epoch > finalized_epoch:
break
# Skip already applied deposits # Skip already applied deposits
if pending_deposit.index >= state.eth1_deposit_index: if pending_deposit.index >= state.eth1_deposit_index:
apply_pending_deposit(state, pending_deposit) apply_pending_deposit(state, pending_deposit)