Skip to main content

RevmWrite

Struct RevmWrite 

Source
pub struct RevmWrite<U>
where U: HotKvWrite,
{ /* private fields */ }
Expand description

Read-write REVM database adapter. This adapter allows committing changes. Despite the naming of TryDatabaseCommit::try_commit, the changes are only persisted when Self::persist is called. This is because of a mismatch in semantics between the two systems.

Implementations§

Source§

impl<U> RevmWrite<U>
where U: HotKvWrite,

Source

pub const fn new(writer: U) -> RevmWrite<U>

Create a new write adapter

Source

pub fn persist(self) -> Result<(), <U as HotKvRead>::Error>

Persist the changes made in this write transaction.

Trait Implementations§

Source§

impl<T> Database for RevmWrite<T>

Source§

type Error = <T as HotKvRead>::Error

The database error type.
Source§

fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, <RevmWrite<T> as Database>::Error>

Gets basic account information.
Source§

fn code_by_hash( &mut self, code_hash: FixedBytes<32>, ) -> Result<Bytecode, <RevmWrite<T> as Database>::Error>

Gets account code by its hash.
Source§

fn storage( &mut self, address: Address, index: Uint<256, 4>, ) -> Result<Uint<256, 4>, <RevmWrite<T> as Database>::Error>

Gets storage value of address at index.
Source§

fn block_hash( &mut self, number: u64, ) -> Result<FixedBytes<32>, <RevmWrite<T> as Database>::Error>

Gets block hash by block number.
Source§

fn storage_by_account_id( &mut self, address: Address, account_id: usize, storage_key: Uint<256, 4>, ) -> Result<Uint<256, 4>, Self::Error>

Gets storage value of account by its id. By default call Database::storage method. Read more
Source§

impl<T> DatabaseRef for RevmWrite<T>

Source§

type Error = <T as HotKvRead>::Error

The database error type.
Source§

fn basic_ref( &self, address: Address, ) -> Result<Option<AccountInfo>, <RevmWrite<T> as DatabaseRef>::Error>

Gets basic account information.
Source§

fn code_by_hash_ref( &self, code_hash: FixedBytes<32>, ) -> Result<Bytecode, <RevmWrite<T> as DatabaseRef>::Error>

Gets account code by its hash.
Source§

fn storage_ref( &self, address: Address, index: Uint<256, 4>, ) -> Result<Uint<256, 4>, <RevmWrite<T> as DatabaseRef>::Error>

Gets storage value of address at index.
Source§

fn block_hash_ref( &self, number: u64, ) -> Result<FixedBytes<32>, <RevmWrite<T> as DatabaseRef>::Error>

Gets block hash by block number.
Source§

fn storage_by_account_id_ref( &self, address: Address, account_id: usize, storage_key: Uint<256, 4>, ) -> Result<Uint<256, 4>, Self::Error>

Gets storage value of account by its id. Read more
Source§

impl<U> Debug for RevmWrite<U>
where U: HotKvWrite,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<U> HotKvRead for RevmWrite<U>
where U: HotKvWrite,

Source§

type Error = <U as HotKvRead>::Error

Error type for read operations.
Source§

type Traverse<'a> = <U as HotKvRead>::Traverse<'a> where U: 'a

The cursor type for traversing key-value pairs.
Source§

fn raw_traverse<'a>( &'a self, table: &'static str, ) -> Result<<RevmWrite<U> as HotKvRead>::Traverse<'a>, <RevmWrite<U> as HotKvRead>::Error>

Get a raw cursor to traverse the database.
Source§

fn raw_get<'a>( &'a self, table: &'static str, key: &[u8], ) -> Result<Option<Cow<'a, [u8]>>, <RevmWrite<U> as HotKvRead>::Error>

Get a raw value from a specific table. Read more
Source§

fn raw_get_dual<'a>( &'a self, table: &'static str, key1: &[u8], key2: &[u8], ) -> Result<Option<Cow<'a, [u8]>>, <RevmWrite<U> as HotKvRead>::Error>

Get a raw value from a specific table with dual keys. Read more
Source§

fn get<T>( &self, key: &<T as Table>::Key, ) -> Result<Option<<T as Table>::Value>, <RevmWrite<U> as HotKvRead>::Error>
where T: SingleKey,

Get a value from a specific table.
Source§

