Skip to content

Commit 8b11e04

Browse files
committed
fix: skip storage entries with missing preimage keys
1 parent 4cd93d4 commit 8b11e04

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

core/state/dump.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ func (s *StateDB) dump(c collector, excludeCode, excludeStorage, excludeMissingP
147147
log.Error("Failed to decode the value returned by iterator", "error", err)
148148
continue
149149
}
150-
account.Storage[common.BytesToHash(s.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(content)
150+
key := s.trie.GetKey(storageIt.Key)
151+
if key == nil {
152+
continue
153+
}
154+
account.Storage[common.BytesToHash(key)] = common.Bytes2Hex(content)
151155
}
152156
}
153157
c.onAccount(addr, account)

0 commit comments

Comments
 (0)