refactor: integrate BuiltPayload::Primitives (#13484)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2024-12-24 03:06:47 +04:00
committed by GitHub
parent 4c1208e9d9
commit af1c9b7614
24 changed files with 136 additions and 78 deletions

View File

@ -19,7 +19,7 @@ use reth_db_api::{
database_metrics::{DatabaseMetadata, DatabaseMetrics},
Database,
};
use reth_engine_primitives::EngineTypes;
use reth_engine_primitives::{BuiltPayload, EngineTypes};
use reth_trie_db::StateCommitment;
/// The type that configures the essential types of an Ethereum-like node.
@ -41,7 +41,7 @@ pub trait NodeTypes: Send + Sync + Unpin + 'static {
/// The type that configures an Ethereum-like node with an engine for consensus.
pub trait NodeTypesWithEngine: NodeTypes {
/// The node's engine types, defining the interaction with the consensus engine.
type Engine: EngineTypes;
type Engine: EngineTypes<BuiltPayload: BuiltPayload<Primitives = Self::Primitives>>;
}
/// A helper trait that is downstream of the [`NodeTypesWithEngine`] trait and adds database to the
@ -225,7 +225,7 @@ where
impl<P, E, C, SC, S> NodeTypesWithEngine for AnyNodeTypesWithEngine<P, E, C, SC, S>
where
P: NodePrimitives + Send + Sync + Unpin + 'static,
E: EngineTypes + Send + Sync + Unpin,
E: EngineTypes<BuiltPayload: BuiltPayload<Primitives = P>> + Send + Sync + Unpin,
C: EthChainSpec<Header = P::BlockHeader> + 'static,
SC: StateCommitment,
S: Default + Send + Sync + Unpin + Debug + 'static,