Fix hot state disk leak (#5768)

* Fix hot state leak

* Don't delete the genesis state when split is 0x0!
This commit is contained in:
Michael Sproul
2024-05-23 10:17:53 +10:00
committed by GitHub
parent 52e31121df
commit 8762d82adf
3 changed files with 68 additions and 10 deletions

View File

@@ -703,6 +703,11 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> BackgroundMigrator<E, Ho
));
store.do_atomically_with_block_and_blobs_cache(batch)?;
// Do a quick separate pass to delete obsoleted hot states, usually pre-states from the state
// advance which are not canonical due to blocks being applied on top.
store.prune_old_hot_states()?;
debug!(log, "Database pruning complete");
Ok(PruningOutcome::Successful {