Skip to content
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

Feature/stored nodes minimal cont'd #66

Conversation

thomas-quadratic
Copy link
Contributor

PR description

This is a continuation of the previous PR #65
It appeared that the previous PR had some bugs, and meanwhile it was decided to add stem extensions into the DB in order to be able to get stemNodes by stem without requiring a nearest request.

In this PR, InternalNodes include stem extensions into its encodedValues, useful to create the children Stored Nodes including their appropriate keys (location or stem). The key is then used to load the StoredNode.

StoredNode are also separated into Internal and Stem Nodes as well to reflect this difference.

thomas-quadratic and others added 11 commits July 8, 2024 11:41
Signed-off-by: Thomas Zamojski <[email protected]>
Stored nodes have encoded values with at least uncompressed commitments and children hashes.
All (little-endian) bytes are also tail truncated to compress their representation.
Furthermore, null nodes are represented by empty bytes (0x80 in RLP encoding).

The commit also includes a major refactoring of location attribute for nodes.
Previously, leaf location was their full key, which was a little awkward.
Now, node location is truly its location in the trie, no matter what kind of node it is.
Among other things, this means that we store a StemNode's depth along its stem, so we can retrieve its location.

Coming up is the possibility to store commitments in compressed form, which would save a lot of space (50% on commitments).

Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Karim Taam <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Copy link

  • I thought about the changelog.

Signed-off-by: Thomas Zamojski <[email protected]>
@matkt matkt closed this Oct 1, 2024
@matkt matkt deleted the feature/stored_nodes_minimal branch October 1, 2024 07:36
@thomas-quadratic thomas-quadratic restored the feature/stored_nodes_minimal branch October 1, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants