go-ethereum/core/rawdb
rjl493456442 12241bde26
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
core: add debug log and repair the missing hash and receipts (#35190)
This PR improves the block download used by snap sync. Specifically,
blocks and their associated data (receipts and canonical hash mappings)
are now written directly to the database without checking existence.

The current implementation could fail in cases where the block header
and body were already present (has.Block returns true), but the
corresponding canonical hash mapping was missing. One possible scenario
is when a newPayload event is processed without a subsequent
forkChoiceUpdate.

It is still unclear why Geth may re-enter snap sync after Engine API
events have been processed after the sync. Anyway, bypassing the
existence is a reasonable change.

What's more, in the downloader, the presence of canonical hash is also
considered for deciding the range of blocks to be downloaded.
Specifically:

- in the full sync, the block with header and body available but
canonical hash missing will be re-inserted;
- in the snap sync, the block with header, body and receipt available
but canonical hash missing will be re-inserted;
2026-06-23 14:46:38 +08:00
..
ancienttest core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
eradb core/rawdb/eradb: support ere files in era store (#34978) 2026-06-22 17:00:43 +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/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
accessors_chain_test.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
accessors_history.go core/rawdb, triedb/pathdb: introduce trienode history (#32596) 2025-10-10 14:51:27 +08:00
accessors_indexes.go all: fix all typos, as reported by crates-ci/typos (#35008) 2026-06-10 18:50:51 +02:00
accessors_indexes_test.go ethapi: reduce some of the wasted effort in GetTransactionReceipt (#32021) 2025-07-01 15:18:49 +08:00
accessors_metadata.go core/rawdb: remove outdated functions (#32542) 2025-09-04 17:25:33 +08:00
accessors_overlay.go core/state: introduce the TransitionState object (verkle transition part 1) (#31634) 2025-08-05 09:34:12 +08:00
accessors_snapshot.go eth/downloader, eth/protocols/snap: freeze pivot once state is downloaded (#35155) 2026-06-15 16:09:41 +08:00
accessors_state.go core/rawdb, triedb/pathdb: re-structure the trienode history header (#32907) 2025-10-25 16:16:16 +08:00
accessors_sync.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
accessors_trie.go core/rawdb: fix misleading comment in HasTrieNode (#32599) 2025-09-15 10:45:50 +08:00
ancient_scheme.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
ancient_utils.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
chain_freezer.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
chain_iterator.go core/rawdb: fix incorrect tail value in unindexTransactions log output (#33796) 2026-02-09 15:49:53 +08:00
chain_iterator_test.go core/rawdb: skip missing block bodies during tx unindexing (#33573) 2026-01-12 14:25:22 +08:00
database.go ethdb/pebble, cmd, node: add pebble v2 support (#34009) 2026-06-22 12:50:49 +02:00
freezer.go core: add debug log and repair the missing hash and receipts (#35190) 2026-06-23 14:46:38 +08:00
freezer_batch.go core/rawdb: capture open file error and fix resource leak (#33147) 2025-11-11 16:01:37 +08:00
freezer_memory.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
freezer_memory_test.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08: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, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08: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: fix file descriptor leak in freezer error paths (#34735) 2026-04-20 11:06:17 +08:00
freezer_table_test.go core/rawdb, triedb/pathdb: enable trienode history alongside existing data (#33934) 2026-03-12 09:21:54 +08:00
freezer_test.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
freezer_utils.go core/rawdb: fix file descriptor leak in freezer error paths (#34735) 2026-04-20 11:06:17 +08:00
freezer_utils_test.go all: more linters (#24783) 2022-06-13 16:24:45 +02:00
freezer_utils_unix.go core/rawdb: fix freezer dir.Sync() failure on Windows (#34115) 2026-03-30 15:34:23 +08:00
freezer_utils_windows.go core/rawdb: fix freezer dir.Sync() failure on Windows (#34115) 2026-03-30 15:34:23 +08: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 eth/downloader, eth/protocols/snap: freeze pivot once state is downloaded (#35155) 2026-06-15 16:09:41 +08:00
table.go core/rawdb, ethdb, cmd, triedb: manage finalized block-accessList in freezer (#34977) 2026-06-01 11:01:42 +08:00
table_test.go ethdb: Implement DeleteRange in batch (#31947) 2025-06-20 19:40:41 +08:00