chore: Introduce helper type for evm cfg and env tuple (#13377)

This commit is contained in:
Ayodeji Akinola
2024-12-14 09:53:59 +01:00
committed by GitHub
parent 16f6d7a0c3
commit b525231224
33 changed files with 290 additions and 165 deletions

View File

@ -23,7 +23,7 @@ use reth_chain_state::{
use reth_chainspec::{ChainInfo, EthereumHardforks};
use reth_db::{models::BlockNumberAddress, transaction::DbTx, Database};
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_execution_types::ExecutionOutcome;
use reth_node_types::{BlockTy, HeaderTy, NodeTypesWithDB, ReceiptTy, TxTy};
use reth_primitives::{
@ -502,7 +502,7 @@ impl<N: ProviderNodeTypes> EvmEnvProvider<HeaderTy<N>> for BlockchainProvider2<N
&self,
header: &HeaderTy<N>,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = HeaderTy<N>>,
{

View File

@ -17,7 +17,7 @@ use reth_chain_state::{BlockState, CanonicalInMemoryState, MemoryOverlayStatePro
use reth_chainspec::{ChainInfo, EthereumHardforks};
use reth_db::models::BlockNumberAddress;
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_execution_types::{BundleStateInit, ExecutionOutcome, RevertsInit};
use reth_node_types::{BlockTy, HeaderTy, ReceiptTy, TxTy};
use reth_primitives::{
@ -32,10 +32,7 @@ use reth_storage_api::{
StateProvider, StorageChangeSetReader,
};
use reth_storage_errors::provider::ProviderResult;
use revm::{
db::states::PlainStorageRevert,
primitives::{BlockEnv, CfgEnvWithHandlerCfg},
};
use revm::db::states::PlainStorageRevert;
use std::{
collections::{hash_map, HashMap},
ops::{Add, Bound, RangeBounds, RangeInclusive, Sub},
@ -1240,7 +1237,7 @@ impl<N: ProviderNodeTypes> EvmEnvProvider<HeaderTy<N>> for ConsistentProvider<N>
&self,
header: &HeaderTy<N>,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = HeaderTy<N>>,
{

View File

@ -17,7 +17,7 @@ use reth_chainspec::{ChainInfo, EthereumHardforks};
use reth_db::{init_db, mdbx::DatabaseArguments, DatabaseEnv};
use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
use reth_errors::{RethError, RethResult};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_node_types::{BlockTy, HeaderTy, NodeTypesWithDB, ReceiptTy, TxTy};
use reth_primitives::{
BlockWithSenders, SealedBlockFor, SealedBlockWithSenders, SealedHeader, StaticFileSegment,
@ -32,10 +32,7 @@ use reth_storage_api::{
use reth_storage_errors::provider::ProviderResult;
use reth_trie::HashedPostState;
use reth_trie_db::StateCommitment;
use revm::{
db::BundleState,
primitives::{BlockEnv, CfgEnvWithHandlerCfg},
};
use revm::db::BundleState;
use std::{
ops::{RangeBounds, RangeInclusive},
path::Path,
@ -599,7 +596,7 @@ impl<N: ProviderNodeTypes> EvmEnvProvider<HeaderTy<N>> for ProviderFactory<N> {
&self,
header: &HeaderTy<N>,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = HeaderTy<N>>,
{

View File

@ -47,7 +47,7 @@ use reth_db_api::{
transaction::{DbTx, DbTxMut},
DatabaseError,
};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_network_p2p::headers::downloader::SyncTarget;
use reth_node_types::{BlockTy, BodyTy, HeaderTy, NodeTypes, ReceiptTy, TxTy};
@ -70,9 +70,8 @@ use reth_trie::{
HashedPostStateSorted, Nibbles, StateRoot, StoredNibbles,
};
use reth_trie_db::{DatabaseStateRoot, DatabaseStorageTrieCursor};
use revm::{
db::states::{PlainStateReverts, PlainStorageChangeset, PlainStorageRevert, StateChangeset},
primitives::{BlockEnv, CfgEnvWithHandlerCfg},
use revm::db::states::{
PlainStateReverts, PlainStorageChangeset, PlainStorageRevert, StateChangeset,
};
use std::{
cmp::Ordering,
@ -1648,7 +1647,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> EvmEnvProvider<HeaderTy<N>>
&self,
header: &HeaderTy<N>,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = HeaderTy<N>>,
{

View File

@ -26,7 +26,7 @@ use reth_chain_state::{ChainInfoTracker, ForkChoiceNotifications, ForkChoiceSubs
use reth_chainspec::{ChainInfo, EthereumHardforks};
use reth_db::table::Value;
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_node_types::{
BlockTy, FullNodePrimitives, HeaderTy, NodeTypes, NodeTypesWithDB, NodeTypesWithEngine,
ReceiptTy, TxTy,
@ -39,7 +39,6 @@ use reth_prune_types::{PruneCheckpoint, PruneSegment};
use reth_stages_types::{StageCheckpoint, StageId};
use reth_storage_api::{BlockBodyIndicesProvider, CanonChainTracker, OmmersProvider};
use reth_storage_errors::provider::ProviderResult;
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
use std::{
collections::BTreeMap,
ops::{RangeBounds, RangeInclusive},
@ -607,7 +606,7 @@ impl<N: TreeNodeTypes> EvmEnvProvider for BlockchainProvider<N> {
&self,
header: &Header,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = Header>,
{

View File

@ -19,7 +19,7 @@ use parking_lot::Mutex;
use reth_chainspec::{ChainInfo, ChainSpec};
use reth_db::mock::{DatabaseMock, TxMock};
use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices};
use reth_evm::ConfigureEvmEnv;
use reth_evm::{env::EvmEnv, ConfigureEvmEnv};
use reth_execution_types::ExecutionOutcome;
use reth_node_types::NodeTypes;
use reth_primitives::{
@ -38,7 +38,6 @@ use reth_trie::{
MultiProofTargets, StorageMultiProof, StorageProof, TrieInput,
};
use reth_trie_db::MerklePatriciaTrie;
use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg};
use std::{
collections::BTreeMap,
ops::{RangeBounds, RangeInclusive},
@ -713,7 +712,7 @@ impl EvmEnvProvider for MockEthProvider {
&self,
header: &Header,
evm_config: EvmConfig,
) -> ProviderResult<(CfgEnvWithHandlerCfg, BlockEnv)>
) -> ProviderResult<EvmEnv>
where
EvmConfig: ConfigureEvmEnv<Header = Header>,
{