Skip to content

Commit

Permalink
chore: relax EngineNodeLauncher bounds (#13540)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr authored Dec 24, 2024
1 parent f67625f commit 9773b85
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/node/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ reth-tracing.workspace = true
reth-transaction-pool.workspace = true

## ethereum
alloy-consensus.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types = { workspace = true, features = ["engine"] }
alloy-eips = { workspace = true, features = ["kzg"] }
Expand Down
11 changes: 3 additions & 8 deletions crates/node/builder/src/launch/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ use reth_evm::noop::NoopBlockExecutorProvider;
use reth_fs_util as fs;
use reth_invalid_block_hooks::InvalidBlockWitnessHook;
use reth_network_p2p::headers::client::HeadersClient;
use reth_node_api::{
FullNodePrimitives, FullNodeTypes, NodePrimitives, NodeTypes, NodeTypesWithDB,
NodeTypesWithDBAdapter,
};
use reth_node_api::{FullNodeTypes, NodeTypes, NodeTypesWithDB, NodeTypesWithDBAdapter};
use reth_node_core::{
args::InvalidBlockHookType,
dirs::{ChainPath, DataDirPath},
Expand All @@ -46,7 +43,7 @@ use reth_node_metrics::{
server::{MetricServer, MetricServerConfig},
version::VersionInfo,
};
use reth_primitives::{Head, TransactionSigned};
use reth_primitives::Head;
use reth_provider::{
providers::{NodeTypesForProvider, ProviderNodeTypes, StaticFileProvider},
BlockHashReader, BlockNumReader, ChainSpecProvider, ProviderError, ProviderFactory,
Expand Down Expand Up @@ -388,7 +385,6 @@ where
pub async fn create_provider_factory<N>(&self) -> eyre::Result<ProviderFactory<N>>
where
N: ProviderNodeTypes<DB = DB, ChainSpec = ChainSpec>,
N::Primitives: FullNodePrimitives<BlockHeader = reth_primitives::Header>,
{
let factory = ProviderFactory::new(
self.right().clone(),
Expand Down Expand Up @@ -455,7 +451,6 @@ where
) -> eyre::Result<LaunchContextWith<Attached<WithConfigs<ChainSpec>, ProviderFactory<N>>>>
where
N: ProviderNodeTypes<DB = DB, ChainSpec = ChainSpec>,
N::Primitives: FullNodePrimitives<BlockHeader = reth_primitives::Header>,
{
let factory = self.create_provider_factory().await?;
let ctx = LaunchContextWith {
Expand Down Expand Up @@ -879,7 +874,7 @@ impl<T, CB>
where
T: FullNodeTypes<
Provider: StateProviderFactory + ChainSpecProvider,
Types: NodeTypesForProvider<Primitives: NodePrimitives<SignedTx = TransactionSigned>>,
Types: NodeTypesForProvider,
>,
CB: NodeComponentsBuilder<T>,
{
Expand Down
9 changes: 5 additions & 4 deletions crates/node/builder/src/launch/engine.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Engine node related functionality.
use alloy_consensus::BlockHeader;
use futures::{future::Either, stream, stream_select, StreamExt};
use reth_beacon_consensus::{
hooks::{EngineHooks, StaticFileHook},
Expand Down Expand Up @@ -385,12 +386,12 @@ where
ChainEvent::Handler(ev) => {
if let Some(head) = ev.canonical_header() {
let head_block = Head {
number: head.number,
number: head.number(),
hash: head.hash(),
difficulty: head.difficulty,
timestamp: head.timestamp,
difficulty: head.difficulty(),
timestamp: head.timestamp(),
total_difficulty: chainspec
.final_paris_total_difficulty(head.number)
.final_paris_total_difficulty(head.number())
.unwrap_or_default(),
};
network_handle.update_status(head_block);
Expand Down
4 changes: 2 additions & 2 deletions crates/node/events/src/cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct ConsensusLayerHealthEvents<H = Header> {
canon_chain: Box<dyn CanonChainTracker<Header = H>>,
}

impl fmt::Debug for ConsensusLayerHealthEvents {
impl<H> fmt::Debug for ConsensusLayerHealthEvents<H> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ConsensusLayerHealthEvents").field("interval", &self.interval).finish()
}
Expand All @@ -41,7 +41,7 @@ impl<H> ConsensusLayerHealthEvents<H> {
}
}

impl Stream for ConsensusLayerHealthEvents {
impl<H: Send + Sync> Stream for ConsensusLayerHealthEvents<H> {
type Item = ConsensusLayerHealthEvent;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down

0 comments on commit 9773b85

Please sign in to comment.