go-ethereum/core/rawdb
rjl493456442 cca94792a4
core, cmd, trie: fix the condition of pathdb initialization (#28718)
Original problem was caused by #28595, where we made it so that as soon as we start to sync, the root of the disk layer is deleted. That is not wrong per se, but another part of the code uses the "presence of the root" as an init-check for the pathdb. And, since the init-check now failed, the code tried to re-initialize it which failed since a sync was already ongoing.

The total impact being: after a state-sync has begun, if the node for some reason is is shut down, it will refuse to start up again, with the error message: `Fatal: Failed to register the Ethereum service: waiting for sync.`. 

This change also modifies how `geth removedb` works, so that the user is prompted for two things: `state data` and `ancient chain`. The former includes both the chaindb aswell as any state history stored in ancients. 

---------

Co-authored-by: Martin HS <martin@swende.se>
2023-12-21 20:28:32 +01: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: add logging and fix comments around AncientRange function. (#28379) 2023-10-31 12:04:45 +01:00
accessors_chain_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
accessors_indexes.go core/types, params: add blob transaction type, RLP encoded for now (#27049) 2023-04-21 12:52:02 +03:00
accessors_indexes_test.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
accessors_metadata.go core/rawdb: don't warn for missing "unclean shutdown markers" (#28014) 2023-09-06 06:29:51 -04:00
accessors_snapshot.go core/rawdb: add specified key length iterator (#24535) 2022-03-15 10:28:26 +02:00
accessors_state.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
accessors_sync.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
accessors_trie.go cmd, core: resolve scheme from a read-write database (#28313) 2023-10-11 11:27:44 +03:00
ancient_scheme.go core, cmd, trie: fix the condition of pathdb initialization (#28718) 2023-12-21 20:28:32 +01:00
ancient_utils.go core, cmd, trie: fix the condition of pathdb initialization (#28718) 2023-12-21 20:28:32 +01:00
chain_freezer.go cmd/devp2p: update eth/snap protocol test suites for PoS (#28340) 2023-12-20 17:23:48 +01:00
chain_iterator.go core/rawdb: use atomic int added in go1.19 (#26935) 2023-03-21 07:10:23 -04:00
chain_iterator_test.go all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
database.go core, cmd, trie: fix the condition of pathdb initialization (#28718) 2023-12-21 20:28:32 +01: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: use readonly file lock in readonly mode (#28180) 2023-09-22 12:10:50 +02:00
freezer_batch.go core/rawdb: fsync the index file after each freezer write (#28483) 2023-11-10 12:56:39 +02:00
freezer_meta.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
freezer_meta_test.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
freezer_resettable.go core/rawdb: add logging and fix comments around AncientRange function. (#28379) 2023-10-31 12:04:45 +01:00
freezer_resettable_test.go core/rawdb: implement resettable freezer (#26324) 2022-12-19 04:59:12 -05:00
freezer_table.go core/rawdb: implement size reporting for live items in freezer_table (#28525) 2023-12-18 20:10:54 +01:00
freezer_table_test.go core/rawdb: implement size reporting for live items in freezer_table (#28525) 2023-12-18 20:10:54 +01:00
freezer_test.go core/rawdb: use readonly file lock in readonly mode (#28180) 2023-09-22 12:10:50 +02: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 beacon/light: add CommitteeChain (#27766) 2023-12-08 13:38:00 +01:00
table.go core: fix typos (#28218) 2023-09-29 10:52:22 +03:00
table_test.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00