pub struct SingleBatch {
pub parent_hash: BlockHash,
pub epoch_num: u64,
pub epoch_hash: BlockHash,
pub timestamp: u64,
pub transactions: Vec<Bytes>,
}
Expand description
Represents a single batch: a single encoded L2 block
Fields§
§parent_hash: BlockHash
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: BlockHash
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) -> BlockNumHash
pub const fn epoch(&self) -> BlockNumHash
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) -> Self
fn from(batch: SingleBatch) -> Self
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)