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 1918293
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/reth/src/stage/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1918293

Please sign in to comment.