gballet / multiproof-rs

A rust implementation of Alexey Akhunov's multiproof algorithm
Apache License 2.0
32 stars 8 forks source link

EmptyNode now default root, make insertion into empty node possible #36

Closed gballet closed 5 years ago

gballet commented 5 years ago

This is preparation work for #28

So far it wasn't possible to insert a key into an empty node. This now makes it possible (by replacing the empty node with a leaf), and is closer to the behavior of geth. It is also going to be necessary in order to insert null entries for proofs.

s1na commented 5 years ago

An edge case is when this leaf's RLP has length < 32. In that case when computing the root hash, it's RLP needs to be hashed (despite the length).

gballet commented 5 years ago

Actually, this is true but unrelated to this PR. I have another one in the works that includes the >= 32 bytes test, so I will push it then.