mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
Addresses review finding I1. diskLayer.node() returned crypto.Keccak256Hash(blob) as the hash for ALL trie nodes regardless of the database's scheme. For the binary trie the correct hash is sha256 via binaryNodeHasher. The wrong hash was masked by noHashCheck=true in pathdb.NodeReader for the bintrie path, but HistoricalNodeReader.Node (which does NOT set noHashCheck) would never match the returned hash, silently falling through to the slow freezer-backed read on every call. Fix: replace crypto.Keccak256Hash(blob) with dl.db.hasher(blob) at both the clean-cache-hit and disk-read return paths. The hasher is already set to the correct function (merkleNodeHasher or binaryNodeHasher) at Database construction time. |
||
|---|---|---|
| .. | ||
| database | ||
| hashdb | ||
| internal | ||
| pathdb | ||
| database.go | ||
| generate.go | ||
| generate_test.go | ||
| history.go | ||
| preimages.go | ||
| preimages_test.go | ||
| states.go | ||