go-ethereum/trie
rjl493456442 3f79afb599
trie: cleanup stateTrie (#25640)
It's a trivial PR to hide the error log when the trie node is not found in the database. The idea for this change is for all TryXXX functions, the error is already returned and we don't need to fire a log explicitly.

Recently there are a few tickets #25613 #25589 reporting that the trie nodes are missing because of debug.SetHead. The root cause is after resetting, the chain rewinds to a historical point and re-imports the blocks on top.

Since the node is already synced and started to accept transactions previously, these transactions are still kept in the txpool and verified by txpool with a live state. This live state is constructed based on the live trie database, which is changed fast by node referencing and de-referencing.

Unfortunately, when we construct a live state(like the state in txpool), we don't reference the state we have. The blockchain will garbage collect the intermediate version nodes in another thread which leads the broken live state.

The best solution for this is to forcibly obtain a reference for all live states we create and call release function once it's used up. But it might end up with more junks persisted into disk. Will try to find an elegant solution later in the following PR.
2022-08-31 18:18:18 +02:00
..
committer.go core, trie: rework trie committer (#25320) 2022-08-04 11:03:20 +03:00
database_test.go trie: there's no point in retrieving the metaroot 2019-04-05 13:09:28 +03:00
database.go trie: fix grammar in comment (#25648) 2022-08-31 16:26:39 +02:00
encoding_test.go trie: use stacktrie for Derivesha operation (#21407) 2020-09-29 17:38:13 +02:00
encoding.go trie: use stacktrie for Derivesha operation (#21407) 2020-09-29 17:38:13 +02:00
errors.go all: introduce trie owner notion (#24750) 2022-06-06 17:14:55 +02:00
hasher.go all: fix some typos (#25551) 2022-08-19 09:00:21 +03:00
iterator_test.go core: use TryGetAccount to read what TryUpdateAccount has written (#25458) 2022-08-04 16:13:18 +02:00
iterator.go core, trie: rework trie committer (#25320) 2022-08-04 11:03:20 +03:00
node_enc.go rlp, trie: faster trie node encoding (#24126) 2022-03-09 14:45:17 +01:00
node_test.go trie: improve node rlp decoding performance (#25357) 2022-08-19 00:39:47 +02:00
node.go trie: improve node rlp decoding performance (#25357) 2022-08-19 00:39:47 +02:00
nodeset.go core, trie: rework trie committer (#25320) 2022-08-04 11:03:20 +03:00
preimages.go core, trie, eth, cmd: rework preimage store (#25287) 2022-07-27 20:37:04 +02:00
proof_test.go all: fix some typos (#25551) 2022-08-19 09:00:21 +03:00
proof.go core: use TryGetAccount to read what TryUpdateAccount has written (#25458) 2022-08-04 16:13:18 +02:00
secure_trie_test.go all: fix some typos (#25551) 2022-08-19 09:00:21 +03:00
secure_trie.go trie: cleanup stateTrie (#25640) 2022-08-31 18:18:18 +02:00
stacktrie_test.go all: add whitespace linter (#25312) 2022-07-25 13:14:03 +03:00
stacktrie.go all: introduce trie owner notion (#24750) 2022-06-06 17:14:55 +02:00
sync_test.go core: use TryGetAccount to read what TryUpdateAccount has written (#25458) 2022-08-04 16:13:18 +02:00
sync.go trie: fix 'gosimple' lint issue (#25309) 2022-07-15 18:36:05 +02:00
trie_test.go core, trie: rework trie committer (#25320) 2022-08-04 11:03:20 +03:00
trie.go core: use TryGetAccount to read what TryUpdateAccount has written (#25458) 2022-08-04 16:13:18 +02:00
util_test.go core, trie: rework trie committer (#25320) 2022-08-04 11:03:20 +03:00
utils.go all: more linters (#24783) 2022-06-13 16:24:45 +02:00