Implement BitArray and replace trie.Key#2322
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2322 +/- ##
==========================================
- Coverage 74.92% 74.63% -0.29%
==========================================
Files 111 111
Lines 12171 12581 +410
==========================================
+ Hits 9119 9390 +271
- Misses 2353 2489 +136
- Partials 699 702 +3 ☔ View full report in Codecov by Sentry. |
rodrodros
reviewed
Dec 16, 2024
Contributor
rodrodros
left a comment
There was a problem hiding this comment.
Just some comments. Let. me know what you think. Thanks for detailing the implementation!
ad6a3ba to
41fc99c
Compare
rodrodros
reviewed
Dec 18, 2024
c7fd009 to
2692494
Compare
7ba050a to
7f479c1
Compare
AnkushinDaniil
approved these changes
Jan 14, 2025
rianhughes
reviewed
Jan 15, 2025
rianhughes
reviewed
Jan 15, 2025
rianhughes
reviewed
Jan 16, 2025
rianhughes
reviewed
Jan 16, 2025
rianhughes
reviewed
Jan 16, 2025
rianhughes
reviewed
Jan 16, 2025
rianhughes
reviewed
Jan 16, 2025
6e68d5f to
b67ff0a
Compare
rianhughes
reviewed
Jan 17, 2025
rianhughes
reviewed
Jan 17, 2025
rianhughes
reviewed
Jan 17, 2025
rianhughes
reviewed
Jan 17, 2025
rianhughes
reviewed
Jan 17, 2025
rianhughes
reviewed
Jan 17, 2025
minor minor fix
This reverts commit 5b6558b.
86fa630 to
8f22ebd
Compare
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.
This PR implements a new data structure
BitArrayto replacetrie.Key. The reasons being:Misleading representation
trie.Keydoesn't actually just represent a Trie key in our use case. But rather, it’s a special data type that we use to just represent a fixed size of bit array with the number of bits used specified.Inefficient operations
The current implementation of the bitwise operations is scattered all around the place. We implement ourselves for some, and for others, we rely on conversion.
BitArrayimplements everything from scratch without unnecessary conversion.Regarding
BitArray:trie.KeyCredits: some implementation details are inspired by
https://github.com/holiman/uint256