mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 21:16:52 +00:00
Remove serialization from consensus
Consensus now only cares about Merkleisation (i.e. `hash_tree_root`), not about serialization (i.e. `serialize`). This simplifies consensus code by a few tens of lines, is conceptually cleaner, and is more future proof. A corresponding change is required in the deposit contract.
This commit is contained in:
parent
40d6a2635a
commit
9eba123e2e
@ -2230,7 +2230,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
|
|||||||
|
|
||||||
# Verify the Merkle branch
|
# Verify the Merkle branch
|
||||||
merkle_branch_is_valid = verify_merkle_branch(
|
merkle_branch_is_valid = verify_merkle_branch(
|
||||||
leaf=hash(serialize(deposit.data)), # 48 + 32 + 8 + 96 = 184 bytes serialization
|
leaf=hash_tree_root(deposit.data),
|
||||||
proof=deposit.proof,
|
proof=deposit.proof,
|
||||||
depth=DEPOSIT_CONTRACT_TREE_DEPTH,
|
depth=DEPOSIT_CONTRACT_TREE_DEPTH,
|
||||||
index=deposit.index,
|
index=deposit.index,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user