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:
Justin 2019-04-15 07:54:08 +10:00 committed by GitHub
parent 40d6a2635a
commit 9eba123e2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2230,7 +2230,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
# Verify the 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,
depth=DEPOSIT_CONTRACT_TREE_DEPTH,
index=deposit.index,