reth icon indicating copy to clipboard operation
reth copied to clipboard

fix: correct execution stage clean threshold

Open dennsikl opened this issue 1 week ago • 0 comments
trafficstars

  • switch execution_external_clean_threshold to use the Merkle rebuild threshold
  • this matches the doc comment ("switching between incremental and full calculations") and what ExecutionStage::can_prune_changesets actually needs

With the old code we compared against merkle.incremental_threshold, which only limits how many blocks we can process incrementally. When that value is smaller than the real rebuild cutoff, ExecutionStage thinks Merkle will rebuild from scratch and allows pruning of change sets too early. That can leave the database in an inconsistent state if Merkle keeps running incrementally. Using rebuild_threshold fixes the logic and keeps pruning decisions in sync with the hashing pipeline.

dennsikl avatar Nov 07 '25 17:11 dennsikl