pub struct L2Finalizer { /* private fields */ }Expand description
The L2Finalizer is responsible for finalizing L2 blocks derived from finalized L1 blocks.
It maintains a queue of derived L2 blocks that are awaiting finalization, and finalizes them
as new finalized L1 blocks are received.
Implementations§
Source§impl L2Finalizer
impl L2Finalizer
Sourcepub const fn new(finalized_l1_block_rx: Receiver<Option<BlockInfo>>) -> Self
pub const fn new(finalized_l1_block_rx: Receiver<Option<BlockInfo>>) -> Self
Creates a new L2Finalizer with the given channel receiver for finalized L1 blocks.
Sourcepub fn enqueue_for_finalization(&mut self, attributes: &OpAttributesWithParent)
pub fn enqueue_for_finalization(&mut self, attributes: &OpAttributesWithParent)
Enqueues a derived OpAttributesWithParent for finalization. When a new finalized L1
block is observed that is >= the height of OpAttributesWithParent::derived_from, the
L2 block associated with the payload attributes will be finalized.
Sourcepub async fn new_finalized_block(&mut self) -> Result<(), RecvError>
pub async fn new_finalized_block(&mut self) -> Result<(), RecvError>
Receives a new finalized L1 block from the channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for L2Finalizer
impl !RefUnwindSafe for L2Finalizer
impl Send for L2Finalizer
impl Sync for L2Finalizer
impl Unpin for L2Finalizer
impl !UnwindSafe for L2Finalizer
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