File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
crates/stages/stages/src/stages Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,16 @@ where
211211
212212 height
213213 } else {
214- input. target ( )
214+ // It's possible for a pipeline sync to be executed with a None target, e.g. after a
215+ // stage was manually dropped, and `reth node` is then called without a `--debug.tip`.
216+ //
217+ // In this case we don't want to simply default to zero, as that would overwrite the
218+ // previously stored checkpoint block number. Instead we default to that previous
219+ // checkpoint.
220+ input. target . unwrap_or_else ( || input. checkpoint ( ) . block_number )
215221 } ;
216222
217- Ok ( ExecOutput { checkpoint : StageCheckpoint :: new ( height) , done : height = = input. target ( ) } )
223+ Ok ( ExecOutput { checkpoint : StageCheckpoint :: new ( height) , done : height > = input. target ( ) } )
218224 }
219225
220226 fn unwind (
You can’t perform that action at this time.
0 commit comments