pub struct MessageGraph<'a, P> { /* private fields */ }Expand description
The message graph represents a set of blocks at a given timestamp and the interop dependencies between them.
This structure is used to determine whether or not any interop messages are invalid within the set of blocks within the graph. An “invalid message” is one that was relayed from one chain to another, but the original MessageIdentifier is not present within the graph or from a dependency referenced via the InteropProvider (or otherwise is invalid, such as being older than the message expiry window).
Message validity rules: https://specs.optimism.io/interop/messaging.html#invalid-messages
Implementations§
Source§impl<'a, P> MessageGraph<'a, P>where
P: InteropProvider,
impl<'a, P> MessageGraph<'a, P>where
P: InteropProvider,
Sourcepub async fn derive(
blocks: &[(u64, Sealed<Header>)],
provider: &'a P,
rollup_configs: &'a HashMap<u64, RollupConfig>,
) -> Result<MessageGraph<'a, P>, MessageGraphError<<P as InteropProvider>::Error>>
pub async fn derive( blocks: &[(u64, Sealed<Header>)], provider: &'a P, rollup_configs: &'a HashMap<u64, RollupConfig>, ) -> Result<MessageGraph<'a, P>, MessageGraphError<<P as InteropProvider>::Error>>
Derives the edges from the blocks within the graph by scanning all receipts within the blocks and searching for ExecutingMessages.
Sourcepub async fn resolve(
self,
) -> Result<(), MessageGraphError<<P as InteropProvider>::Error>>
pub async fn resolve( self, ) -> Result<(), MessageGraphError<<P as InteropProvider>::Error>>
Checks the validity of all messages within the graph.
Trait Implementations§
Auto Trait Implementations§
impl<'a, P> Freeze for MessageGraph<'a, P>
impl<'a, P> RefUnwindSafe for MessageGraph<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for MessageGraph<'a, P>where
P: Sync,
impl<'a, P> Sync for MessageGraph<'a, P>where
P: Sync,
impl<'a, P> Unpin for MessageGraph<'a, P>
impl<'a, P> UnwindSafe for MessageGraph<'a, P>where
P: RefUnwindSafe,
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
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>
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>
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