From 5e00282f1815d378887349f1da8a932ad7f8b64c Mon Sep 17 00:00:00 2001 From: Cayman Date: Sun, 17 Feb 2019 13:13:19 -0600 Subject: [PATCH] Clarify merkle_root documentation This function is used to get the merkle root of some block roots which are themselves hashes, so the leaves do not need to be rehashed. Unfortunately, it's easy to assume that a merkle_root function would hash its leaves, so it should be clarified. --- specs/core/0_beacon-chain.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 544d792448..71fc2c72ce 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -995,6 +995,7 @@ def get_beacon_proposer_index(state: BeaconState, def merkle_root(values: List[Bytes32]) -> Bytes32: """ Merkleize ``values`` (where ``len(values)`` is a power of two) and return the Merkle root. + Note that the leaves are not hashed. """ o = [0] * len(values) + values for i in range(len(values) - 1, 0, -1):