ethereum / go-verkle

A go implementation of Verkle trees
The Unlicense
209 stars 63 forks source link

Add leaf group "erasure" function #449

Open gballet opened 3 weeks ago

gballet commented 3 weeks ago

This is needed to fix tests in https://github.com/rjl493456442/go-ethereum/pull/12 : Gary's stuff will call DeleteAccount if the account is non-existent. While this is quite unclean and should be fixed at the geth layer, I reckon that it is much more difficult to do than designing the verkle library to handle this.

As a result, I introduce an EraseStem method, which is used to replace InsertAtStem when deleting a function: it will go through the tree, find a group if it exsits, and overwrite all values present in that group. This is less invasive than the current method of calling InsertAtStem with 256 non-zero values.

It has the following drawbacks:

gballet commented 3 weeks ago

Fixes #448