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§
Trait Implementations§
Source§impl<T> Database for RevmWrite<T>
impl<T> Database for RevmWrite<T>
Source§fn basic(
&mut self,
address: Address,
) -> Result<Option<AccountInfo>, <RevmWrite<T> as Database>::Error>
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>
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>
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>
fn block_hash( &mut self, number: u64, ) -> Result<FixedBytes<32>, <RevmWrite<T> as Database>::Error>
Gets block hash by block number.
Source§impl<T> DatabaseRef for RevmWrite<T>
impl<T> DatabaseRef for RevmWrite<T>
Source§fn basic_ref(
&self,
address: Address,
) -> Result<Option<AccountInfo>, <RevmWrite<T> as DatabaseRef>::Error>
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>
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>
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>
fn block_hash_ref( &self, number: u64, ) -> Result<FixedBytes<32>, <RevmWrite<T> as DatabaseRef>::Error>
Gets block hash by block number.
Source§impl<U> Debug for RevmWrite<U>where
U: HotKvWrite,
impl<U> Debug for RevmWrite<U>where
U: HotKvWrite,
Source§impl<U> HotKvRead for RevmWrite<U>where
U: HotKvWrite,
impl<U> HotKvRead for RevmWrite<U>where
U: HotKvWrite,
Source§type Traverse<'a> = <U as HotKvRead>::Traverse<'a>
where
U: 'a
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>
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>
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>
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,
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,
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,
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,
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,
impl<U> HotKvWrite for RevmWrite<U>where
U: HotKvWrite,
Source§type TraverseMut<'a> = <U as HotKvWrite>::TraverseMut<'a>
where
U: 'a
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>
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>
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>
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>
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>
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>
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>
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>
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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§impl<T> TryDatabaseCommit for RevmWrite<T>
impl<T> TryDatabaseCommit for RevmWrite<T>
Source§fn try_commit(
&mut self,
changes: HashMap<Address, Account, DefaultHashBuilder>,
) -> Result<(), <RevmWrite<T> as TryDatabaseCommit>::Error>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
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,
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,
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,
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,
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,
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,
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,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> HistoryRead for Twhere
T: HotDbRead,
impl<T> HistoryRead for Twhere
T: HotDbRead,
Source§fn get_account_history(
&self,
address: &Address,
latest_height: u64,
) -> Result<Option<IntegerList>, Self::Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>>
fn check_height( &self, height: Option<u64>, ) -> Result<(), HistoryError<Self::Error>>
Validate that
height is within the stored block range. Read moreSource§fn get_account_at_height_checked(
&self,
address: &Address,
height: Option<u64>,
) -> Result<Option<Account>, HistoryError<Self::Error>>
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>>
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§impl<T> HistoryWrite for Twhere
T: UnsafeDbWrite + UnsafeHistoryWrite,
impl<T> HistoryWrite for Twhere
T: UnsafeDbWrite + UnsafeHistoryWrite,
Source§fn validate_chain_extension<'a, I>(
&self,
headers: I,
) -> Result<(), HistoryError<Self::Error>>
fn validate_chain_extension<'a, I>( &self, headers: I, ) -> Result<(), HistoryError<Self::Error>>
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>>
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>>
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>>
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 Twhere
T: HotKvRead,
impl<T> HotDbRead for Twhere
T: HotKvRead,
Source§fn get_header(&self, number: u64) -> Result<Option<Sealed<Header>>, Self::Error>
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>
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>
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>
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>
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>
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
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
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) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
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
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
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> UnsafeDbWrite for Twhere
T: HotKvWrite,
impl<T> UnsafeDbWrite for Twhere
T: HotKvWrite,
Source§fn put_header_inconsistent(
&self,
header: &Sealed<Header>,
) -> Result<(), Self::Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn delete_header_number(&self, hash: &FixedBytes<32>) -> Result<(), Self::Error>
Delete a header number mapping by hash.
Source§impl<T> UnsafeHistoryWrite for Twhere
T: UnsafeDbWrite + HotKvWrite,
impl<T> UnsafeHistoryWrite for Twhere
T: UnsafeDbWrite + HotKvWrite,
Source§fn write_account_history(
&self,
address: &Address,
latest_height: u64,
touched: &IntegerList,
) -> Result<(), Self::Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>>
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>
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>>
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>>
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>
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>
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