Skip to content

Commit

Permalink
instrument receipts pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Jul 12, 2023
1 parent 741777a commit 72f0db0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/prune/src/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use reth_provider::{
BlockReader, DatabaseProviderRW, ProviderError, ProviderFactory, PruneCheckpointWriter,
};
use std::sync::Arc;
use tracing::debug;
use tracing::{debug, instrument};

/// Result of [Pruner::run] execution
pub type PrunerResult = Result<(), PrunerError>;
Expand Down Expand Up @@ -85,6 +85,7 @@ impl<DB: Database> Pruner<DB> {
}

/// Prune receipts up to the provided block, inclusive.
#[instrument(skip(self, provider), target = "pruner")]
fn prune_receipts(
&self,
provider: &DatabaseProviderRW<'_, DB>,
Expand All @@ -95,10 +96,7 @@ impl<DB: Database> Pruner<DB> {
.block_body_indices(to_block)?
.ok_or(ProviderError::BlockBodyIndicesNotFound(to_block))?;

debug!(target: "pruner", %to_block, "Pruning receipts");
let pruned_receipts =
provider.prune_table::<tables::Receipts, _>(..=to_block_body.last_tx_num())?;
debug!(target: "pruner", %to_block, pruned = %pruned_receipts, "Finished pruning receipts");
provider.prune_table::<tables::Receipts, _>(..=to_block_body.last_tx_num())?;

provider.save_prune_checkpoint(
PrunePart::Receipts,
Expand Down

0 comments on commit 72f0db0

Please sign in to comment.