fix(prune): reth prune requires being run twice to actually prune (#21785)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
YK
2026-02-05 11:08:49 +08:00
committed by GitHub
parent 05ec479398
commit dfc54cf89f
3 changed files with 43 additions and 7 deletions

View File

@@ -100,12 +100,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> PruneComma
let batch_pruned: usize = output.segments.iter().map(|(_, seg)| seg.pruned).sum();
total_pruned = total_pruned.saturating_add(batch_pruned);
// Check if all segments are finished (not just the overall progress,
// since the pruner sets overall progress from the last segment only)
let all_segments_finished =
output.segments.iter().all(|(_, seg)| seg.progress.is_finished());
if all_segments_finished {
if output.progress.is_finished() {
info!(target: "reth::cli", total_pruned, "Pruned data from database");
break;
}