reth::providers

Trait HistoryWriter

pub trait HistoryWriter: Send + Sync {
    // Required methods
    fn unwind_account_history_indices<'a>(
        &self,
        changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>,
    ) -> Result<usize, ProviderError>;
    fn unwind_account_history_indices_range(
        &self,
        range: impl RangeBounds<u64>,
    ) -> Result<usize, ProviderError>;
    fn insert_account_history_index(
        &self,
        index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>,
    ) -> Result<(), ProviderError>;
    fn unwind_storage_history_indices(
        &self,
        changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>,
    ) -> Result<usize, ProviderError>;
    fn unwind_storage_history_indices_range(
        &self,
        range: impl RangeBounds<BlockNumberAddress>,
    ) -> Result<usize, ProviderError>;
    fn insert_storage_history_index(
        &self,
        storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>,
    ) -> Result<(), ProviderError>;
    fn update_history_indices(
        &self,
        range: RangeInclusive<u64>,
    ) -> Result<(), ProviderError>;
}
Expand description

History Writer

Required Methods§

fn unwind_account_history_indices<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<usize, ProviderError>

Unwind and clear account history indices.

Returns number of changesets walked.

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<u64>, ) -> Result<usize, ProviderError>

Unwind and clear account history indices in a given block range.

Returns number of changesets walked.

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

Insert account change index to database. Used inside AccountHistoryIndex stage

fn unwind_storage_history_indices( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<usize, ProviderError>

Unwind and clear storage history indices.

Returns number of changesets walked.

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<usize, ProviderError>

Unwind and clear storage history indices in a given block range.

Returns number of changesets walked.

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

Insert storage change index to database. Used inside StorageHistoryIndex stage

fn update_history_indices( &self, range: RangeInclusive<u64>, ) -> Result<(), ProviderError>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

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

§

fn unwind_account_history_indices<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<usize, ProviderError>

§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<u64>, ) -> Result<usize, ProviderError>

§

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

§

fn unwind_storage_history_indices( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<usize, ProviderError>

§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<usize, ProviderError>

§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

§

fn update_history_indices( &self, range: RangeInclusive<u64>, ) -> Result<(), ProviderError>

§

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

§

fn unwind_account_history_indices<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<usize, ProviderError>

§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<u64>, ) -> Result<usize, ProviderError>

§

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

§

fn unwind_storage_history_indices( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<usize, ProviderError>

§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<usize, ProviderError>

§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

§

fn update_history_indices( &self, range: RangeInclusive<u64>, ) -> Result<(), ProviderError>

§

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

§

fn unwind_account_history_indices<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<usize, ProviderError>

§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<u64>, ) -> Result<usize, ProviderError>

§

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

§

fn unwind_storage_history_indices( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<usize, ProviderError>

§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<usize, ProviderError>

§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

§

fn update_history_indices( &self, range: RangeInclusive<u64>, ) -> Result<(), ProviderError>

Implementors§

§

impl<TX, N> HistoryWriter for DatabaseProvider<TX, N>
where TX: DbTxMut + DbTx + 'static, N: NodeTypes,