pub trait DatabaseHashedPostState<TX>: Sized {
// Required method
fn from_reverts<KH: KeyHasher>(
tx: &TX,
range: impl RangeBounds<BlockNumber>,
) -> Result<HashedPostStateSorted, DatabaseError>;
}Expand description
Extends [HashedPostStateSorted] with operations specific for working with a database
transaction.
Required Methods§
Sourcefn from_reverts<KH: KeyHasher>(
tx: &TX,
range: impl RangeBounds<BlockNumber>,
) -> Result<HashedPostStateSorted, DatabaseError>
fn from_reverts<KH: KeyHasher>( tx: &TX, range: impl RangeBounds<BlockNumber>, ) -> Result<HashedPostStateSorted, DatabaseError>
Initializes [HashedPostStateSorted] from reverts. Iterates over state reverts in the
specified range and aggregates them into sorted hashed state.
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§
Source§impl<TX: DbTx> DatabaseHashedPostState<TX> for HashedPostStateSorted
impl<TX: DbTx> DatabaseHashedPostState<TX> for HashedPostStateSorted
Source§fn from_reverts<KH: KeyHasher>(
tx: &TX,
range: impl RangeBounds<BlockNumber>,
) -> Result<Self, DatabaseError>
fn from_reverts<KH: KeyHasher>( tx: &TX, range: impl RangeBounds<BlockNumber>, ) -> Result<Self, DatabaseError>
Builds a sorted hashed post-state from reverts.
Reads MDBX data directly into Vecs, using HashSets only to track seen keys.
This avoids intermediate HashMap allocations since MDBX data is already sorted.
- Reads the first occurrence of each changed account/storage slot in the range.
- Hashes keys and returns them already ordered for trie iteration.