reth::providers

Trait HeaderSyncGapProvider

pub trait HeaderSyncGapProvider: Send + Sync {
    type Header: Send + Sync;

    // Required method
    fn sync_gap(
        &self,
        tip: Receiver<FixedBytes<32>>,
        highest_uninterrupted_block: u64,
    ) -> Result<HeaderSyncGap<Self::Header>, ProviderError>;
}
Expand description

Client trait for determining the current headers sync gap.

Required Associated Types§

type Header: Send + Sync

The header type.

Required Methods§

fn sync_gap( &self, tip: Receiver<FixedBytes<32>>, highest_uninterrupted_block: u64, ) -> Result<HeaderSyncGap<Self::Header>, ProviderError>

Find a current sync gap for the headers depending on the last uninterrupted block number. Last uninterrupted block represents the block number before which there are no gaps. It’s up to the caller to ensure that last uninterrupted block is determined correctly.

Implementations on Foreign Types§

§

impl<'a, T> HeaderSyncGapProvider for &'a T
where T: 'a + HeaderSyncGapProvider + ?Sized, &'a T: Send + Sync,

§

type Header = <T as HeaderSyncGapProvider>::Header

§

fn sync_gap( &self, tip: Receiver<FixedBytes<32>>, highest_uninterrupted_block: u64, ) -> Result<HeaderSyncGap<<&'a T as HeaderSyncGapProvider>::Header>, ProviderError>

§

impl<T> HeaderSyncGapProvider for Arc<T>

§

type Header = <T as HeaderSyncGapProvider>::Header

§

fn sync_gap( &self, tip: Receiver<FixedBytes<32>>, highest_uninterrupted_block: u64, ) -> Result<HeaderSyncGap<<Arc<T> as HeaderSyncGapProvider>::Header>, ProviderError>

Implementors§