trie/bintrie: wrap DeleteAccount error with address context

DeleteStorage, UpdateStorage, and UpdateContractCode all wrap the
underlying InsertValuesAtStem/Insert error with the offending
address ("(%x) error: %v"). UpdateAccount is the lone outlier and
DeleteAccount inherited that pattern. When InsertValuesAtStem fails
deep inside the recursion (e.g. a HashedNode resolver error),
"which address" is exactly the context the caller wants. Match
DeleteStorage, the closest sibling.
This commit is contained in:
CPerezz 2026-04-08 12:04:28 +02:00
parent 5befdfa928
commit e1673c1622
No known key found for this signature in database
GPG key ID: 62045F34B97177DD

View file

@ -331,7 +331,10 @@ func (t *BinaryTrie) DeleteAccount(addr common.Address) error {
values[accountDeletedMarkerKey] = zeroBlob[:]
t.root, err = t.root.InsertValuesAtStem(stem, values, t.nodeResolver, 0)
return err
if err != nil {
return fmt.Errorf("DeleteAccount (%x) error: %v", addr, err)
}
return nil
}
// accountDeletedMarkerKey is the stem offset used as a "this account was