differential insertion on hashed leaf nodes #253
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. aHashedNode
withstem != 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 intoInsertStemOrdered
and discontinue bothInsertOrdered
andInsertStem
(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 parentInternalNode
) and root commitment calculations (no full polynomial evaluation at each node)TODO:
TestInsertIntoHashedNode
StatelessNode
InternalNode
for reduced I/O.LeafNode
treeOut of scope:
InsertStem
andInsertOrdered