-
Notifications
You must be signed in to change notification settings - Fork 50
Conversation
68aff8b
to
e270db6
Compare
Using variadic arguments is very non-intrusive way to introduce options. This is very generic, and will allow to implement other options in the future.
0f1bea1
to
969532b
Compare
This comment has been minimized.
This comment has been minimized.
* Implement orphan pruning * Correct tests comments sha256(testKey) = 0001... sha256(testKey2) = 1000... sha256(foo) = 0010... * Remove redundant checks and copies no case produces nil sideNodes; nothing modifies the stored hashes * Refactor value storage Store values in a separate mapstore indexed by (hash(value)+key); allows pruning values Simplify pruning loops slightly as well * Fix array copy * Avoid extra key param * Fix idempotent Set can short circuit when the same value is already set * Deprecate past root access, remove prune as option * Index values by just path * Cleanup * Update deepsubtree.go Co-authored-by: John Adler <[email protected]> * verifyProofWithUpdates - Fix unused return value Co-authored-by: John Adler <[email protected]>
Now that #37 was merged in here. Can we actually resolve the merge conflicts, mark this as ready for review, give it a 2nd pass and finally merge it? |
No, #37 builds on the changes here. Hence the changes of #37 were merged into this branch / PR in 763105b ref: #24 (comment) |
Resolved the merge conflicts. Happy to help push this over the finish line if necessary! |
The only difference between the head from #37 and this PR is in diff celestiaorg/smt/smt.go roysc/smt/smt.go The diff: 305,308d304
< // The offset from the bottom of the tree to the start of the side nodes.
< // Note: i-offsetOfSideNodes is the index into sideNodes[]
< offsetOfSideNodes := smt.depth() - len(sideNodes)
<
312c308,312
< if i-offsetOfSideNodes < 0 || sideNodes[i-offsetOfSideNodes] == nil {
---
> // The offset from the bottom of the tree to the start of the side nodes
> // i-offsetOfSideNodes is the index into sideNodes[]
> offsetOfSideNodes := smt.depth() - len(sideNodes)
>
> if i-offsetOfSideNodes < 0 { Moving the offset calculation is from #35, so nothing to see there. The only thing of interest is that #37 removes the condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adlerjohn 👍🏼
Work in progress.
TODO:
AutoOrphanRemoval
option (false by default)((variadic arguments in constructor)With(opt Option)
?)