From 08f71e2fb0af6a5ebc81dca7238ef0626043d5b0 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Tue, 22 Aug 2023 13:41:12 +0100 Subject: [PATCH] add another log for contracts by logs pruning --- crates/prune/src/pruner.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/prune/src/pruner.rs b/crates/prune/src/pruner.rs index bd30c4f941ad..0da7df36dbc0 100644 --- a/crates/prune/src/pruner.rs +++ b/crates/prune/src/pruner.rs @@ -132,11 +132,14 @@ impl Pruner { 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)) = @@ -464,6 +467,13 @@ impl Pruner { 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;