go-ethereum/trie/triedb/pathdb
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
..
database_test.go trie/triedb/pathdb: improve dirty node flushing trigger (#28426) 2023-10-31 11:39:55 +02:00
database.go core, cmd, trie: fix the condition of pathdb initialization (#28718) 2023-12-21 20:28:32 +01:00
difflayer_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
difflayer.go trie/triedb/pathdb: improve error log (#28177) 2023-09-22 09:33:17 +03:00
disklayer.go trie/triedb/pathdb: improve dirty node flushing trigger (#28426) 2023-10-31 11:39:55 +02:00
errors.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
history_test.go trie/triedb/pathdb, core/rawdb: enhance error message in freezer (#28198) 2023-10-23 15:46:39 +02:00
history.go trie/triedb/pathdb: improve dirty node flushing trigger (#28426) 2023-10-31 11:39:55 +02:00
journal.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
layertree.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
metrics.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
nodebuffer.go trie/triedb/pathdb: improve error log (#28177) 2023-09-22 09:33:17 +03:00
testutils.go all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00