chore(trie): Add support for trie V1#3433
Merged
dimartiro merged 164 commits intodevelopmentfrom Nov 21, 2023
Merged
Conversation
This was referenced Aug 10, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## development #3433 +/- ##
===============================================
- Coverage 50.17% 50.07% -0.11%
===============================================
Files 229 229
Lines 28518 28604 +86
===============================================
+ Hits 14310 14323 +13
- Misses 12703 12753 +50
- Partials 1505 1528 +23 |
b816195 to
634f315
Compare
EclesioMeloJunior
requested changes
Nov 15, 2023
Member
EclesioMeloJunior
left a comment
There was a problem hiding this comment.
LGTM, just small observations
EclesioMeloJunior
requested changes
Nov 16, 2023
timwu20
reviewed
Nov 16, 2023
EclesioMeloJunior
approved these changes
Nov 20, 2023
timwu20
approved these changes
Nov 20, 2023
|
🎉 This PR is included in version 0.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Basically the thing that I changed is the way we encode the trie, when we are using v1 we can have hashed values for both branches and leaves.
What I did is to keep our trie as it is storing the value in the way we were doing it but I only change the encode / decode method to, for example, hash the values (greater than 32bytes) to be hashed in the encoded representation.
Since we are using the encoded node to calculate the hash I had to modify those methods too.
I also I added the
IsHashedValueflag inNodestructure for those cases where we are decoding nodes and they are encoded with the v1 format (usually used when verifying merkle proofs)Summary of changes
Tests
make testIssues
close #2418
Primary Reviewer
@timwu20