diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index b6b4bb13e..be0fb5d5a 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1959,10 +1959,6 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: Process an Eth1 deposit, registering a validator or increasing its balance. Note that this function mutates ``state``. """ - # Deposits must be processed in order - assert deposit.index == state.deposit_index - state.deposit_index += 1 - # Verify the Merkle branch assert verify_merkle_branch( leaf=hash(serialize(deposit.data)), # 48 + 32 + 8 + 96 = 184 bytes serialization @@ -1972,6 +1968,10 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: root=state.latest_eth1_data.deposit_root, ) + # Deposits must be processed in order + assert deposit.index == state.deposit_index + state.deposit_index += 1 + validator_pubkeys = [v.pubkey for v in state.validator_registry] pubkey = deposit.data.pubkey amount = deposit.data.amount