From a53226d09a5d164c572de2289b0e32ca030a3638 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Thu, 29 Feb 2024 08:43:40 -0300 Subject: [PATCH] reverse the delte account fix Signed-off-by: Ignacio Hagopian --- trie/verkle.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/trie/verkle.go b/trie/verkle.go index 760e30c8cdaa..630e0b0a5b6d 100644 --- a/trie/verkle.go +++ b/trie/verkle.go @@ -213,6 +213,25 @@ func (trie *VerkleTrie) UpdateStorage(address common.Address, key, value []byte) } func (t *VerkleTrie) DeleteAccount(addr common.Address) error { + var ( + err error + values = make([][]byte, verkle.NodeWidth) + stem = t.pointCache.GetTreeKeyVersionCached(addr[:]) + ) + + for i := 0; i < verkle.NodeWidth; i++ { + values[i] = zero[:] + } + switch root := t.root.(type) { + case *verkle.InternalNode: + err = root.InsertValuesAtStem(stem, values, t.FlatdbNodeResolver) + default: + return errInvalidRootType + } + if err != nil { + return fmt.Errorf("DeleteAccount (%x) error: %v", addr, err) + } + return nil }