reth_chain_state

Trait 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§