mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
triedb/pathdb: store the entire node value for nodes at top levels
This commit is contained in:
parent
f9f67599d2
commit
f8049a0e6f
1 changed files with 6 additions and 0 deletions
|
|
@ -642,6 +642,12 @@ func (s *nodeSetWithOrigin) encodeNodeHistory(root common.Hash) (map[common.Hash
|
||||||
// encodeFullValue determines whether a node should be encoded
|
// encodeFullValue determines whether a node should be encoded
|
||||||
// in full format with a pseudo-random probabilistic algorithm.
|
// in full format with a pseudo-random probabilistic algorithm.
|
||||||
encodeFullValue = func(owner common.Hash, path string) bool {
|
encodeFullValue = func(owner common.Hash, path string) bool {
|
||||||
|
// For trie nodes at the first two levels of the account trie, it is very
|
||||||
|
// likely that all children are modified within a single state transition.
|
||||||
|
// In such cases, do not use diff mode.
|
||||||
|
if owner == (common.Hash{}) && len(path) < 2 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
h := fnv.New32a()
|
h := fnv.New32a()
|
||||||
h.Write(root.Bytes())
|
h.Write(root.Bytes())
|
||||||
h.Write(owner.Bytes())
|
h.Write(owner.Bytes())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue