This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic removal of orphan nodes (#24)
* Orphans removal - simple test * Add Option type and AutoRemoveOrphans 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. * Add missing comment * Implement removal of orphan nodes (#37) * 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 <adlerjohn@users.noreply.github.com> * verifyProofWithUpdates - Fix unused return value Co-authored-by: John Adler <adlerjohn@users.noreply.github.com> Co-authored-by: Roy Crihfield <roy@manteia.ltd> Co-authored-by: John Adler <adlerjohn@users.noreply.github.com> Co-authored-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
- Loading branch information
1 parent
8dd3dfe
commit 03ea407
Showing
9 changed files
with
291 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package smt | ||
|
||
// Option is a function that configures SMT. | ||
type Option func(*SparseMerkleTree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.