fn get_dual<T>( &self, key1: &<T as Table>::Key, key2: &<T as DualKey>::Key2, ) -> Result<Option<<T as Table>::Value>, <RevmWrite<U> as HotKvRead>::Error>
where T: DualKey,

Get a value from a specific dual-keyed table. Read more
Source§

fn traverse<'a, T>( &'a self, ) -> Result<TableCursor<Self::Traverse<'a>, T, Self::Error>, Self::Error>
where T: SingleKey,

Traverse a specific table. Returns a typed cursor wrapper.
Source§

fn traverse_dual<'a, T>( &'a self, ) -> Result<DualTableCursor<Self::Traverse<'a>, T, Self::Error>, Self::Error>
where T: DualKey,

Traverse a specific dual-keyed table. Returns a typed dual-keyed cursor wrapper.
Source§

impl<U> HotKvWrite for RevmWrite<U>
where U: HotKvWrite,

Source§

type TraverseMut<'a> = <U as HotKvWrite>::TraverseMut<'a> where U: 'a

The mutable cursor type for traversing key-value pairs.
Source§

fn raw_traverse_mut<'a>( &'a self, table: &'static str, ) -> Result<<RevmWrite<U> as HotKvWrite>::TraverseMut<'a>, <RevmWrite<U> as HotKvRead>::Error>

Get a raw mutable cursor to traverse the database.
Source§

