Skip to content
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

chore: relax EngineNodeLauncher bounds #13540

Merged
merged 5 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading