From b3c771c46db891812422e113e227b39c6757620c Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Wed, 7 Dec 2022 12:05:24 +0600 Subject: [PATCH] Preserve deposits per epoch boundary --- specs/deposits/beacon-chain.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/specs/deposits/beacon-chain.md b/specs/deposits/beacon-chain.md index bb6ebd2e8..7e8b5bf82 100644 --- a/specs/deposits/beacon-chain.md +++ b/specs/deposits/beacon-chain.md @@ -244,10 +244,14 @@ def process_pending_deposits(state: BeaconState) -> None: next_pending_deposit_index = 0 for pending_deposit in state.pending_deposits: - # Apply only finalized deposits - if pending_deposit.epoch > finalized_epoch + # Preserve deposits per epoch boundary + if next_pending_deposit_index >= MAX_DEPOSITS * SLOTS_PER_EPOCH: break - + + # Apply only finalized deposits + if pending_deposit.epoch > finalized_epoch: + break + # Skip already applied deposits if pending_deposit.index >= state.eth1_deposit_index: apply_pending_deposit(state, pending_deposit)