pub struct SingleBatch {
pub parent_hash: FixedBytes<32>,
pub epoch_num: u64,
pub epoch_hash: FixedBytes<32>,
pub timestamp: u64,
pub transactions: Vec<Bytes>,
}
Available on crate feature
protocol
only.Expand description
Represents a single batch: a single encoded L2 block
Fields§
§parent_hash: FixedBytes<32>
Block hash of the previous L2 block. B256::ZERO
if it has not been set by the Batch
Queue.
epoch_num: u64
The batch epoch number. Same as the first L1 block number in the epoch.
epoch_hash: FixedBytes<32>
The block hash of the first L1 block in the epoch
timestamp: u64
The L2 block timestamp of this batch
transactions: Vec<Bytes>
The L2 block transactions in this batch
Implementations§
Source§impl SingleBatch
impl SingleBatch
Sourcepub fn has_invalid_transactions(&self) -> bool
pub fn has_invalid_transactions(&self) -> bool
If any transactions are empty or deposited transaction types.
Sourcepub const fn epoch(&self) -> NumHash
pub const fn epoch(&self) -> NumHash
Returns the BlockNumHash of the batch.
Sourcepub fn check_batch_timestamp(
&self,
cfg: &RollupConfig,
l2_safe_head: L2BlockInfo,
inclusion_block: &BlockInfo,
) -> BatchValidity
pub fn check_batch_timestamp( &self, cfg: &RollupConfig, l2_safe_head: L2BlockInfo, inclusion_block: &BlockInfo, ) -> BatchValidity
Validate the batch timestamp.
Sourcepub fn check_batch(
&self,
cfg: &RollupConfig,
l1_blocks: &[BlockInfo],
l2_safe_head: L2BlockInfo,
inclusion_block: &BlockInfo,
) -> BatchValidity
pub fn check_batch( &self, cfg: &RollupConfig, l1_blocks: &[BlockInfo], l2_safe_head: L2BlockInfo, inclusion_block: &BlockInfo, ) -> BatchValidity
Checks if the batch is valid.
The batch format type is defined in the OP Stack Specs.
Trait Implementations§
Source§impl Clone for SingleBatch
impl Clone for SingleBatch
Source§fn clone(&self) -> SingleBatch
fn clone(&self) -> SingleBatch
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SingleBatch
impl Debug for SingleBatch
Source§impl Decodable for SingleBatch
impl Decodable for SingleBatch
Source§impl Default for SingleBatch
impl Default for SingleBatch
Source§fn default() -> SingleBatch
fn default() -> SingleBatch
Returns the “default value” for a type. Read more
Source§impl Encodable for SingleBatch
impl Encodable for SingleBatch
Source§impl From<SingleBatch> for SpanBatchElement
impl From<SingleBatch> for SpanBatchElement
Source§fn from(batch: SingleBatch) -> SpanBatchElement
fn from(batch: SingleBatch) -> SpanBatchElement
Converts to this type from the input type.
Source§impl PartialEq for SingleBatch
impl PartialEq for SingleBatch
impl Eq for SingleBatch
impl StructuralPartialEq for SingleBatch
Auto Trait Implementations§
impl Freeze for SingleBatch
impl RefUnwindSafe for SingleBatch
impl Send for SingleBatch
impl Sync for SingleBatch
impl Unpin for SingleBatch
impl UnwindSafe for SingleBatch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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