Skip to content

Commit

Permalink
add another log for contracts by logs pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Aug 22, 2023
1 parent 1ac798b commit 08f71e2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/prune/src/pruner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ impl<DB: Database> Pruner<DB> {

if !self.modes.contract_logs_filter.is_empty() {
let part_start = Instant::now();
self.prune_receipts_by_logs(&provider, tip_block_number)?;
let part_done = self.prune_receipts_by_logs(&provider, tip_block_number)?;
done = done && part_done;
self.metrics
.get_prune_part_metrics(PrunePart::ContractLogs)
.duration_seconds
.record(part_start.elapsed())
} else {
trace!(target: "pruner", prune_part = ?PrunePart::ContractLogs, "No filter to prune");
}

if let Some((to_block, prune_mode)) =
Expand Down Expand Up @@ -464,6 +467,13 @@ impl<DB: Database> Pruner<DB> {
block_ranges.push((*start_block, end_block, filtered_addresses.len()));
}

trace!(
target: "pruner",
?block_ranges,
?filtered_addresses,
"Calculated block ranges and filtered addresses",
);

let mut limit = self.batch_sizes.receipts;
let mut done = true;
let mut last_pruned_block = None;
Expand Down

0 comments on commit 08f71e2

Please sign in to comment.