go-ethereum/trie
Daniel Liu 2563cd13ed
trie: cleanup stateTrie #25640 (#1113)
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.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-24 07:45:06 +08:00
..
committer.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
database.go core/state, trie: fix trie flush order for proper pruning #25581 (#1112) 2025-09-24 07:44:22 +08:00
database_test.go new EVM Upgrade 2021-09-21 16:53:46 +05:30
encoding.go trie: Derivesha with stacktrie (#21407) 2025-04-07 16:44:32 +08:00
encoding_test.go trie: remove deprecated uses of math.rand (#1136) 2025-06-25 16:57:23 +08:00
errors.go all: introduce trie owner notion #24750 (#1090) 2025-08-22 16:37:39 +08:00
hasher.go trie: fix some typos #25551 #25648 (#1111) 2025-09-21 18:51:15 +08:00
iterator.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
iterator_test.go core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
node.go trie: improve node rlp-decoding #25357 (#1109) 2025-09-17 08:42:42 +08:00
node_enc.go trie: faster trie node encoding (#24126) 2025-04-07 16:44:32 +08:00
node_test.go trie: improve node rlp-decoding #25357 (#1109) 2025-09-17 08:42:42 +08:00
nodeset.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
preimages.go core, eth, trie: rework preimage store #25287 (#1099) 2025-08-29 05:22:44 +08:00
proof.go core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
proof_test.go trie: fix some typos #25551 #25648 (#1111) 2025-09-21 18:51:15 +08:00
secure_trie.go trie: cleanup stateTrie #25640 (#1113) 2025-09-24 07:45:06 +08:00
secure_trie_test.go trie: fix some typos #25551 #25648 (#1111) 2025-09-21 18:51:15 +08:00
stacktrie.go all: introduce trie owner notion #24750 (#1090) 2025-08-22 16:37:39 +08:00
stacktrie_test.go trie: lint whitespace #25312 (#1098) 2025-08-28 18:49:37 +08:00
sync.go trie: fix gosimple lint issue #25309 (#1097) 2025-08-26 15:44:53 +08:00
sync_test.go core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
trie.go all: fix govet (#1517) 2025-09-21 18:55:13 +08:00
trie_test.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
util_test.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
utils.go trie: more linters #24783 (#1092) 2025-08-26 15:19:07 +08:00