go-ethereum/core/rawdb
Felföldi Zsolt ebb3eb29d3
core/filtermaps: fix map renderer reorg issue (#31642)
This PR fixes a bug in the map renderer that sometimes used an obsolete
block log value pointer to initialize the iterator for rendering from a
snapshot. This bug was triggered by chain reorgs and sometimes caused
indexing errors and invalid search results. A few other conditions are
also made safer that were not reported to cause issues yet but could
potentially be unsafe in some corner cases. A new unit test is also
added that reproduced the bug but passes with the new fixes.

Fixes https://github.com/ethereum/go-ethereum/issues/31593
Might also fix https://github.com/ethereum/go-ethereum/issues/31589
though this issue has not been reproduced yet, but it appears to be
related to a log index database corruption around a specific block,
similarly to the other issue.

Note that running this branch resets and regenerates the log index
database. For this purpose a `Version` field has been added to
`rawdb.FilterMapsRange` which will also make this easier in the future
if a breaking database change is needed or the existing one is
considered potentially broken due to a bug, like in this case.
2025-04-16 23:30:13 +02:00
..
ancienttest core/rawdb: implement in-memory freezer (#29135) 2024-04-30 11:33:22 +02:00
testdata core/rawdb: avoid unnecessary receipt processing for log filtering (#23147) 2021-09-28 12:54:49 +02:00
accessors_chain.go core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
accessors_chain_test.go core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
accessors_indexes.go core/filtermaps: fix map renderer reorg issue (#31642) 2025-04-16 23:30:13 +02:00
accessors_indexes_test.go core/bloombits: remove old bloombits logic and chain indexer (#31081) 2025-03-21 10:47:58 +01:00
accessors_metadata.go Revert "core/rawdb: remove unused transition status state accessors" (#30449) 2024-09-18 11:53:50 +03:00
accessors_snapshot.go all: fix various typos (#29542) 2024-04-16 15:44:00 +03:00
accessors_state.go core/rawdb,state: add preimage miss metric (#31295) 2025-03-07 11:23:19 +01:00
accessors_sync.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
accessors_trie.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
ancient_scheme.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
ancient_utils.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
chain_freezer.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
chain_iterator.go cmd/geth: add prune history command (#31384) 2025-03-21 13:12:56 +01:00
chain_iterator_test.go cmd/geth: add prune history command (#31384) 2025-03-21 13:12:56 +01:00
database.go core/filtermaps: hashdb safe delete range (#31525) 2025-03-31 14:47:56 +02:00
database_test.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
freezer.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_batch.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_memory.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_memory_test.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_meta.go core/rawdb: introduce flush offset in freezer (#30392) 2025-02-04 11:45:45 +01:00
freezer_meta_test.go core/rawdb: introduce flush offset in freezer (#30392) 2025-02-04 11:45:45 +01:00
freezer_resettable.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_resettable_test.go core/rawdb: implement in-memory freezer (#29135) 2024-04-30 11:33:22 +02:00
freezer_table.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_table_test.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_test.go core/rawdb: allow for truncation in the freezer (#31362) 2025-03-17 16:01:37 +01:00
freezer_utils.go core/rawdb: fsync the index file after each freezer write (#28483) 2023-11-10 12:56:39 +02:00
freezer_utils_test.go all: more linters (#24783) 2022-06-13 16:24:45 +02:00
key_length_iterator.go core/rawdb: add specified key length iterator (#24535) 2022-03-15 10:28:26 +02:00
key_length_iterator_test.go core/rawdb: add specified key length iterator (#24535) 2022-03-15 10:28:26 +02:00
schema.go core/rawdb: remove LES database stats (#31495) 2025-03-26 12:48:04 +01:00
table.go ethdb: add DeleteRange feature (#30668) 2024-10-25 17:33:46 +02:00
table_test.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00