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

differential insertion on hashed leaf nodes #253

Closed
wants to merge 8 commits into from

Conversation

gballet
Copy link
Member

@gballet gballet commented Jul 22, 2022

Second experiment for addressing #229 (see #231) : the signature of Insert is changed so that when values are inserted, and if a node is a hashed leaf node (i.e. a HashedNode with stem != nil), then no value is actually inserted and its commitment is computed from the delta between the old value and the new one.

Although its semantics haven't changed yet, LeafNode is expected, in the future, to only be used to initialize an extension-and-leaf-node, and never for an update. The end goal is to only use it into InsertStemOrdered and discontinue both InsertOrdered and InsertStem (if possible, it might be difficult to achieve because of an out-of-order conversion process).

With this method, LeafNodes are never directly stored into the DB: values are read from the snapshot, and provide all the necessary information to update the tree without storing the serialized list of values. This makes the whole tree smaller both in RAM and on disk. It will also reduce IO during the conversion process (pending a modification to embed the hashed node in its parent InternalNode) and root commitment calculations (no full polynomial evaluation at each node)

TODO:

  • also update the commitment of its parents
  • fix TestInsertIntoHashedNode
  • also implement it for StatelessNode
  • rebase once the hashed leaf nodes are stored directly into their parent InternalNode for reduced I/O.
  • add a fuzzer against a LeafNode tree

Out of scope:

  • Removal of InsertStem and InsertOrdered
  • diff-insertion of multiple values into the same leaf

@gballet gballet force-pushed the insert-diff-as-only-insert branch from 8ffe878 to 1cdfa6f Compare July 22, 2022 13:12
@gballet
Copy link
Member Author

gballet commented Mar 6, 2023

This has bitrotted for a long time, and most of its ideas are now implemented as part of other PRs. Closing.

@gballet gballet closed this Mar 6, 2023
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.

1 participant