Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/stages/stages/src/stages/era.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,16 @@ where

height
} else {
input.target()
// It's possible for a pipeline sync to be executed with a None target, e.g. after a
// stage was manually dropped, and `reth node` is then called without a `--debug.tip`.
//
// In this case we don't want to simply default to zero, as that would overwrite the
// previously stored checkpoint block number. Instead we default to that previous
// checkpoint.
Comment on lines +214 to +219
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this checks out

input.target.unwrap_or_else(|| input.checkpoint().block_number)
};

Ok(ExecOutput { checkpoint: StageCheckpoint::new(height), done: height == input.target() })
Ok(ExecOutput { checkpoint: StageCheckpoint::new(height), done: height >= input.target() })
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

}

fn unwind(
Expand Down
Loading