reth_storage_api

Trait HistoryWriter

Source
pub trait HistoryWriter: Send + Sync {
    // Required methods
    fn unwind_account_history_indices<'a>(
        &self,
        changesets: impl Iterator<Item = &'a (BlockNumber, AccountBeforeTx)>,
    ) -> ProviderResult<usize>;
    fn unwind_account_history_indices_range(
        &self,
        range: impl RangeBounds<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,
        changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>,
    ) -> ProviderResult<usize>;
    fn unwind_storage_history_indices_range(
        &self,
        range: impl RangeBounds<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<'a>( &self, changesets: impl Iterator<Item = &'a (BlockNumber, AccountBeforeTx)>, ) -> ProviderResult<usize>

Unwind and clear account history indices.

Returns number of changesets walked.

Source

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<BlockNumber>, ) -> ProviderResult<usize>

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

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, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> ProviderResult<usize>

Unwind and clear storage history indices.

Returns number of changesets walked.

Source

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

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

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.

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§

Source§

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

Source§

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

Source§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<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, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> ProviderResult<usize>

Source§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<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<'a>( &self, changesets: impl Iterator<Item = &'a (BlockNumber, AccountBeforeTx)>, ) -> ProviderResult<usize>

Source§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<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, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> ProviderResult<usize>

Source§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<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<'a>( &self, changesets: impl Iterator<Item = &'a (BlockNumber, AccountBeforeTx)>, ) -> ProviderResult<usize>

Source§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<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, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> ProviderResult<usize>

Source§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<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§