node: revise NodeTypes trait (#10665)

This commit is contained in:
Thomas Coratger
2024-09-03 05:52:53 -07:00
committed by GitHub
parent 020597da32
commit d30e3a4888
11 changed files with 140 additions and 62 deletions

View File

@@ -27,7 +27,7 @@ use reth::{
api::PayloadTypes,
builder::{
components::{ComponentsBuilder, PayloadServiceBuilder},
node::NodeTypes,
node::{NodeTypes, NodeTypesWithEngine},
BuilderContext, FullNodeTypes, Node, NodeBuilder, PayloadBuilderConfig,
},
primitives::revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg},
@@ -194,11 +194,14 @@ struct MyCustomNode;
/// Configure the node types
impl NodeTypes for MyCustomNode {
type Primitives = ();
// use the custom engine types
type Engine = CustomEngineTypes;
type ChainSpec = ChainSpec;
}
/// Configure the node types with the custom engine types
impl NodeTypesWithEngine for MyCustomNode {
type Engine = CustomEngineTypes;
}
/// Implement the Node trait for the custom node
///
/// This provides a preset configuration for the node