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
13 changes: 13 additions & 0 deletions crates/stages/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ where
"Stage encountered a validation error: {error}"
);

// FIXME: When handling errors, we do not commit the database transaction.
// This leads to the Merkle stage not clearing its
// checkpoint, and restarting from an invalid place.
drop(provider_rw);
provider_rw = factory.provider_rw().map_err(PipelineError::Interface)?;
provider_rw
.save_stage_checkpoint_progress(StageId::MerkleExecute, vec![])?;
provider_rw.save_stage_checkpoint(
StageId::MerkleExecute,
prev_checkpoint.unwrap_or_default(),
)?;
provider_rw.commit()?;

// We unwind because of a validation error. If the unwind itself fails,
// we bail entirely, otherwise we restart the execution loop from the
// beginning.
Expand Down