Skip to content

Commit 8945be0

Browse files
committed
fix description of merkle trie depth calc
1 parent 0603a2d commit 8945be0

File tree

1 file changed

+1
-1
lines changed
  • src/content/developers/docs/data-structures-and-encoding/ssz

1 file changed

+1
-1
lines changed

src/content/developers/docs/data-structures-and-encoding/ssz/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ This SSZ serialized object can then be merkleized - that is transformed into a M
109109

110110
There are also cases where the leaves of the tree do not naturally evenly distribute in the way they do in the example above. For example, leaf 4 could be a container with multiple elements that require additional "depth" to be added to the Merkle tree, creating an uneven tree.
111111

112-
Instead of referring to these tree elements as leaf X, node X etc, we can give them generalized indices, starting with root = 1 and counting from left to right along each level. This is the generalized index explained above. Each element in the serialized list has a generalized index equal to `2**depth + idx` where idx is its zero-indexed position in the serialized object and the depth is the number of levels in the Merkle tree, which can be determined as the square root of the number of elements (leaves).
112+
Instead of referring to these tree elements as leaf X, node X etc, we can give them generalized indices, starting with root = 1 and counting from left to right along each level. This is the generalized index explained above. Each element in the serialized list has a generalized index equal to `2**depth + idx` where idx is its zero-indexed position in the serialized object and the depth is the number of levels in the Merkle tree, which can be determined as the base-two logarithm of the number of elements (leaves).
113113

114114
## Generalized indices {#generalized-indices}
115115

0 commit comments

Comments
 (0)