NethermindEth / cortex-ssz

An implementation of the ETH2.0 Simple Serialize (SSZ) specification, for .NET Core (written in C#).
Other
1 stars 4 forks source link

Zero chunks should become 1 chunk when calculating merkle root #2

Closed flcl42 closed 1 year ago

flcl42 commented 1 year ago

According to https://github.com/ethereum/consensus-specs/blob/v0.11.1/ssz/simple-serialize.md:

next_pow_of_two(i): get the next power of 2 of i, if not already a power of 2, with 0 mapping to 1. Examples: 0->1, 1->1, 2->2, 3->4, 4->4, 6->8, 9->16