RemoveVisitor Merges #37
thomas-quadratic
started this conversation in
Ideas
Replies: 1 comment
-
Indeed we have to find the tree as it was before. Otherwise the state will be invalid and bonsai will not be able to rollback . This is what is done on the PMT |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using PutVisitor to put a value, we can split in the middle of an extension.
However, as currently implemented, RemoveVisitor does not do the inverse operation. That is, if we remove a leaf, we could be in a state where we have Nodes with single child. These could be merged into a single Node with an extension.
This way, if we put then remove, we should necessarily get the Trie we started with.
Although not essential, in general, it would be desirable that the structure of the Trie depends only on its key-value pairs and not on the history of operations performed on it.
If validated, this would lead to a new issue.
Beta Was this translation helpful? Give feedback.
All reactions