-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement BitArray
and replace trie.Key
#2322
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2322 +/- ##
==========================================
+ Coverage 74.42% 74.83% +0.41%
==========================================
Files 110 110
Lines 11771 11901 +130
==========================================
+ Hits 8760 8906 +146
+ Misses 2329 2322 -7
+ Partials 682 673 -9 ☔ View full report in Codecov by Sentry. |
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.
Just some comments. Let. me know what you think. Thanks for detailing the implementation!
ad6a3ba
to
41fc99c
Compare
c7fd009
to
2692494
Compare
4cd76b4
to
23c46f0
Compare
0f8ccca
to
0889735
Compare
This PR implements a new data structure
BitArray
to replacetrie.Key
. The reasons being:Misleading representation
trie.Key
doesn'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.
BitArray
implements everything from scratch without unnecessary conversion.Regarding
BitArray
:trie.Key
Credits: some implementation details are inspired by
https://github.com/holiman/uint256