diff --git a/core/rawdb/accessors_state.go b/core/rawdb/accessors_state.go index 7d7b37641b..44f041d82e 100644 --- a/core/rawdb/accessors_state.go +++ b/core/rawdb/accessors_state.go @@ -157,14 +157,6 @@ func WriteTrieJournal(db ethdb.KeyValueWriter, journal []byte) { } } -// DeleteTrieJournal deletes the serialized in-memory trie nodes of layers saved at -// the last shutdown. -func DeleteTrieJournal(db ethdb.KeyValueWriter) { - if err := db.Delete(trieJournalKey); err != nil { - log.Crit("Failed to remove tries journal", "err", err) - } -} - // ReadStateHistoryMeta retrieves the metadata corresponding to the specified // state history. Compute the position of state history in freezer by minus // one since the id of first state history starts from one(zero for initial diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index bb70b47624..c91f55addb 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -498,7 +498,6 @@ func (db *Database) Enable(root common.Hash) error { // Drop the stale state journal in persistent database and // reset the persistent state id back to zero. batch := db.diskdb.NewBatch() - rawdb.DeleteTrieJournal(batch) rawdb.DeleteSnapshotRoot(batch) rawdb.WritePersistentStateID(batch, 0) if err := batch.Write(); err != nil { @@ -568,8 +567,6 @@ func (db *Database) Recover(root common.Hash) error { // disk layer won't be accessible from outside. db.tree.init(dl) } - rawdb.DeleteTrieJournal(db.diskdb) - // Explicitly sync the key-value store to ensure all recent writes are // flushed to disk. This step is crucial to prevent a scenario where // recent key-value writes are lost due to an application panic, while