Closed musalbas closed 4 years ago
The entire optimised tree is now implemented and tests pass. TODOs:
This looks like great work! Do you plan to wrap up the outstanding todos (#5 (comment)) before merging?
On a sidenote we might consider fuzzing to ensure we aren't missing some weird edge cases.
Yes, I still intend to wrap up the remaining TODOs before it's ready to be merged.
I may add some lite fuzzing or random proofs for the proof verifier testing.
TODO: investigate why this case is not being hit by test. https://coveralls.io/builds/32535000/source?filename=proofs.go#L80
Edit: done.
It's probably a good idea to run sth like golangci-lint run
locally or in CI, too (will likely not help with the above problem though).
Looks like the DeepSparseMerkleSubTree.AddBranches needs to be reimplemented and cannot simply call the updateWithSideNodes function in an optimised tree, as this does more than simply add branches from the proof.
I think this is ready to be merged.
Speedtest to update 10,000 keys in a fresh tree: Before optimisations: 0m3.355s After optimisations: 0m0.327s
This confers to up to a ~10x speed-up.
Ok, I'm going to split compact proofs to a different type.
Done
WIP
With whitespaces changes hidden: https://github.com/lazyledger/smt/pull/5/files?diff=unified&w=1