@@ -34,12 +34,11 @@ use crate::{
3434 hooks:: OnComponentInitializedHook ,
3535 BuilderContext , ExExLauncher , NodeAdapter , PrimitivesTy ,
3636} ;
37- use alloy_consensus:: BlockHeader as _;
3837use alloy_eips:: eip2124:: Head ;
3938use alloy_primitives:: { BlockNumber , B256 } ;
4039use eyre:: Context ;
4140use rayon:: ThreadPoolBuilder ;
42- use reth_chainspec:: { Chain , EthChainSpec , EthereumHardfork , EthereumHardforks } ;
41+ use reth_chainspec:: { Chain , EthChainSpec , EthereumHardforks } ;
4342use reth_config:: { config:: EtlConfig , PruneConfig } ;
4443use reth_consensus:: noop:: NoopConsensus ;
4544use reth_db_api:: { database:: Database , database_metrics:: DatabaseMetrics } ;
@@ -67,8 +66,8 @@ use reth_node_metrics::{
6766} ;
6867use reth_provider:: {
6968 providers:: { NodeTypesForProvider , ProviderNodeTypes , StaticFileProvider } ,
70- BlockHashReader , BlockNumReader , BlockReaderIdExt , ProviderError , ProviderFactory ,
71- ProviderResult , StageCheckpointReader , StaticFileProviderFactory ,
69+ BlockHashReader , BlockNumReader , ProviderError , ProviderFactory , ProviderResult ,
70+ StageCheckpointReader , StaticFileProviderFactory ,
7271} ;
7372use reth_prune:: { PruneModes , PrunerBuilder } ;
7473use reth_rpc_builder:: config:: RethRpcServerConfig ;
@@ -945,40 +944,6 @@ where
945944 Ok ( None )
946945 }
947946
948- /// Expire the pre-merge transactions if the node is configured to do so and the chain has a
949- /// merge block.
950- ///
951- /// If the node is configured to prune pre-merge transactions and it has synced past the merge
952- /// block, it will delete the pre-merge transaction static files if they still exist.
953- pub fn expire_pre_merge_transactions ( & self ) -> eyre:: Result < ( ) >
954- where
955- T : FullNodeTypes < Provider : StaticFileProviderFactory > ,
956- {
957- if self . node_config ( ) . pruning . bodies_pre_merge &&
958- let Some ( merge_block) = self
959- . chain_spec ( )
960- . ethereum_fork_activation ( EthereumHardfork :: Paris )
961- . block_number ( )
962- {
963- // Ensure we only expire transactions after we synced past the merge block.
964- let Some ( latest) = self . blockchain_db ( ) . latest_header ( ) ? else { return Ok ( ( ) ) } ;
965- if latest. number ( ) > merge_block {
966- let provider = self . blockchain_db ( ) . static_file_provider ( ) ;
967- if provider
968- . get_lowest_transaction_static_file_block ( )
969- . is_some_and ( |lowest| lowest < merge_block)
970- {
971- info ! ( target: "reth::cli" , merge_block, "Expiring pre-merge transactions" ) ;
972- provider. delete_transactions_below ( merge_block) ?;
973- } else {
974- debug ! ( target: "reth::cli" , merge_block, "No pre-merge transactions to expire" ) ;
975- }
976- }
977- }
978-
979- Ok ( ( ) )
980- }
981-
982947 /// Returns the metrics sender.
983948 pub fn sync_metrics_tx ( & self ) -> UnboundedSender < MetricEvent > {
984949 self . right ( ) . db_provider_container . metrics_sender . clone ( )
0 commit comments