mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 21:16:52 +00:00
Fix
This commit is contained in:
parent
06f475a844
commit
e184f0b3fe
@ -1959,10 +1959,6 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
|
|||||||
Process an Eth1 deposit, registering a validator or increasing its balance.
|
Process an Eth1 deposit, registering a validator or increasing its balance.
|
||||||
Note that this function mutates ``state``.
|
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
|
# Verify the Merkle branch
|
||||||
assert verify_merkle_branch(
|
assert verify_merkle_branch(
|
||||||
leaf=hash(serialize(deposit.data)), # 48 + 32 + 8 + 96 = 184 bytes serialization
|
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,
|
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]
|
validator_pubkeys = [v.pubkey for v in state.validator_registry]
|
||||||
pubkey = deposit.data.pubkey
|
pubkey = deposit.data.pubkey
|
||||||
amount = deposit.data.amount
|
amount = deposit.data.amount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user