reth_provider

Trait StateChangeWriter

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

A trait specifically for writing state changes or reverts

Required Methods§

Source

fn write_state_reverts( &self, reverts: PlainStateReverts, first_block: BlockNumber, ) -> ProviderResult<()>

Write state reverts to the database.

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

Source

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

Write state changes to the database.

Source

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

Writes the hashed state changes to the database

Source

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

Remove the block range of state.

Source

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

Take the block range of state, recreating the ExecutionOutcome.

Implementors§

Source§

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