-
Notifications
You must be signed in to change notification settings - Fork 769
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
Optimize storage of default values in VerkleNode
#3476
Conversation
46377c8
to
c3a4ffb
Compare
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.
Nice, LGTM!
Need to fix some bugs locally before we merge. Just noticed I wasn't handling some of the changes correctly in the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
…reumjs/ethereumjs-monorepo into optimize-node-value-storage
…reumjs/ethereumjs-monorepo into optimize-node-value-storage
Optimizes how we store default values for
InternalNode
andLeafNode
so memory footprint is shrunk.For
InternalNode
, if an element ofinternalNode.children
has not been written to, the value is stored asnull
.For
LeafNode
, if an element of the values array is 0 and has not been written before, it's stored as0
. If it's 0 and has been deleted, it's stored as1
. Otherwise, it's stored in its 32 byteUint8Array
representation.Have also added some helpers to create default values (empty leafnode value, deleted leafnode value)