pub struct BlockHandler {
pub chain_id: u64,
pub block_sender: Sender<ExecutionPayload>,
pub unsafe_signer_recv: Receiver<Address>,
pub blocks_v1_topic: IdentTopic,
pub blocks_v2_topic: IdentTopic,
pub blocks_v3_topic: IdentTopic,
}Expand description
Responsible for managing blocks received via p2p gossip
Fields§
§chain_id: u64Chain ID of the L2 blockchain. Used to filter out gossip messages intended for other blockchains.
block_sender: Sender<ExecutionPayload>A channel sender to forward new blocks to other modules
unsafe_signer_recv: Receiver<Address>A Receiver to monitor changes to the unsafe block signer.
blocks_v1_topic: IdentTopicThe libp2p topic for pre Canyon/Shangai blocks.
blocks_v2_topic: IdentTopicThe libp2p topic for Canyon/Delta blocks.
blocks_v3_topic: IdentTopicThe libp2p topic for Ecotone V3 blocks.
Implementations§
Source§impl BlockHandler
impl BlockHandler
Sourcepub fn new(
chain_id: u64,
unsafe_recv: Receiver<Address>,
) -> (Self, Receiver<ExecutionPayload>)
pub fn new( chain_id: u64, unsafe_recv: Receiver<Address>, ) -> (Self, Receiver<ExecutionPayload>)
Creates a new BlockHandler and opens a channel
Sourcepub fn block_valid(&self, envelope: &OpNetworkPayloadEnvelope) -> bool
pub fn block_valid(&self, envelope: &OpNetworkPayloadEnvelope) -> bool
Determines if a block is valid.
True if the block is less than 1 minute old, and correctly signed by the unsafe block signer.
Trait Implementations§
Source§impl Clone for BlockHandler
impl Clone for BlockHandler
Source§fn clone(&self) -> BlockHandler
fn clone(&self) -> BlockHandler
Returns a duplicate 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 BlockHandler
impl Debug for BlockHandler
Auto Trait Implementations§
impl Freeze for BlockHandler
impl RefUnwindSafe for BlockHandler
impl Send for BlockHandler
impl Sync for BlockHandler
impl Unpin for BlockHandler
impl UnwindSafe for BlockHandler
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<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