diff --git a/bin/reth/src/stage/run.rs b/bin/reth/src/stage/run.rs index ec3c2a7c124ff..67d9aa8711f5b 100644 --- a/bin/reth/src/stage/run.rs +++ b/bin/reth/src/stage/run.rs @@ -259,17 +259,18 @@ impl Command { checkpoint: Some(checkpoint.with_block_number(self.from)), }; - while let ExecOutput { checkpoint, done: false } = - exec_stage.execute(&provider_rw, input).await? - { + while let ExecOutput { checkpoint, done } = exec_stage.execute(&provider_rw, input).await? { input.checkpoint = Some(checkpoint); provider_rw.save_stage_checkpoint(exec_stage.id(), checkpoint)?; - if self.commit { provider_rw.commit()?; provider_rw = factory.provider_rw().map_err(PipelineError::Interface)?; } + + if done { + break + } } if self.commit {