silkworm icon indicating copy to clipboard operation
silkworm copied to clipboard

HashBuilder - Each merkle tree MUST have a root node

Open AndreaLanfranchi opened this issue 2 years ago • 0 comments

When an empty hasbuilder processes leaves all starting with the same non-zero length prefix a root node is NOT created while it SHOULD

Eg. with these keys starting all with same 04 nibble

040000[...]
040005[...]
040b00[...]

only a node with key 04 is created with root_hash while instead ALSO OR ONLY a root node (with empty key and tree_mask == 0b0000000000001000) SHOULD be created and that one should have root hash

AndreaLanfranchi avatar Aug 10 '22 11:08 AndreaLanfranchi