Skip to content

Commit

Permalink
save one last checkpoint on stage run
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Nov 16, 2023
1 parent 662da5c commit 1764a25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/reth/src/stage/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,19 @@ impl Command {
checkpoint: Some(checkpoint.with_block_number(self.from)),
};

while let ExecOutput { checkpoint, done: false } =
exec_stage.execute(&provider_rw, input).await?
{
loop {
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 {
Expand Down

0 comments on commit 1764a25

Please sign in to comment.