Skip to content

Commit 683f052

Browse files
committed
stagedsync: add aggressive prune timeout for forkchoice finality mode
When --experimental.use-forkchoice-finality is enabled, the node stays stable at tip and no longer falls back to syncToTip mode, which previously triggered initialCycle=true with aggressive pruning. Without this natural pruning mechanism, CommitmentVals history accumulates at step boundaries (~5.5h on Polygon), growing from 0.7GB to 6.8GB and causing commit times to degrade from ~3s to 12s+. Use 60s prune timeout (>=1min triggers PruneSmallBatches adaptive batch ramp-up, bypassing the SpaceDirty early-exit guard) to drain commitment history when step boundaries are crossed. This produces a sawtooth pattern: commits degrade gradually then reset after pruning, with an overall median of ~5s over 8h of production observation.
1 parent a46c7cc commit 683f052

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

execution/stagedsync/stage_execute.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ func PruneExecutionStage(s *PruneState, tx kv.RwTx, cfg ExecuteBlockCfg, ctx con
489489
"externalTx", useExternalTx,
490490
)
491491
}
492+
} else if cfg.syncCfg.UseForkchoiceFinality {
493+
// Forkchoice finality keeps the node stable at tip, eliminating the natural
494+
// syncToTip fallbacks that triggered initialCycle=true with aggressive pruning.
495+
// Use aggressive timeout (>=1min triggers adaptive batch ramp-up in PruneSmallBatches)
496+
// to drain accumulated commitment history at step boundaries.
497+
pruneTimeout = 60 * time.Second
492498
}
493499

494500
pruneSmallBatchesStartTime := time.Now()

0 commit comments

Comments
 (0)