diff --git a/crates/cli/commands/src/stage/drop.rs b/crates/cli/commands/src/stage/drop.rs index 26165497d0..e324c98515 100644 --- a/crates/cli/commands/src/stage/drop.rs +++ b/crates/cli/commands/src/stage/drop.rs @@ -5,7 +5,7 @@ use itertools::Itertools; use reth_chainspec::{EthChainSpec, EthereumHardforks}; use reth_cli::chainspec::ChainSpecParser; use reth_db::{static_file::iter_static_files, tables}; -use reth_db_api::transaction::DbTxMut; +use reth_db_api::transaction::{DbTx, DbTxMut}; use reth_db_common::{ init::{insert_genesis_header, insert_genesis_history, insert_genesis_state}, DbTool, @@ -13,6 +13,7 @@ use reth_db_common::{ use reth_node_builder::NodeTypesWithEngine; use reth_node_core::args::StageEnum; use reth_provider::{writer::UnifiedStorageWriter, StaticFileProviderFactory}; +use reth_prune::PruneSegment; use reth_stages::StageId; use reth_static_file_types::StaticFileSegment; @@ -89,6 +90,17 @@ impl> Command } StageEnum::Senders => { tx.clear::()?; + // Reset pruned numbers to not count them in the next rerun's stage progress + if let Some(mut prune_checkpoint) = + tx.get::(PruneSegment::SenderRecovery)? + { + prune_checkpoint.block_number = None; + prune_checkpoint.tx_number = None; + tx.put::( + PruneSegment::SenderRecovery, + prune_checkpoint, + )?; + } tx.put::( StageId::SenderRecovery.to_string(), Default::default(),