Closed davebryson closed 5 years ago
This shouldn't change the hash of the tree, but does use unnecessary disk space.
However, this won't be an issue after the rewrite happening in op-refactor
, where we'll coalesce all the deleted keys into a Vec<Vec<u8>>
then delete them when committing (or maybe just get them from the Batch, whichever seems to be faster).
This is based on the master branch.
It appears that a
TreeOp::Delete
will remove a node from the tree, but doesn't actually delete the node from storage on commitFor example, this test should pass, but fails on the last 2 asserts:
merk.commit
doesn'tdb.delete()
it only adds or overwrites (put
) values in the DB fromtree.modified()
.A possible side effect of this (haven't tested) is that a series of deletes may not change the root hash
All the delete related unit tests seem to miss this case.
Maybe
tree.modified
should include the TreeOps vs values?