mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(rpc): relax VaidationApi and EngineApi (#13241)
This commit is contained in:
@ -18,7 +18,7 @@ pub use alloy_rpc_types_engine::{
|
||||
};
|
||||
pub use payload::{EthBuiltPayload, EthPayloadBuilderAttributes};
|
||||
use reth_chainspec::ChainSpec;
|
||||
use reth_engine_primitives::{EngineTypes, EngineValidator};
|
||||
use reth_engine_primitives::{EngineTypes, EngineValidator, PayloadValidator};
|
||||
use reth_payload_primitives::{
|
||||
validate_version_specific_fields, EngineApiMessageVersion, EngineObjectValidationError,
|
||||
PayloadOrAttributes, PayloadTypes,
|
||||
@ -82,12 +82,22 @@ impl EthereumEngineValidator {
|
||||
}
|
||||
}
|
||||
|
||||
impl PayloadValidator for EthereumEngineValidator {
|
||||
type Block = Block;
|
||||
|
||||
fn ensure_well_formed_payload(
|
||||
&self,
|
||||
payload: ExecutionPayload,
|
||||
sidecar: ExecutionPayloadSidecar,
|
||||
) -> Result<SealedBlock, PayloadError> {
|
||||
self.inner.ensure_well_formed_payload(payload, sidecar)
|
||||
}
|
||||
}
|
||||
|
||||
impl<Types> EngineValidator<Types> for EthereumEngineValidator
|
||||
where
|
||||
Types: EngineTypes<PayloadAttributes = EthPayloadAttributes>,
|
||||
{
|
||||
type Block = Block;
|
||||
|
||||
fn validate_version_specific_fields(
|
||||
&self,
|
||||
version: EngineApiMessageVersion,
|
||||
@ -103,12 +113,4 @@ where
|
||||
) -> Result<(), EngineObjectValidationError> {
|
||||
validate_version_specific_fields(self.chain_spec(), version, attributes.into())
|
||||
}
|
||||
|
||||
fn ensure_well_formed_payload(
|
||||
&self,
|
||||
payload: ExecutionPayload,
|
||||
sidecar: ExecutionPayloadSidecar,
|
||||
) -> Result<SealedBlock, PayloadError> {
|
||||
self.inner.ensure_well_formed_payload(payload, sidecar)
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,14 +6,13 @@ use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGenera
|
||||
use reth_beacon_consensus::EthBeaconConsensus;
|
||||
use reth_chainspec::ChainSpec;
|
||||
use reth_ethereum_engine_primitives::{
|
||||
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes, EthereumEngineValidator,
|
||||
EthBuiltPayload, EthPayloadAttributes, EthPayloadBuilderAttributes,
|
||||
};
|
||||
use reth_evm::execute::BasicBlockExecutorProvider;
|
||||
use reth_evm_ethereum::execute::EthExecutionStrategyFactory;
|
||||
use reth_network::{NetworkHandle, PeersInfo};
|
||||
use reth_node_api::{
|
||||
AddOnsContext, ConfigureEvm, EngineValidator, FullNodeComponents, HeaderTy, NodeTypesWithDB,
|
||||
TxTy,
|
||||
AddOnsContext, ConfigureEvm, FullNodeComponents, HeaderTy, NodeTypesWithDB, TxTy,
|
||||
};
|
||||
use reth_node_builder::{
|
||||
components::{
|
||||
@ -37,6 +36,8 @@ use reth_trie_db::MerklePatriciaTrie;
|
||||
|
||||
use crate::{EthEngineTypes, EthEvmConfig};
|
||||
|
||||
pub use reth_ethereum_engine_primitives::EthereumEngineValidator;
|
||||
|
||||
/// Type configuration for a regular Ethereum node.
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
@ -353,9 +354,12 @@ pub struct EthereumEngineValidatorBuilder;
|
||||
|
||||
impl<Node, Types> EngineValidatorBuilder<Node> for EthereumEngineValidatorBuilder
|
||||
where
|
||||
Types: NodeTypesWithEngine<ChainSpec = ChainSpec>,
|
||||
Types: NodeTypesWithEngine<
|
||||
ChainSpec = ChainSpec,
|
||||
Engine = EthEngineTypes,
|
||||
Primitives = EthPrimitives,
|
||||
>,
|
||||
Node: FullNodeComponents<Types = Types>,
|
||||
EthereumEngineValidator: EngineValidator<Types::Engine>,
|
||||
{
|
||||
type Validator = EthereumEngineValidator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user