diff --git a/bin/reth/src/commands/import_op.rs b/bin/reth/src/commands/import_op.rs index 5362b45b0..577fc5de3 100644 --- a/bin/reth/src/commands/import_op.rs +++ b/bin/reth/src/commands/import_op.rs @@ -121,7 +121,7 @@ impl ImportOpCommand { info!(target: "reth::cli", "Chain file chunk read"); total_decoded_blocks += file_client.headers_len(); - total_decoded_txns += file_client.bodies_len(); + total_decoded_txns += file_client.total_transactions(); for (block_number, body) in file_client.bodies_iter_mut() { body.transactions.retain(|tx| { @@ -172,16 +172,17 @@ impl ImportOpCommand { let provider = provider_factory.provider()?; - let total_imported_blocks = provider.tx_ref().entries::()?; + let total_imported_blocks = provider.tx_ref().entries::()?; let total_imported_txns = provider.tx_ref().entries::()?; if total_decoded_blocks != total_imported_blocks || - total_decoded_txns != total_imported_txns + total_decoded_txns != total_imported_txns + total_filtered_out_dup_txns { error!(target: "reth::cli", total_decoded_blocks, total_imported_blocks, total_decoded_txns, + total_filtered_out_dup_txns, total_imported_txns, "Chain was partially imported" ); diff --git a/bin/reth/src/commands/import_receipts.rs b/bin/reth/src/commands/import_receipts.rs index e6aae327a..018ff132b 100644 --- a/bin/reth/src/commands/import_receipts.rs +++ b/bin/reth/src/commands/import_receipts.rs @@ -19,7 +19,7 @@ use reth_provider::{ BundleStateWithReceipts, OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StateWriter, StaticFileProviderFactory, StaticFileWriter, }; -use tracing::{debug, error, info}; +use tracing::{debug, error, info, trace}; use std::{path::PathBuf, sync::Arc}; @@ -89,7 +89,7 @@ impl ImportReceiptsCommand { for stage in StageId::ALL { let checkpoint = provider.get_stage_checkpoint(stage)?; - debug!(target: "reth::cli", + trace!(target: "reth::cli", ?stage, ?checkpoint, "Read stage checkpoints from db" diff --git a/crates/net/downloaders/src/file_client.rs b/crates/net/downloaders/src/file_client.rs index 85fac4642..7ce222d57 100644 --- a/crates/net/downloaders/src/file_client.rs +++ b/crates/net/downloaders/src/file_client.rs @@ -172,7 +172,7 @@ impl FileClient { /// Returns the current number of transactions in the client. pub fn total_transactions(&self) -> usize { - self.bodies.iter().flat_map(|(_, body)| &body.transactions).count() + self.bodies.iter().fold(0, |acc, (_, body)| acc + body.transactions.len()) } } diff --git a/crates/net/downloaders/src/receipt_file_client.rs b/crates/net/downloaders/src/receipt_file_client.rs index b6291d0a3..0eaa4ff1b 100644 --- a/crates/net/downloaders/src/receipt_file_client.rs +++ b/crates/net/downloaders/src/receipt_file_client.rs @@ -43,7 +43,7 @@ impl FromReader for ReceiptFileClient { trace!(target: "downloaders::file", target_num_bytes=num_bytes, capacity=stream.read_buffer().capacity(), - coded=?HackReceiptFileCodec, + codec=?HackReceiptFileCodec, "init decode stream" );