Introduce HashedPostStateProvider (#12607)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
frisitano
2024-12-04 00:56:17 +08:00
committed by GitHub
parent e4c7fac9db
commit 886471d693
42 changed files with 318 additions and 137 deletions

View File

@ -3,7 +3,7 @@ use alloy_eips::eip7685::Requests;
use alloy_primitives::{logs_bloom, Address, BlockNumber, Bloom, Log, B256, U256};
use reth_primitives::Receipts;
use reth_primitives_traits::{receipt::ReceiptExt, Account, Bytecode, Receipt, StorageEntry};
use reth_trie::HashedPostState;
use reth_trie::{HashedPostState, KeyHasher};
use revm::{
db::{states::BundleState, BundleAccount},
primitives::AccountInfo,
@ -164,8 +164,8 @@ impl<T> ExecutionOutcome<T> {
/// Returns [`HashedPostState`] for this execution outcome.
/// See [`HashedPostState::from_bundle_state`] for more info.
pub fn hash_state_slow(&self) -> HashedPostState {
HashedPostState::from_bundle_state(&self.bundle.state)
pub fn hash_state_slow<KH: KeyHasher>(&self) -> HashedPostState {
HashedPostState::from_bundle_state::<KH>(&self.bundle.state)
}
/// Transform block number to the index of block.