diff --git a/crates/derive/src/pipeline/core.rs b/crates/derive/src/pipeline/core.rs index ca719edb3..30d43fcca 100644 --- a/crates/derive/src/pipeline/core.rs +++ b/crates/derive/src/pipeline/core.rs @@ -75,12 +75,16 @@ where /// Resets the pipelien by calling the [`ResettableStage::reset`] method. /// This will bubble down the stages all the way to the `L1Traversal` stage. - async fn reset(&mut self, block_info: BlockInfo) -> anyhow::Result<()> { + async fn reset( + &mut self, + l2_block_info: BlockInfo, + l1_block_info: BlockInfo, + ) -> anyhow::Result<()> { let system_config = self .l2_chain_provider - .system_config_by_number(block_info.number, Arc::clone(&self.rollup_config)) + .system_config_by_number(l2_block_info.number, Arc::clone(&self.rollup_config)) .await?; - match self.attributes.reset(block_info, &system_config).await { + match self.attributes.reset(l1_block_info, &system_config).await { Ok(()) => trace!(target: "pipeline", "Stages reset"), Err(StageError::Eof) => trace!(target: "pipeline", "Stages reset with EOF"), Err(err) => { diff --git a/crates/derive/src/traits/pipeline.rs b/crates/derive/src/traits/pipeline.rs index 3ed7f699d..bda924ad9 100644 --- a/crates/derive/src/traits/pipeline.rs +++ b/crates/derive/src/traits/pipeline.rs @@ -27,7 +27,7 @@ pub trait Pipeline: OriginProvider + Iterator { fn peek(&self) -> Option<&L2AttributesWithParent>; /// Resets the pipeline on the next [Pipeline::step] call. - async fn reset(&mut self, origin: BlockInfo) -> anyhow::Result<()>; + async fn reset(&mut self, l2_block_info: BlockInfo, origin: BlockInfo) -> anyhow::Result<()>; /// Attempts to progress the pipeline. async fn step(&mut self, cursor: L2BlockInfo) -> StepResult; diff --git a/examples/trusted-sync/src/main.rs b/examples/trusted-sync/src/main.rs index 48ee94095..4dc7876dd 100644 --- a/examples/trusted-sync/src/main.rs +++ b/examples/trusted-sync/src/main.rs @@ -137,7 +137,7 @@ async fn sync(cli: cli::Cli) -> Result<()> { .await .expect("Failed to fetch L1 block info for fast forward"); info!(target: LOG_TARGET, "Resetting pipeline with l1 block info: {:?}", l1_block_info); - if let Err(e) = pipeline.reset(l1_block_info).await { + if let Err(e) = pipeline.reset(c.block_info, l1_block_info).await { error!(target: LOG_TARGET, "Failed to reset pipeline: {:?}", e); continue; } @@ -162,7 +162,7 @@ async fn sync(cli: cli::Cli) -> Result<()> { .await .expect("Failed to fetch L1 block info for fast forward"); info!(target: LOG_TARGET, "Resetting pipeline with l1 block info: {:?}", l1_block_info); - if let Err(e) = pipeline.reset(l1_block_info).await { + if let Err(e) = pipeline.reset(c.block_info, l1_block_info).await { error!(target: LOG_TARGET, "Failed to reset pipeline: {:?}", e); continue; }