mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-22 00:20:28 +00:00
Finalize deposit requests before processing
This commit is contained in:
parent
5c3a51ae79
commit
179ee8ee78
@ -851,15 +851,19 @@ def process_pending_deposits(state: BeaconState) -> None:
|
|||||||
next_deposit_index = 0
|
next_deposit_index = 0
|
||||||
deposits_to_postpone = []
|
deposits_to_postpone = []
|
||||||
is_churn_limit_reached = False
|
is_churn_limit_reached = False
|
||||||
|
finalized_slot = compute_start_slot_at_epoch(state.finalized_checkpoint.epoch)
|
||||||
|
|
||||||
for deposit in state.pending_deposits:
|
for deposit in state.pending_deposits:
|
||||||
# Do not process any deposit requests if Eth1 bridge deposits are not yet applied
|
# Do not process a deposit request if Eth1 bridge deposits are not yet applied.
|
||||||
if (state.deposit_requests_start_index != UNSET_DEPOSIT_REQUESTS_START_INDEX
|
is_deposit_request = deposit.slot > GENESIS_SLOT
|
||||||
and state.eth1_deposit_index < state.deposit_requests_start_index
|
if is_deposit_request and state.eth1_deposit_index < state.deposit_requests_start_index:
|
||||||
and deposit.slot > GENESIS_SLOT):
|
|
||||||
break
|
break
|
||||||
|
|
||||||
# Check if number of processed deposits fits in the limit
|
# Check if deposit has been finalized, otherwise, stop processing.
|
||||||
|
if deposit.slot > finalized_slot:
|
||||||
|
break
|
||||||
|
|
||||||
|
# Check if number of processed deposits fits in the limit, otherwise, stop processing.
|
||||||
if next_deposit_index > MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING:
|
if next_deposit_index > MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user