fn queue_raw_put( &self, table: &'static str, key: &[u8], value: &[u8], ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw put operation. Read more
Source§

fn queue_raw_put_dual( &self, table: &'static str, key1: &[u8], key2: &[u8], value: &[u8], ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw put operation for a dual-keyed table. The key1 and key2 buf must be <= MAX_KEY_SIZE bytes. Implementations are allowed to panic if this is not the case.
Source§

fn queue_raw_delete( &self, table: &'static str, key: &[u8], ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw delete operation. Read more
Source§

fn queue_raw_delete_dual( &self, table: &'static str, key1: &[u8], key2: &[u8], ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw delete operation for a dual-keyed table. Read more
Source§

fn queue_raw_clear( &self, table: &'static str, ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw clear operation for a specific table.
Source§

fn queue_raw_create( &self, table: &'static str, dual_key: Option<usize>, dual_fixed: Option<usize>, ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Queue a raw create operation for a specific table. Read more
Source§

fn raw_commit(self) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>

Commit the queued operations.
Source§

fn queue_put<T>( &self, key: &<T as Table>::Key, value: &<T as Table>::Value, ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>
where T: SingleKey,

Queue a put operation for a specific table.
Source§

fn queue_put_dual<T>( &self, key1: &<T as Table>::Key, key2: &<T as DualKey>::Key2, value: &<T as Table>::Value, ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>
where T: DualKey,

Queue a put operation for a specific dual-keyed table.
Source§

fn queue_delete<T>( &self, key: &<T as Table>::Key, ) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>
where T: SingleKey,

Queue a delete operation for a specific table.
Source§

fn queue_create<T>(&self) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>
where T: Table,

Queue creation of a specific table.
Source§

fn queue_clear<T>(&self) -> Result<(), <RevmWrite<U> as HotKvRead>::Error>
where T: Table,

Queue clearing all entries in a specific table.
Source§

fn traverse_mut<'a, T>( &'a self, ) -> Result<TableCursor<Self::TraverseMut<'a>, T, Self::Error>, Self::Error>
where T: SingleKey,

Traverse a specific table. Returns a mutable typed cursor wrapper. If invoked for a dual-keyed table, it will traverse the primary keys only, and the return value may be implementation-defined.
Source§

fn traverse_dual_mut<'a, T>( &'a self, ) -> Result<DualTableCursor<Self::TraverseMut<'a>, T, Self::Error>, Self::Error>
where T: DualKey,

Traverse a specific dual-keyed table. Returns a mutable typed dual-keyed cursor wrapper.
Source§

fn queue_append<T>( &self, key: &<T as Table>::Key, value: &<T as Table>::Value, ) -> Result<(), Self::Error>
where T: SingleKey,

Append a key-value pair. Key must be > all existing keys. Read more
Source§

fn queue_append_dual<T>( &self, k1: &<T as Table>::Key, k2: &<T as DualKey>::Key2, value: &<T as Table>::Value, ) -> Result<(), Self::Error>
where T: DualKey,

Append a dual-key entry. k2 must be > all existing k2s for k1. Read more
Source§

fn queue_delete_dual<T>( &self, key1: &<T as Table>::Key, key2: &<T as DualKey>::Key2, ) -> Result<(), Self::Error>
where T: DualKey,

Queue a delete operation for a specific dual-keyed table.
Source§

fn queue_db_init(&self) -> Result<(), Self::Error>

Queue creation of all standard hot storage tables. Read more
Source§

fn clear_k1_for<T>(&self, key1: &<T as Table>::Key) -> Result<(), Self::Error>
where T: DualKey,

Clear all K2 entries for a specific K1 in a dual-keyed table.
Source§

impl<T> TryDatabaseCommit for RevmWrite<T>

Source§

type Error = <T as HotKvRead>::Error

Error type for when TryDatabaseCommit::try_commit fails.
Source§

fn try_commit( &mut self, changes: HashMap<Address, Account, DefaultHashBuilder>, ) -> Result<(), <RevmWrite<T> as TryDatabaseCommit>::Error>

Attempt to commit changes to the database.

Auto Trait Implementations§

§

impl<U> Freeze for RevmWrite<U>
where U: Freeze,

§

impl<U> RefUnwindSafe for RevmWrite<U>
where U: RefUnwindSafe,

§

impl<U> Send for RevmWrite<U>
where U: Send,

§

impl<U> Sync for RevmWrite<U>
where U: Sync,

§

impl<U> Unpin for RevmWrite<U>
where U: Unpin,

§

impl<U> UnsafeUnpin for RevmWrite<U>
where U: UnsafeUnpin,

§

impl<U> UnwindSafe for RevmWrite<U>
where U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HistoryRead for T
where T: HotDbRead,

Source§

fn get_account_history( &self, address: &Address, latest_height: u64, ) -> Result<Option<IntegerList>, Self::Error>

Get the list of block numbers where an account was touched. Get the list of block numbers where an account was touched.
Source§

fn last_account_history( &self, address: Address, ) -> Result<Option<(u64, IntegerList)>, Self::Error>

Get the last (highest) account history entry for an address.
Source§

fn get_account_change( &self, block_number: u64, address: &Address, ) -> Result<Option<Account>, Self::Error>

Get the account change (pre-state) for an account at a specific block. Read more
Source§

fn get_storage_history( &self, address: &Address, slot: Uint<256, 4>, highest_block_number: u64, ) -> Result<Option<IntegerList>, Self::Error>

Get the storage history for an account and storage slot. The returned list will contain block numbers where the storage slot was changed.
Source§

fn last_storage_history( &self, address: &Address, slot: &Uint<256, 4>, ) -> Result<Option<(ShardedKey<Uint<256, 4>>, IntegerList)>, Self::Error>

Get the last (highest) storage history entry for an address and slot.
Source§

fn get_storage_change( &self, block_number: u64, address: &Address, slot: &Uint<256, 4>, ) -> Result<Option<Uint<256, 4>>, Self::Error>

Get the storage change (before state) for a specific storage slot at a specific block. Read more
Source§

fn last_header(&self) -> Result<Option<Sealed<Header>>, Self::Error>

Get the last (highest) header in the database. Returns None if the database is empty.
Source§

fn last_block_number(&self) -> Result<Option<u64>, Self::Error>

Get the last (highest) block number in the database. Returns None if the database is empty.
Source§

fn first_header(&self) -> Result<Option<Sealed<Header>>, Self::Error>

Get the first (lowest) header in the database. Returns None if the database is empty.
Source§

fn get_chain_tip(&self) -> Result<Option<(u64, FixedBytes<32>)>, Self::Error>

Get the current chain tip (highest block number and hash). Returns None if the database is empty.
Source§

fn get_execution_range(&self) -> Result<Option<(u64, u64)>, Self::Error>

Get the execution range (first and last block numbers with headers). Returns None if the database is empty.
Source§

fn get_account_at_height( &self, address: &Address, height: Option<u64>, ) -> Result<Option<Account>, Self::Error>

Get account state, optionally at a specific historical block height. Read more
Source§

fn get_storage_at_height( &self, address: &Address, slot: &Uint<256, 4>, height: Option<u64>, ) -> Result<Option<Uint<256, 4>>, Self::Error>

Get storage slot value, optionally at a specific historical block height. Read more
Source§

fn check_height( &self, height: Option<u64>, ) -> Result<(), HistoryError<Self::Error>>

Validate that height is within the stored block range. Read more
Source§

fn get_account_at_height_checked( &self, address: &Address, height: Option<u64>, ) -> Result<Option<Account>, HistoryError<Self::Error>>

Get account state at a height, with range validation. Read more
Source§

fn get_storage_at_height_checked( &self, address: &Address, slot: &Uint<256, 4>, height: Option<u64>, ) -> Result<Option<Uint<256, 4>>, HistoryError<Self::Error>>

Get storage slot value at a height, with range validation. Read more
Source§

fn has_block(&self, number: u64) -> Result<bool, Self::Error>

Check if a specific block number exists in history.
Source§

fn get_headers_range( &self, start: u64, end: u64, ) -> Result<Vec<Sealed<Header>>, Self::Error>

Get headers in a range (inclusive).
Source§

impl<T> HistoryWrite for T

Source§

fn validate_chain_extension<'a, I>( &self, headers: I, ) -> Result<(), HistoryError<Self::Error>>
where I: IntoIterator<Item = &'a Sealed<Header>>,

Validate that a range of headers forms a valid chain extension. Read more
Source§

fn append_blocks<'a>( &self, blocks: impl IntoIterator<Item = (&'a Sealed<Header>, &'a BundleState)>, ) -> Result<(), HistoryError<Self::Error>>

Append a range of blocks and their associated state to the database.
Source§

fn unwind_above(&self, block: u64) -> Result<(), HistoryError<Self::Error>>

Unwind all data above the given block number. Read more
Source§

fn load_genesis( &self, genesis: &Genesis, genesis_hardforks: &EthereumHardfork, ) -> Result<(), HistoryError<Self::Error>>

Load genesis data into the database. Read more
Source§

impl<T> HotDbRead for T
where T: HotKvRead,

Source§

fn get_header(&self, number: u64) -> Result<Option<Sealed<Header>>, Self::Error>

Read a block header by its number.
Source§

fn get_header_number( &self, hash: &FixedBytes<32>, ) -> Result<Option<u64>, Self::Error>

Read a block number by its hash.
Source§

fn get_bytecode( &self, code_hash: &FixedBytes<32>, ) -> Result<Option<Bytecode>, Self::Error>

Read contract Bytecode by its hash.
Source§

fn get_account(&self, address: &Address) -> Result<Option<Account>, Self::Error>

Read an account by its address.
Source§

fn get_storage( &self, address: &Address, key: &Uint<256, 4>, ) -> Result<Option<Uint<256, 4>>, Self::Error>

Read a storage slot by its address and key.
Source§

fn header_by_hash( &self, hash: &FixedBytes<32>, ) -> Result<Option<Sealed<Header>>, Self::Error>

Read a block header by its hash.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnsafeDbWrite for T
where T: HotKvWrite,

Source§

fn put_header_inconsistent( &self, header: &Sealed<Header>, ) -> Result<(), Self::Error>

Write a block header. This will leave the DB in an inconsistent state until the corresponding header number is also written. Users should prefer Self::put_header instead.
Source§

fn append_header(&self, header: &Sealed<Header>) -> Result<(), Self::Error>

Append a block header. Block number must be > all existing block numbers. Read more
Source§

fn put_header_number_inconsistent( &self, hash: &FixedBytes<32>, number: u64, ) -> Result<(), Self::Error>

Write a block number by its hash. This will leave the DB in an inconsistent state until the corresponding header is also written. Users should prefer Self::put_header instead.
Source§

fn put_bytecode( &self, code_hash: &FixedBytes<32>, bytecode: &Bytecode, ) -> Result<(), Self::Error>

Write contract Bytecode by its hash.
Source§

fn put_account( &self, address: &Address, account: &Account, ) -> Result<(), Self::Error>

Write an account by its address.
Source§

fn append_account( &self, address: &Address, account: &Account, ) -> Result<(), Self::Error>

Append an account by its address. This should generally only be used when initializing the database (e.g., from genesis).
Source§

fn put_storage( &self, address: &Address, key: &Uint<256, 4>, entry: &Uint<256, 4>, ) -> Result<(), Self::Error>

Write a storage entry by its address and key.
Source§

fn append_storage( &self, address: &Address, key: &Uint<256, 4>, entry: &Uint<256, 4>, ) -> Result<(), Self::Error>

Append a storage entry by its address and key. This should generally only be used when initializing the database (e.g., from genesis).
Source§

fn put_header(&self, header: &Sealed<Header>) -> Result<(), Self::Error>

Write a sealed block header (header + number).
Source§

fn delete_header(&self, number: u64) -> Result<(), Self::Error>

Delete a header by block number.
Source§

fn delete_header_number(&self, hash: &FixedBytes<32>) -> Result<(), Self::Error>

Delete a header number mapping by hash.
Source§

fn commit(self) -> Result<(), Self::Error>
where Self: Sized,

Commit the write transaction.
Source§

impl<T> UnsafeHistoryWrite for T

Source§

fn write_account_history( &self, address: &Address, latest_height: u64, touched: &IntegerList, ) -> Result<(), Self::Error>

Maintain a list of block numbers where an account was touched. Read more
Source§

fn write_account_prestate( &self, block_number: u64, address: Address, pre_state: &Account, ) -> Result<(), Self::Error>

Write an account change (pre-state) for an account at a specific block.
Source§

fn append_account_prestate( &self, block_number: u64, address: Address, pre_state: &Account, ) -> Result<(), Self::Error>

Append an account prestate entry. Read more
Source§

fn write_storage_history( &self, address: &Address, slot: Uint<256, 4>, highest_block_number: u64, touched: &IntegerList, ) -> Result<(), Self::Error>

Write storage history, by highest block number and touched block numbers.
Source§

fn write_storage_prestate( &self, block_number: u64, address: Address, slot: &Uint<256, 4>, prestate: &Uint<256, 4>, ) -> Result<(), Self::Error>

Write a storage change (before state) for an account at a specific block.
Source§

fn append_storage_prestate( &self, block_number: u64, address: Address, slot: &Uint<256, 4>, prestate: &Uint<256, 4>, ) -> Result<(), Self::Error>

Append a storage prestate entry. Read more
Source§

fn write_wipe( &self, block_number: u64, address: &Address, ) -> Result<(), Self::Error>

Write a pre-state for every storage key that exists for an account at a specific block. Read more
Source§

fn write_plain_revert_sorted( &self, block_number: u64, accounts: &[&(Address, Option<AccountInfo>)], storage: &[&PlainStorageRevert], ) -> Result<(), Self::Error>

Write pre-sorted revert data for a single block. Read more
Source§

fn write_plain_reverts( &self, first_block_number: u64, _: &PlainStateReverts, ) -> Result<(), Self::Error>

Write multiple blocks’ plain state revert information. Read more
Source§

fn write_changed_account( &self, address: &Address, account: &Option<AccountInfo>, ) -> Result<(), Self::Error>

Write changed accounts from a StateChangeset.
Source§

fn write_changed_storage( &self, _: &PlainStorageChangeset, ) -> Result<(), Self::Error>

Write changed storage from a StateChangeset.
Source§

fn write_changed_contracts( &self, code_hash: &FixedBytes<32>, bytecode: &Bytecode, ) -> Result<(), Self::Error>

Write changed contract bytecode from a StateChangeset.
Source§

fn write_state_changes(&self, _: &StateChangeset) -> Result<(), Self::Error>

Write a state changeset for a specific block.
Source§

fn changed_accounts_with_range( &self, range: RangeInclusive<u64>, ) -> Result<AHashMap<Address, Vec<u64>>, Self::Error>

Get all changed accounts with the list of block numbers in the given range. Read more
Source§

fn append_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> Result<(), HistoryError<Self::Error>>

Append account history indices for multiple accounts.
Source§

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<AHashMap<(Address, Uint<256, 4>), Vec<u64>>, Self::Error>

Get all changed storages with the list of block numbers in the given range. Read more
Source§

fn append_storage_history_index( &self, index_updates: impl IntoIterator<Item = ((Address, Uint<256, 4>), impl IntoIterator<Item = u64>)>, ) -> Result<(), HistoryError<Self::Error>>

Append storage history indices for multiple (address, slot) pairs.
Source§

fn update_history_indices_inconsistent( &self, range: RangeInclusive<u64>, ) -> Result<(), HistoryError<Self::Error>>

Update the history indices for accounts and storage in the given block range.
Source§

fn append_block_inconsistent( &self, header: &Sealed<Header>, state_changes: &BundleState, ) -> Result<(), Self::Error>

Append a block’s header and state changes in an inconsistent manner. Read more
Source§

fn append_blocks_inconsistent<'a>( &self, blocks: impl IntoIterator<Item = (&'a Sealed<Header>, &'a BundleState)>, ) -> Result<(), Self::Error>

Append multiple blocks’ headers and state changes in an inconsistent manner. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more