From e184f0b3fe3a660e9a31a37eed146e73aa65f040 Mon Sep 17 00:00:00 2001 From: Justin Drake Date: Sat, 20 Apr 2019 16:35:02 +1000 Subject: [PATCH] Fix --- specs/core/0_beacon-chain.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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