Skip to content

Commit

Permalink
docs: fix the reverse of meaning in spec (tendermint#3387)
Browse files Browse the repository at this point in the history
https://tools.ietf.org/html/rfc6962#section-2.1
"The largest power of two less than the number of items" is actually correct!

    For n > 1, let k be the largest power of two smaller than n (i.e.,
    k < n <= 2k).
  • Loading branch information
siburu authored and melekes committed Mar 7, 2019
1 parent f25d727 commit 91b488f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/spec/blockchain/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ The differences between RFC 6962 and the simplest form a merkle tree are that:
The leaf nodes are `SHA256(0x00 || leaf_data)`, and inner nodes are `SHA256(0x01 || left_hash || right_hash)`.

2) When the number of items isn't a power of two, the left half of the tree is as big as it could be.
(The smallest power of two less than the number of items) This allows new leaves to be added with less
(The largest power of two less than the number of items) This allows new leaves to be added with less
recomputation. For example:

```
Expand Down

0 comments on commit 91b488f

Please sign in to comment.