trie/bintrie: drop redundant zeroBlob local in DeleteAccount

The package already declares `var zero [32]byte` in binary_node.go,
and both GetAccount and UpdateAccount reference `zero[:]` directly.
The PR-introduced `zeroBlob` mirrored the older shadowing pattern
from DeleteStorage but is unnecessary here — drop it and reuse the
package-level value to match the canonical style on the create side.
This commit is contained in:
CPerezz 2026-04-08 12:12:53 +02:00
parent 090b757dc1
commit 7cf8c891ca
No known key found for this signature in database
GPG key ID: 62045F34B97177DD

View file

@ -317,17 +317,16 @@ func (t *BinaryTrie) UpdateStorage(address common.Address, key, value []byte) er
// enumerate every slot of a given account.
func (t *BinaryTrie) DeleteAccount(addr common.Address) error {
var (
zeroBlob [HashSize]byte
values = make([][]byte, StemNodeWidth)
stem = GetBinaryTreeKey(addr, zero[:])
values = make([][]byte, StemNodeWidth)
stem = GetBinaryTreeKey(addr, zero[:])
)
// Clear BasicData (nonce, balance, code size) and CodeHash.
values[BasicDataLeafKey] = zeroBlob[:]
values[CodeHashLeafKey] = zeroBlob[:]
values[BasicDataLeafKey] = zero[:]
values[CodeHashLeafKey] = zero[:]
// Write a non-nil 32-byte sentinel at the deletion marker offset so
// GetAccount can tell "deleted" apart from "never existed" on a
// subsequent read. See GetAccount's deletion branch around trie.go:219.
values[accountDeletedMarkerKey] = zeroBlob[:]
values[accountDeletedMarkerKey] = zero[:]
root, err := t.root.InsertValuesAtStem(stem, values, t.nodeResolver, 0)
if err != nil {