pub struct L1OriginSelector<P: L1OriginSelectorProvider> { /* private fields */ }Expand description
The L1OriginSelector is responsible for selecting the L1 origin block based on the
current L2 unsafe head’s sequence epoch.
Implementations§
Source§impl<P: L1OriginSelectorProvider> L1OriginSelector<P>
impl<P: L1OriginSelectorProvider> L1OriginSelector<P>
Sourcepub const fn new(cfg: Arc<RollupConfig>, l1: P) -> Self
pub const fn new(cfg: Arc<RollupConfig>, l1: P) -> Self
Creates a new L1OriginSelector.
Sourcepub async fn next_l1_origin(
&mut self,
unsafe_head: L2BlockInfo,
is_recovery_mode: bool,
) -> Result<BlockInfo, L1OriginSelectorError>
pub async fn next_l1_origin( &mut self, unsafe_head: L2BlockInfo, is_recovery_mode: bool, ) -> Result<BlockInfo, L1OriginSelectorError>
Determines what the next L1 origin block should be, based off of the L2BlockInfo unsafe
head.
The L1 origin is selected based off of the sequencing epoch, determined by the next L2 block’s timestamp in relation to the current L1 origin’s timestamp. If the next L2 block’s timestamp is greater than the L2 unsafe head’s L1 origin timestamp, the L1 origin is the block following the current L1 origin.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for L1OriginSelector<P>where
P: Freeze,
impl<P> RefUnwindSafe for L1OriginSelector<P>where
P: RefUnwindSafe,
impl<P> Send for L1OriginSelector<P>where
P: Send,
impl<P> Sync for L1OriginSelector<P>where
P: Sync,
impl<P> Unpin for L1OriginSelector<P>where
P: Unpin,
impl<P> UnwindSafe for L1OriginSelector<P>where
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