diff --git a/crates/derive/src/pipeline/mod.rs b/crates/derive/src/pipeline/mod.rs
index 71a168ba0..f5b555b7d 100644
--- a/crates/derive/src/pipeline/mod.rs
+++ b/crates/derive/src/pipeline/mod.rs
@@ -3,7 +3,7 @@
/// Re-export trait arguments.
pub use crate::traits::{
ChainProvider, DataAvailabilityProvider, L2ChainProvider, NextAttributes, OriginAdvancer,
- OriginProvider, Pipeline, PreviousStage, ResetProvider, ResettableStage, StepResult,
+ OriginProvider, Pipeline, ResetProvider, ResettableStage, StepResult,
};
/// Re-export stage types that are needed as inputs.
diff --git a/crates/derive/src/stages/attributes_queue.rs b/crates/derive/src/stages/attributes_queue.rs
index 6c79c31f3..6b40d2c19 100644
--- a/crates/derive/src/stages/attributes_queue.rs
+++ b/crates/derive/src/stages/attributes_queue.rs
@@ -1,7 +1,7 @@
//! Contains the logic for the `AttributesQueue` stage.
use crate::{
- traits::{NextAttributes, OriginAdvancer, OriginProvider, PreviousStage, ResettableStage},
+ traits::{NextAttributes, OriginAdvancer, OriginProvider, ResettableStage},
types::{
BlockInfo, L2AttributesWithParent, L2BlockInfo, L2PayloadAttributes, ResetError,
RollupConfig, SingleBatch, StageError, StageResult, SystemConfig,
@@ -45,7 +45,7 @@ pub trait AttributesProvider {
#[derive(Debug)]
pub struct AttributesQueue
where
- P: AttributesProvider + PreviousStage + Debug,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
AB: AttributesBuilder + Debug,
{
/// The rollup config.
@@ -62,7 +62,7 @@ where
impl
AttributesQueue
where
- P: AttributesProvider + PreviousStage + Debug,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
AB: AttributesBuilder + Debug,
{
/// Create a new [AttributesQueue] stage.
@@ -153,20 +153,10 @@ where
}
}
-impl
PreviousStage for AttributesQueue
-where
- P: AttributesProvider + PreviousStage + Send + Debug,
- AB: AttributesBuilder + Send + Debug,
-{
- fn previous(&self) -> Option> {
- Some(Box::new(&self.prev))
- }
-}
-
#[async_trait]
impl OriginAdvancer for AttributesQueue
where
- P: AttributesProvider + PreviousStage + Debug + Send,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug + Send,
AB: AttributesBuilder + Debug + Send,
{
async fn advance_origin(&mut self) -> StageResult<()> {
@@ -177,7 +167,7 @@ where
#[async_trait]
impl
NextAttributes for AttributesQueue
where
- P: AttributesProvider + PreviousStage + Debug + Send,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug + Send,
AB: AttributesBuilder + Debug + Send,
{
async fn next_attributes(
@@ -190,7 +180,7 @@ where
impl
OriginProvider for AttributesQueue
where
- P: AttributesProvider + PreviousStage + Debug,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
AB: AttributesBuilder + Debug,
{
fn origin(&self) -> Option {
@@ -201,7 +191,7 @@ where
#[async_trait]
impl ResettableStage for AttributesQueue
where
- P: AttributesProvider + PreviousStage + Send + Debug,
+ P: AttributesProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
AB: AttributesBuilder + Send + Debug,
{
async fn reset(
diff --git a/crates/derive/src/stages/batch_queue.rs b/crates/derive/src/stages/batch_queue.rs
index 19299e67a..26f5f2eb0 100644
--- a/crates/derive/src/stages/batch_queue.rs
+++ b/crates/derive/src/stages/batch_queue.rs
@@ -2,7 +2,7 @@
use crate::{
stages::attributes_queue::AttributesProvider,
- traits::{L2ChainProvider, OriginAdvancer, OriginProvider, PreviousStage, ResettableStage},
+ traits::{L2ChainProvider, OriginAdvancer, OriginProvider, ResettableStage},
types::{
Batch, BatchValidity, BatchWithInclusionBlock, BlockInfo, L2BlockInfo, RollupConfig,
SingleBatch, StageError, StageResult, SystemConfig,
@@ -43,7 +43,7 @@ pub trait BatchQueueProvider {
#[derive(Debug)]
pub struct BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
BF: L2ChainProvider + Debug,
{
/// The rollup config.
@@ -75,7 +75,7 @@ where
impl
BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
BF: L2ChainProvider + Debug,
{
/// Creates a new [BatchQueue] stage.
@@ -248,7 +248,7 @@ where
#[async_trait]
impl
OriginAdvancer for BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Send + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
BF: L2ChainProvider + Send + Debug,
{
async fn advance_origin(&mut self) -> StageResult<()> {
@@ -259,7 +259,7 @@ where
#[async_trait]
impl
AttributesProvider for BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Send + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
BF: L2ChainProvider + Send + Debug,
{
/// Returns the next valid batch upon the given safe head.
@@ -417,7 +417,7 @@ where
impl
OriginProvider for BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
BF: L2ChainProvider + Debug,
{
fn origin(&self) -> Option {
@@ -425,20 +425,10 @@ where
}
}
-impl PreviousStage for BatchQueue
-where
- P: BatchQueueProvider + PreviousStage + Send + Debug,
- BF: L2ChainProvider + Send + Debug,
-{
- fn previous(&self) -> Option> {
- Some(Box::new(&self.prev))
- }
-}
-
#[async_trait]
impl ResettableStage for BatchQueue
where
- P: BatchQueueProvider + PreviousStage + Send + Debug,
+ P: BatchQueueProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
BF: L2ChainProvider + Send + Debug,
{
async fn reset(&mut self, base: BlockInfo, system_config: &SystemConfig) -> StageResult<()> {
diff --git a/crates/derive/src/stages/channel_bank.rs b/crates/derive/src/stages/channel_bank.rs
index f44f95629..03f188181 100644
--- a/crates/derive/src/stages/channel_bank.rs
+++ b/crates/derive/src/stages/channel_bank.rs
@@ -3,7 +3,7 @@
use crate::{
params::{ChannelID, MAX_CHANNEL_BANK_SIZE},
stages::ChannelReaderProvider,
- traits::{OriginAdvancer, OriginProvider, PreviousStage, ResettableStage},
+ traits::{OriginAdvancer, OriginProvider, ResettableStage},
types::{BlockInfo, Channel, Frame, RollupConfig, StageError, StageResult, SystemConfig},
};
use alloc::{boxed::Box, collections::VecDeque, sync::Arc};
@@ -37,7 +37,7 @@ pub trait ChannelBankProvider {
#[derive(Debug)]
pub struct ChannelBank
where
- P: ChannelBankProvider + PreviousStage + Debug,
+ P: ChannelBankProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
{
/// The rollup configuration.
cfg: Arc,
@@ -51,7 +51,7 @@ where
impl ChannelBank
where
- P: ChannelBankProvider + PreviousStage + Debug,
+ P: ChannelBankProvider + OriginAdvancer + OriginProvider + ResettableStage + Debug,
{
/// Create a new [ChannelBank] stage.
pub fn new(cfg: Arc, prev: P) -> Self {
@@ -192,7 +192,7 @@ where
#[async_trait]
impl OriginAdvancer for ChannelBank
where
- P: ChannelBankProvider + PreviousStage + Send + Debug,
+ P: ChannelBankProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
{
async fn advance_origin(&mut self) -> StageResult<()> {
self.prev.advance_origin().await
@@ -202,7 +202,7 @@ where
#[async_trait]
impl
ChannelReaderProvider for ChannelBank
where
- P: ChannelBankProvider + PreviousStage + Send + Debug,
+ P: ChannelBankProvider + OriginAdvancer + OriginProvider + ResettableStage + Send + Debug,
{
async fn next_data(&mut self) -> StageResult