feat(stages): fail Execution if post execute commit input isn't consumed (#11418)

This commit is contained in:
Alexey Shekhirin
2024-10-02 14:47:45 +03:00
committed by GitHub
parent 4491b0d96a
commit 2a4f46b750
2 changed files with 10 additions and 6 deletions

View File

@ -125,6 +125,9 @@ pub enum StageError {
/// The prune checkpoint for the given segment is missing.
#[error("missing prune checkpoint for {0}")]
MissingPruneCheckpoint(PruneSegment),
/// Post Execute Commit error
#[error("post execute commit error occurred: {_0}")]
PostExecuteCommit(&'static str),
/// Internal error
#[error(transparent)]
Internal(#[from] RethError),

View File

@ -350,12 +350,13 @@ where
let previous_input =
self.post_execute_commit_input.replace(Chain::new(blocks, state.clone(), None));
debug_assert!(
previous_input.is_none(),
"Previous post execute commit input wasn't processed"
);
if let Some(previous_input) = previous_input {
tracing::debug!(target: "sync::stages::execution", ?previous_input, "Previous post execute commit input wasn't processed");
if previous_input.is_some() {
// Not processing the previous post execute commit input is a critical error, as it
// means that we didn't send the notification to ExExes
return Err(StageError::PostExecuteCommit(
"Previous post execute commit input wasn't processed",
))
}
}