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:
This behavior needs to be specified in the spec, since nil values are not overwritten
It also breaks the replay code, which uses the trick of checking that all values are 0 in order to simulate the "pre-verge" behavior of account deletion.
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 replaceInsertAtStem
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 callingInsertAtStem
with 256 non-zero values.It has the following drawbacks:
nil
values are not overwritten