-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: EngineValidator
#11144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: EngineValidator
#11144
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,15 @@ use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGenera | |
| use reth_beacon_consensus::EthBeaconConsensus; | ||
| use reth_chainspec::ChainSpec; | ||
| use reth_ethereum_engine_primitives::{ | ||
| EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes, | ||
| EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes, EthereumEngineValidator, | ||
| }; | ||
| use reth_evm_ethereum::execute::EthExecutorProvider; | ||
| use reth_network::NetworkHandle; | ||
| use reth_node_api::{ConfigureEvm, FullNodeComponents, NodeAddOns}; | ||
| use reth_node_api::{ConfigureEvm, EngineValidator, FullNodeComponents, NodeAddOns}; | ||
| use reth_node_builder::{ | ||
| components::{ | ||
| ComponentsBuilder, ConsensusBuilder, ExecutorBuilder, NetworkBuilder, | ||
| PayloadServiceBuilder, PoolBuilder, | ||
| ComponentsBuilder, ConsensusBuilder, EngineValidatorBuilder, ExecutorBuilder, | ||
| NetworkBuilder, PayloadServiceBuilder, PoolBuilder, | ||
| }, | ||
| node::{FullNodeTypes, NodeTypes, NodeTypesWithEngine}, | ||
| BuilderContext, Node, PayloadBuilderConfig, PayloadTypes, | ||
|
|
@@ -46,6 +46,7 @@ impl EthereumNode { | |
| EthereumNetworkBuilder, | ||
| EthereumExecutorBuilder, | ||
| EthereumConsensusBuilder, | ||
| EthereumEngineValidatorBuilder, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is fine for now, I think we'd like to not have this as a component because this is engine API specific, but for now this is totally fine since it unblocks things and the change is not invasive |
||
| > | ||
| where | ||
| Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>, | ||
|
|
@@ -62,6 +63,7 @@ impl EthereumNode { | |
| .network(EthereumNetworkBuilder::default()) | ||
| .executor(EthereumExecutorBuilder::default()) | ||
| .consensus(EthereumConsensusBuilder::default()) | ||
| .engine_validator(EthereumEngineValidatorBuilder::default()) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -94,6 +96,7 @@ where | |
| EthereumNetworkBuilder, | ||
| EthereumExecutorBuilder, | ||
| EthereumConsensusBuilder, | ||
| EthereumEngineValidatorBuilder, | ||
| >; | ||
|
|
||
| type AddOns = EthereumAddOns; | ||
|
|
@@ -316,3 +319,21 @@ where | |
| } | ||
| } | ||
| } | ||
|
|
||
| /// Builder for [`EthereumEngineValidator`]. | ||
| #[derive(Debug, Default, Clone)] | ||
| #[non_exhaustive] | ||
| pub struct EthereumEngineValidatorBuilder; | ||
|
|
||
| impl<Node, Types> EngineValidatorBuilder<Node> for EthereumEngineValidatorBuilder | ||
| where | ||
| Types: NodeTypesWithEngine<ChainSpec = ChainSpec>, | ||
| Node: FullNodeTypes<Types = Types>, | ||
| EthereumEngineValidator: EngineValidator<Types::Engine>, | ||
| { | ||
| type Validator = EthereumEngineValidator; | ||
|
|
||
| async fn build_validator(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::Validator> { | ||
| Ok(EthereumEngineValidator::new(ctx.chain_spec())) | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice