trie: deep-copy key

This commit is contained in:
Gary Rong 2026-06-18 13:59:35 +08:00
parent 128a491ec9
commit 381cc24b34

View file

@ -219,7 +219,7 @@ func (t *StateTrie) UpdateStorageBatch(_ common.Address, keys [][]byte, values [
for _, key := range keys {
hk := crypto.Keccak256(key)
if t.preimages != nil {
t.secKeyCache[common.Hash(hk)] = key
t.secKeyCache[common.Hash(hk)] = common.CopyBytes(key)
}
hkeys = append(hkeys, hk)
}