pub struct BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug,
F: L2ChainProvider + Clone + Debug,{ /* private fields */ }
Expand description
The BatchProvider stage is a mux between the BatchQueue and BatchValidator stages.
Rules: When Holocene is not active, the BatchQueue is used. When Holocene is active, the BatchValidator is used.
When transitioning between the two stages, the mux will reset the active stage, but
retain l1_blocks
.
Implementations§
Source§impl<P, F> BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug,
F: L2ChainProvider + Clone + Debug,
impl<P, F> BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug,
F: L2ChainProvider + Clone + Debug,
Sourcepub const fn new(
cfg: Arc<RollupConfig>,
prev: P,
provider: F,
) -> BatchProvider<P, F>
pub const fn new( cfg: Arc<RollupConfig>, prev: P, provider: F, ) -> BatchProvider<P, F>
Creates a new BatchProvider with the given configuration and previous stage.
Trait Implementations§
Source§impl<P, F> AttributesProvider for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug + Send,
F: L2ChainProvider + Clone + Send + Debug,
impl<P, F> AttributesProvider for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug + Send,
F: L2ChainProvider + Clone + Send + Debug,
Source§fn is_last_in_span(&self) -> bool
fn is_last_in_span(&self) -> bool
Returns whether the current batch is the last in its span.
Source§fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
parent: L2BlockInfo,
) -> Pin<Box<dyn Future<Output = Result<SingleBatch, PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
BatchProvider<P, F>: 'async_trait,
fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
parent: L2BlockInfo,
) -> Pin<Box<dyn Future<Output = Result<SingleBatch, PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
BatchProvider<P, F>: 'async_trait,
Returns the next valid batch upon the given safe head.
Source§impl<P, F> Debug for BatchProvider<P, F>where
P: Debug + NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver,
F: Debug + L2ChainProvider + Clone,
impl<P, F> Debug for BatchProvider<P, F>where
P: Debug + NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver,
F: Debug + L2ChainProvider + Clone,
Source§impl<P, F> OriginAdvancer for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Send + Debug,
F: L2ChainProvider + Clone + Send + Debug,
impl<P, F> OriginAdvancer for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Send + Debug,
F: L2ChainProvider + Clone + Send + Debug,
Source§fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
BatchProvider<P, F>: 'async_trait,
fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
BatchProvider<P, F>: 'async_trait,
Advances the internal state of the lowest stage to the next l1 origin.
This method is the equivalent of the reference implementation
advance_l1_block
.Source§impl<P, F> OriginProvider for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug,
F: L2ChainProvider + Clone + Debug,
impl<P, F> OriginProvider for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Debug,
F: L2ChainProvider + Clone + Debug,
Source§impl<P, F> SignalReceiver for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Send + Debug,
F: L2ChainProvider + Clone + Send + Debug,
impl<P, F> SignalReceiver for BatchProvider<P, F>where
P: NextBatchProvider + OriginAdvancer + OriginProvider + SignalReceiver + Send + Debug,
F: L2ChainProvider + Clone + Send + Debug,
Auto Trait Implementations§
impl<P, F> Freeze for BatchProvider<P, F>
impl<P, F> RefUnwindSafe for BatchProvider<P, F>where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, F> Send for BatchProvider<P, F>
impl<P, F> Sync for BatchProvider<P, F>
impl<P, F> Unpin for BatchProvider<P, F>
impl<P, F> UnwindSafe for BatchProvider<P, F>where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more