@@ -17,18 +17,20 @@ use reth::{
1717 dirs:: { DataDirPath , MaybePlatformPath } ,
1818} ;
1919use reth_consensus:: FullConsensus ;
20+ use reth_db:: test_utils:: TempDatabase ;
2021use reth_db:: DatabaseEnv ;
2122use reth_db:: { init_db, test_utils:: tempdir_path} ;
2223use reth_network:: NetworkHandle ;
2324use reth_node_api:: { FullNodeTypesAdapter , NodeTypesWithDBAdapter } ;
2425use reth_node_builder:: components:: Components ;
26+ use reth_node_builder:: engine_tree_config:: TreeConfig ;
2527use reth_node_builder:: rpc:: RpcAddOns ;
26- use reth_node_builder:: { NodeAdapter , NodeBuilder , NodeConfig , NodeHandle } ;
27- use reth_node_ethereum:: node:: EthereumEngineValidatorBuilder ;
28+ use reth_node_builder:: { EngineNodeLauncher , NodeAdapter , NodeBuilder , NodeConfig , NodeHandle } ;
29+ use reth_node_ethereum:: node:: { EthereumAddOns , EthereumEngineValidatorBuilder } ;
2830use reth_node_ethereum:: {
2931 BasicBlockExecutorProvider , EthEvmConfig , EthExecutionStrategyFactory , EthereumNode ,
3032} ;
31- use reth_provider:: providers:: BlockchainProvider ;
33+ use reth_provider:: providers:: BlockchainProvider2 ;
3234use reth_rpc:: EthApi ;
3335use reth_tasks:: TaskManager ;
3436use reth_transaction_pool:: blobstore:: DiskFileBlobStore ;
@@ -207,7 +209,107 @@ async fn start_reth_node(
207209 import_data : Option < ImportData > ,
208210) -> (
209211 EthJsonRpcClient < ReqwestClient > ,
210- NodeHandle < NodeAdapter < FullNodeTypesAdapter < EthereumNode , Arc < DatabaseEnv > , BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > > , Components < FullNodeTypesAdapter < EthereumNode , Arc < DatabaseEnv > , BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > > , reth_network:: EthNetworkPrimitives , Pool < TransactionValidationTaskExecutor < EthTransactionValidator < BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > , EthPooledTransaction > > , CoinbaseTipOrdering < EthPooledTransaction > , DiskFileBlobStore > , EthEvmConfig , BasicBlockExecutorProvider < EthExecutionStrategyFactory > , Arc < dyn FullConsensus > > > , RpcAddOns < NodeAdapter < FullNodeTypesAdapter < EthereumNode , Arc < DatabaseEnv > , BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > > , Components < FullNodeTypesAdapter < EthereumNode , Arc < DatabaseEnv > , BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > > , reth_network:: EthNetworkPrimitives , Pool < TransactionValidationTaskExecutor < EthTransactionValidator < BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > , EthPooledTransaction > > , CoinbaseTipOrdering < EthPooledTransaction > , DiskFileBlobStore > , EthEvmConfig , BasicBlockExecutorProvider < EthExecutionStrategyFactory > , Arc < dyn FullConsensus > > > , EthApi < BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > , Pool < TransactionValidationTaskExecutor < EthTransactionValidator < BlockchainProvider < NodeTypesWithDBAdapter < EthereumNode , Arc < DatabaseEnv > > > , EthPooledTransaction > > , CoinbaseTipOrdering < EthPooledTransaction > , DiskFileBlobStore > , NetworkHandle , EthEvmConfig > , EthereumEngineValidatorBuilder > > ,
212+ NodeHandle <
213+ NodeAdapter <
214+ FullNodeTypesAdapter <
215+ EthereumNode ,
216+ Arc < TempDatabase < DatabaseEnv > > ,
217+ BlockchainProvider2 <
218+ NodeTypesWithDBAdapter < EthereumNode , Arc < TempDatabase < DatabaseEnv > > > ,
219+ > ,
220+ > ,
221+ Components <
222+ FullNodeTypesAdapter <
223+ EthereumNode ,
224+ Arc < TempDatabase < DatabaseEnv > > ,
225+ BlockchainProvider2 <
226+ NodeTypesWithDBAdapter < EthereumNode , Arc < TempDatabase < DatabaseEnv > > > ,
227+ > ,
228+ > ,
229+ reth_network:: EthNetworkPrimitives ,
230+ Pool <
231+ TransactionValidationTaskExecutor <
232+ EthTransactionValidator <
233+ BlockchainProvider2 <
234+ NodeTypesWithDBAdapter <
235+ EthereumNode ,
236+ Arc < TempDatabase < DatabaseEnv > > ,
237+ > ,
238+ > ,
239+ EthPooledTransaction ,
240+ > ,
241+ > ,
242+ CoinbaseTipOrdering < EthPooledTransaction > ,
243+ DiskFileBlobStore ,
244+ > ,
245+ EthEvmConfig ,
246+ BasicBlockExecutorProvider < EthExecutionStrategyFactory > ,
247+ Arc < dyn FullConsensus > ,
248+ > ,
249+ > ,
250+ RpcAddOns <
251+ NodeAdapter <
252+ FullNodeTypesAdapter <
253+ EthereumNode ,
254+ Arc < TempDatabase < DatabaseEnv > > ,
255+ BlockchainProvider2 <
256+ NodeTypesWithDBAdapter < EthereumNode , Arc < TempDatabase < DatabaseEnv > > > ,
257+ > ,
258+ > ,
259+ Components <
260+ FullNodeTypesAdapter <
261+ EthereumNode ,
262+ Arc < TempDatabase < DatabaseEnv > > ,
263+ BlockchainProvider2 <
264+ NodeTypesWithDBAdapter < EthereumNode , Arc < TempDatabase < DatabaseEnv > > > ,
265+ > ,
266+ > ,
267+ reth_network:: EthNetworkPrimitives ,
268+ Pool <
269+ TransactionValidationTaskExecutor <
270+ EthTransactionValidator <
271+ BlockchainProvider2 <
272+ NodeTypesWithDBAdapter <
273+ EthereumNode ,
274+ Arc < TempDatabase < DatabaseEnv > > ,
275+ > ,
276+ > ,
277+ EthPooledTransaction ,
278+ > ,
279+ > ,
280+ CoinbaseTipOrdering < EthPooledTransaction > ,
281+ DiskFileBlobStore ,
282+ > ,
283+ EthEvmConfig ,
284+ BasicBlockExecutorProvider < EthExecutionStrategyFactory > ,
285+ Arc < dyn FullConsensus > ,
286+ > ,
287+ > ,
288+ EthApi <
289+ BlockchainProvider2 <
290+ NodeTypesWithDBAdapter < EthereumNode , Arc < TempDatabase < DatabaseEnv > > > ,
291+ > ,
292+ Pool <
293+ TransactionValidationTaskExecutor <
294+ EthTransactionValidator <
295+ BlockchainProvider2 <
296+ NodeTypesWithDBAdapter <
297+ EthereumNode ,
298+ Arc < TempDatabase < DatabaseEnv > > ,
299+ > ,
300+ > ,
301+ EthPooledTransaction ,
302+ > ,
303+ > ,
304+ CoinbaseTipOrdering < EthPooledTransaction > ,
305+ DiskFileBlobStore ,
306+ > ,
307+ NetworkHandle ,
308+ EthEvmConfig ,
309+ > ,
310+ EthereumEngineValidatorBuilder ,
311+ > ,
312+ > ,
211313) {
212314 let tasks = TaskManager :: current ( ) ;
213315
@@ -240,10 +342,21 @@ async fn start_reth_node(
240342 Arc :: new ( init_db ( data_dir. db ( ) , Default :: default ( ) ) . unwrap ( ) )
241343 } ;
242344
345+ let exec = tasks. executor ( ) ;
243346 let node_handle = NodeBuilder :: new ( node_config)
244347 . with_database ( database)
245- . with_launch_context ( tasks. executor ( ) )
246- . launch_node ( EthereumNode :: default ( ) )
348+ . testing_node ( exec)
349+ . with_types_and_provider :: < EthereumNode , BlockchainProvider2 < _ > > ( )
350+ . with_components ( EthereumNode :: components ( ) )
351+ . with_add_ons ( EthereumAddOns :: default ( ) )
352+ . launch_with_fn ( |builder| {
353+ let launcher = EngineNodeLauncher :: new (
354+ builder. task_executor ( ) . clone ( ) ,
355+ builder. config ( ) . datadir ( ) ,
356+ TreeConfig :: default ( ) ,
357+ ) ;
358+ builder. launch_with ( launcher)
359+ } )
247360 . await
248361 . unwrap ( ) ;
249362
0 commit comments