hypercore-protocol / hypercore-next

Hypercore 10 is an append only log with multi-writer primitives built in.
MIT License
150 stars 15 forks source link

final merkle tree tweak, breaking #109

Closed mafintosh closed 2 years ago

mafintosh commented 2 years ago

Needs a bit of cleanup (ie move legacy mode to the crypto module), but gets the job done as the final breaking change.

cc @chm-diederichs @kasperisager

Chris, this removes the unneeded byte id from the intermediate Merkle tree hashes to do a final simplification of that. The only thing ever trusted is the tree hash, which locks in the position of the tree using the node indexes.

The internal nodes do explicitly NOT include the index, as that means we can use it for dedup.

mafintosh commented 2 years ago

We decided not to do this, as the id helps with caching