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 #71

Merged
merged 13 commits into from
Oct 1, 2024

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.

Fixed Issue(s)

thomas-quadratic and others added 11 commits September 29, 2024 20:52
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]>
Signed-off-by: Thomas Zamojski <[email protected]>
Copy link

github-actions bot commented Oct 1, 2024

  • I thought about the changelog.

@matkt matkt merged commit 32f8871 into hyperledger:main Oct 1, 2024
5 checks passed
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