pub struct ChannelReader<P>{ /* private fields */ }
Expand description
ChannelReader is a stateful stage that reads Batches from Channel
s.
The ChannelReader pulls Channel
s from the channel bank as raw data
and pipes it into a BatchReader
. Since the raw data is compressed,
the BatchReader
first decompresses the data using the first bytes as
a compression algorithm identifier.
Once the data is decompressed, it is decoded into a Batch
and passed
to the next stage in the pipeline.
Implementations§
Source§impl<P> ChannelReader<P>
impl<P> ChannelReader<P>
Sourcepub const fn new(prev: P, cfg: Arc<RollupConfig>) -> Self
pub const fn new(prev: P, cfg: Arc<RollupConfig>) -> Self
Create a new ChannelReader stage.
Sourcepub fn next_channel(&mut self)
pub fn next_channel(&mut self)
Forces the read to continue with the next channel, resetting any decoding / decompression state to a fresh start.
Trait Implementations§
Source§impl<P> BatchStreamProvider for ChannelReader<P>
impl<P> BatchStreamProvider for ChannelReader<P>
Source§fn flush(&mut self)
fn flush(&mut self)
This method is called by the BatchStream if an invalid span batch is found. In the case of an invalid span batch, the associated channel must be flushed.
See: https://specs.optimism.io/protocol/holocene/derivation.html#span-batches
SAFETY: Only called post-holocene activation.
Source§fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PipelineResult<Batch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PipelineResult<Batch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<P> Debug for ChannelReader<P>
impl<P> Debug for ChannelReader<P>
Source§impl<P> OriginAdvancer for ChannelReader<P>
impl<P> OriginAdvancer for ChannelReader<P>
Source§fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PipelineResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PipelineResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
advance_l1_block
.