diff --git a/core/state/dump.go b/core/state/dump.go index 3756d89e30..cbf53de053 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -181,16 +181,16 @@ func (s *StateDB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey [] return nil, err } for storageIt.Next() { - key, err := storageIt.Key() - if err != nil { - // Silently ignore the storage slot without the key preimage. - continue - } val := storageIt.Slot() if err := storageIt.Error(); err != nil { + storageIt.Release() return nil, err } - account.Storage[key] = val.Hex() + key, err := storageIt.Key() + if err != nil { + continue + } + account.Storage[key] = common.Bytes2Hex(common.TrimLeftZeroes(val[:])) } storageIt.Release() } diff --git a/core/state/stateupdate.go b/core/state/stateupdate.go index 6f488595eb..582bcc3ec8 100644 --- a/core/state/stateupdate.go +++ b/core/state/stateupdate.go @@ -127,11 +127,6 @@ func NewStateUpdate(typ StorageKeyEncoding, originRoot common.Hash, root common. accounts[addrHash] = nil accountsOrigin[addr] = op.Origin - // If storage wiping is present, the StorageKeyEncoding MUST be hashed. - // Deleted storage slots are iterated from either the trie or the flat - // state snapshot, both of which use the storage slot hash as the identifier. - // Fortunately, storage wiping is no longer practical after the Cancun fork - // and is not expected to occur. if len(op.Storages) > 0 { storages[addrHash] = op.Storages }