feat(storage): replace Tree generic with Arc<dyn TreeViewer> (#7810)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Kyrylo Riabov
2024-04-23 22:10:45 +03:00
committed by GitHub
parent a8a434d2c4
commit c659e28aa0
9 changed files with 102 additions and 113 deletions

View File

@ -1,15 +1,13 @@
use node::NodeHelper;
use reth::{
args::{DiscoveryArgs, NetworkArgs, RpcServerArgs},
blockchain_tree::ShareableBlockchainTree,
builder::{NodeBuilder, NodeConfig, NodeHandle},
revm::EvmProcessorFactory,
tasks::TaskManager,
};
use reth_db::{test_utils::TempDatabase, DatabaseEnv};
use reth_node_builder::{
components::{NetworkBuilder, PayloadServiceBuilder, PoolBuilder},
FullNodeComponentsAdapter, FullNodeTypesAdapter, NodeTypes,
FullNodeComponentsAdapter, FullNodeTypesAdapter,
};
use reth_primitives::ChainSpec;
use reth_provider::providers::BlockchainProvider;
@ -100,12 +98,10 @@ where
// Type aliases
type TmpDB = Arc<TempDatabase<DatabaseEnv>>;
type EvmType<N> = EvmProcessorFactory<<N as NodeTypes>::Evm>;
type RethProvider<N> = BlockchainProvider<TmpDB, ShareableBlockchainTree<TmpDB, EvmType<N>>>;
type TmpPool<N> = <<N as reth_node_builder::Node<TmpNodeAdapter<N>>>::PoolBuilder as PoolBuilder<
TmpNodeAdapter<N>,
>>::Pool;
type TmpNodeAdapter<N> = FullNodeTypesAdapter<N, TmpDB, RethProvider<N>>;
type TmpNodeAdapter<N> = FullNodeTypesAdapter<N, TmpDB, BlockchainProvider<TmpDB>>;
/// Type alias for a type of NodeHelper
pub type NodeHelperType<N> = NodeHelper<FullNodeComponentsAdapter<TmpNodeAdapter<N>, TmpPool<N>>>;