Skip to content

Commit

Permalink
fix(client): Break when the pipeline cannot advance (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby authored Sep 3, 2024
1 parent 00eb4e3 commit bea2f62
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bin/client/src/l1/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use alloy_consensus::{Header, Sealed};
use anyhow::{anyhow, Result};
use core::fmt::Debug;
use kona_derive::{
errors::StageError,
pipeline::{DerivationPipeline, Pipeline, PipelineBuilder, StepResult},
sources::EthereumDataSource,
stages::{
Expand Down Expand Up @@ -163,18 +164,22 @@ where
StepResult::AdvancedOrigin => {
info!(target: "client_derivation_driver", "Advanced origin")
}
StepResult::OriginAdvanceErr(e) => {
warn!(target: "client_derivation_driver", "Failed to advance origin: {:?}", e)
}
StepResult::StepFailed(e) => {
warn!(target: "client_derivation_driver", "Failed to step derivation pipeline: {:?}", e)
StepResult::OriginAdvanceErr(e) | StepResult::StepFailed(e) => {
warn!(target: "client_derivation_driver", "Failed to step derivation pipeline: {:?}", e);

// Break the loop unless the error signifies that there is not enough data to
// complete the current step. In this case, we retry the step to see if other
// stages can make progress.
if !matches!(e, StageError::NotEnoughData) {
break;
}
}
}

attributes = self.pipeline.next();
}

Ok(attributes.expect("Must be some"))
Ok(attributes.expect("Failed to derive payload attributes"))
}

/// Finds the startup information for the derivation pipeline.
Expand Down

0 comments on commit bea2f62

Please sign in to comment.