Trait reth_chain_state::ForkChoiceSubscriptions

source ·
pub trait ForkChoiceSubscriptions: Send + Sync {
    // Required methods
    fn subscribe_safe_block(&self) -> ForkChoiceNotifications;
    fn subscribe_finalized_block(&self) -> ForkChoiceNotifications;

    // Provided methods
    fn safe_block_stream(&self) -> ForkChoiceStream<SealedHeader> { ... }
    fn finalized_block_stream(&self) -> ForkChoiceStream<SealedHeader> { ... }
}
Expand description

A trait that allows to register to fork choice related events and get notified when a new fork choice is available.

Required Methods§

source

fn subscribe_safe_block(&self) -> ForkChoiceNotifications

Get notified when a new safe block of the chain is selected.

source

fn subscribe_finalized_block(&self) -> ForkChoiceNotifications

Get notified when a new finalized block of the chain is selected.

Provided Methods§

source

fn safe_block_stream(&self) -> ForkChoiceStream<SealedHeader>

Convenience method to get a stream of the new safe blocks of the chain.

source

fn finalized_block_stream(&self) -> ForkChoiceStream<SealedHeader>

Convenience method to get a stream of the new finalized blocks of the chain.

Implementors§