Trait reth_provider::HistoryWriter

source ·
pub trait HistoryWriter: Send + Sync {
    // Required methods
    fn unwind_account_history_indices(
        &self,
        range: RangeInclusive<BlockNumber>,
    ) -> ProviderResult<usize>;
    fn insert_account_history_index(
        &self,
        index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>,
    ) -> ProviderResult<()>;
    fn unwind_storage_history_indices(
        &self,
        range: Range<BlockNumberAddress>,
    ) -> ProviderResult<usize>;
    fn insert_storage_history_index(
        &self,
        storage_transitions: impl IntoIterator<Item = ((Address, B256), impl IntoIterator<Item = u64>)>,
    ) -> ProviderResult<()>;
    fn update_history_indices(
        &self,
        range: RangeInclusive<BlockNumber>,
    ) -> ProviderResult<()>;
}
Expand description

History Writer

Required Methods§

source

fn unwind_account_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<usize>

Unwind and clear account history indices.

Returns number of changesets walked.

source

fn insert_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

Insert account change index to database. Used inside AccountHistoryIndex stage

source

fn unwind_storage_history_indices( &self, range: Range<BlockNumberAddress>, ) -> ProviderResult<usize>

Unwind and clear storage history indices.

Returns number of changesets walked.

source

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, B256), impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

Insert storage change index to database. Used inside StorageHistoryIndex stage

source

fn update_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<()>

Read account/storage changesets and update account/storage history indices.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn unwind_account_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<usize>

source§

fn insert_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn unwind_storage_history_indices( &self, range: Range<BlockNumberAddress>, ) -> ProviderResult<usize>

source§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, B256), impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn update_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<()>

source§

impl<T: HistoryWriter + ?Sized> HistoryWriter for Box<T>
where Box<T>: Send + Sync,

source§

fn unwind_account_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<usize>

source§

fn insert_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn unwind_storage_history_indices( &self, range: Range<BlockNumberAddress>, ) -> ProviderResult<usize>

source§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, B256), impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn update_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<()>

source§

impl<T: HistoryWriter + ?Sized> HistoryWriter for Arc<T>
where Arc<T>: Send + Sync,

source§

fn unwind_account_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<usize>

source§

fn insert_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn unwind_storage_history_indices( &self, range: Range<BlockNumberAddress>, ) -> ProviderResult<usize>

source§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, B256), impl IntoIterator<Item = u64>)>, ) -> ProviderResult<()>

source§

fn update_history_indices( &self, range: RangeInclusive<BlockNumber>, ) -> ProviderResult<()>

Implementors§

source§

impl<TX: DbTxMut + DbTx> HistoryWriter for DatabaseProvider<TX>