reth::providers

Trait StateChangeWriter

Source
pub trait StateChangeWriter {
    // Required methods
    fn write_state_reverts(
        &self,
        reverts: PlainStateReverts,
        first_block: u64,
    ) -> Result<(), ProviderError>;
    fn write_state_changes(
        &self,
        changes: StateChangeset,
    ) -> Result<(), ProviderError>;
    fn write_hashed_state(
        &self,
        hashed_state: &HashedPostStateSorted,
    ) -> Result<(), ProviderError>;
    fn remove_state(
        &self,
        range: RangeInclusive<u64>,
    ) -> Result<(), ProviderError>;
    fn take_state(
        &self,
        range: RangeInclusive<u64>,
    ) -> Result<ExecutionOutcome, ProviderError>;
}
Expand description

A trait specifically for writing state changes or reverts

Required Methods§

Source

fn write_state_reverts( &self, reverts: PlainStateReverts, first_block: u64, ) -> Result<(), ProviderError>

Write state reverts to the database.

NOTE: Reverts will delete all wiped storage from plain state.

Source

fn write_state_changes( &self, changes: StateChangeset, ) -> Result<(), ProviderError>

Write state changes to the database.

Source

fn write_hashed_state( &self, hashed_state: &HashedPostStateSorted, ) -> Result<(), ProviderError>

Writes the hashed state changes to the database

Source

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

Remove the block range of state.

Source

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

Take the block range of state, recreating the ExecutionOutcome.

Implementors§

Source§

impl<TX, N> StateChangeWriter for DatabaseProvider<TX, N>
where TX: DbTxMut + DbTx + 'static, N: NodeTypesForProvider,