celestiaorg / smt

A Go library that implements a Sparse Merkle tree for a key-value map.
https://godoc.org/github.com/celestiaorg/smt
MIT License
138 stars 53 forks source link

Make branches updatable with sibling node value #27

Closed adlerjohn closed 3 years ago

adlerjohn commented 3 years ago

Fixes #25.

Add sibling node value to proofs if an updatable proof is requested. This allows leaves added via AddBranch with updatable proofs to be deleted.

adlerjohn commented 3 years ago

Waiting on https://github.com/lazyledger/smt/pull/21#discussion_r591884651 to fix CI, but if you run tests manually they pass now.

musalbas commented 3 years ago

Is this a draft or is it complete? I don't see "oldSiblingData" actually being used by anything, it's just being passed around.

adlerjohn commented 3 years ago

Is this a draft or is it complete? I don't see "oldSiblingData" actually being used by anything, it's just being passed around.

It's complete. oldSiblingData is actually not needed in UpdateForRoot or even deleteWithSideNodes, good catch. Fixed on 8a60137.