HashingWriter

Trait HashingWriter 

pub trait HashingWriter: Send + Sync {
    // Required methods
    fn unwind_account_hashing<'a>(
        &self,
        changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>,
    ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>;
    fn unwind_account_hashing_range(
        &self,
        range: impl RangeBounds<u64>,
    ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>;
    fn insert_account_for_hashing(
        &self,
        accounts: impl IntoIterator<Item = (Address, Option<Account>)>,
    ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>;
    fn unwind_storage_hashing(
        &self,
        changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>,
    ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>;
    fn unwind_storage_hashing_range(
        &self,
        range: impl RangeBounds<BlockNumberAddress>,
    ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>;
    fn insert_storage_for_hashing(
        &self,
        storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>,
    ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>;
}
Expand description

Hashing Writer

Required Methods§

fn unwind_account_hashing<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Unwind and clear account hashing.

§Returns

Set of hashed keys of updated accounts.

fn unwind_account_hashing_range( &self, range: impl RangeBounds<u64>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Unwind and clear account hashing in a given block range.

§Returns

Set of hashed keys of updated accounts.

fn insert_account_for_hashing( &self, accounts: impl IntoIterator<Item = (Address, Option<Account>)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Inserts all accounts into [AccountsHistory][reth_db_api::tables::AccountsHistory] table.

§Returns

Set of hashed keys of updated accounts.

fn unwind_storage_hashing( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Unwind and clear storage hashing.

§Returns

Mapping of hashed keys of updated accounts to their respective updated hashed slots.

fn unwind_storage_hashing_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Unwind and clear storage hashing in a given block range.

§Returns

Mapping of hashed keys of updated accounts to their respective updated hashed slots.

fn insert_storage_for_hashing( &self, storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Iterates over storages and inserts them to hashing table.

§Returns

Mapping of hashed keys of updated accounts to their respective updated hashed slots.

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> HashingWriter for &'b T
where T: 'b + HashingWriter + ?Sized, &'b T: Send + Sync,

§

fn unwind_account_hashing<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_account_hashing_range( &self, range: impl RangeBounds<u64>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn insert_account_for_hashing( &self, accounts: impl IntoIterator<Item = (Address, Option<Account>)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_storage_hashing( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn unwind_storage_hashing_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn insert_storage_for_hashing( &self, storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

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

§

fn unwind_account_hashing<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_account_hashing_range( &self, range: impl RangeBounds<u64>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn insert_account_for_hashing( &self, accounts: impl IntoIterator<Item = (Address, Option<Account>)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_storage_hashing( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn unwind_storage_hashing_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn insert_storage_for_hashing( &self, storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

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

§

fn unwind_account_hashing<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_account_hashing_range( &self, range: impl RangeBounds<u64>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn insert_account_for_hashing( &self, accounts: impl IntoIterator<Item = (Address, Option<Account>)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

§

fn unwind_storage_hashing( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn unwind_storage_hashing_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

§

fn insert_storage_for_hashing( &self, storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Implementors§

§

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