Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(derive): Concrete AttributesQueue Return Type #158

Merged
merged 1 commit into from
Apr 28, 2024
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
31 changes: 24 additions & 7 deletions crates/derive/src/online/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,44 @@
use crate::{
stages::{
AttributesQueue, BatchQueue, ChannelBank, ChannelReader, FrameQueue, L1Retrieval,
L1Traversal, NextAttributes, StatefulAttributesBuilder,
L1Traversal, StatefulAttributesBuilder,
},
traits::{DataAvailabilityProvider, ResettableStage},
traits::DataAvailabilityProvider,
types::RollupConfig,
};
use alloc::sync::Arc;
use alloy_provider::ReqwestProvider;
use core::fmt::Debug;

/// An `online` payload attributes builder for the `AttributesQueue` stage of the derivation
/// pipeline.
pub type OnlineAttributesBuilder = StatefulAttributesBuilder<
AlloyChainProvider<ReqwestProvider>,
AlloyL2ChainProvider<ReqwestProvider>,
>;

/// An `online` attributes queue for the derivation pipeline.
pub type OnlineAttributesQueue<DAP> = AttributesQueue<
BatchQueue<
ChannelReader<
ChannelBank<
FrameQueue<L1Retrieval<DAP, L1Traversal<AlloyChainProvider<ReqwestProvider>>>>,
>,
>,
AlloyL2ChainProvider<ReqwestProvider>,
>,
OnlineAttributesBuilder,
>;

/// Creates a new online stack.
#[cfg(feature = "online")]
pub fn new_online_stack<DAP>(
rollup_config: Arc<RollupConfig>,
chain_provider: AlloyChainProvider<ReqwestProvider>,
dap_source: DAP,
fetcher: AlloyL2ChainProvider<ReqwestProvider>,
builder: StatefulAttributesBuilder<
AlloyChainProvider<ReqwestProvider>,
AlloyL2ChainProvider<ReqwestProvider>,
>,
) -> impl NextAttributes + ResettableStage + Debug + Send
builder: OnlineAttributesBuilder,
) -> OnlineAttributesQueue<DAP>
where
DAP: DataAvailabilityProvider + Debug + Send,
{
Expand Down
Loading