From 233d99b0fd4c7a03cad50a2230b87e3f3cd60543 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 16:31:21 +0200 Subject: [PATCH 01/21] Fix clone impl for OpEthApi --- crates/optimism/rpc/src/eth/mod.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index 8d6690b07e4b..12f83e0edf15 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -57,9 +57,10 @@ pub type EthApiNodeBackend = EthApiInner< /// /// This type implements the [`FullEthApi`](reth_rpc_eth_api::helpers::FullEthApi) by implemented /// all the `Eth` helper traits and prerequisite traits. +#[derive(Clone)] pub struct OpEthApi { inner: Arc>, - sequencer_client: parking_lot::RwLock>, + sequencer_client: Arc>>, } impl OpEthApi { @@ -84,20 +85,7 @@ impl OpEthApi { ctx.config.proof_permits, ); - Self { inner: Arc::new(inner), sequencer_client: parking_lot::RwLock::new(None) } - } -} - -impl Clone for OpEthApi -where - N: FullNodeComponents, - Self: Send + Sync, -{ - fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - sequencer_client: parking_lot::RwLock::new(self.sequencer_client.read().clone()), - } + Self { inner: Arc::new(inner), sequencer_client: Arc::new(parking_lot::RwLock::new(None)) } } } From f0c4120cd6a2d2bdcf295f8a38c24644e3e816ad Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 16:15:58 +0200 Subject: [PATCH 02/21] Add helper trait reth_node_api::NodeCore for simplified type def --- crates/node/api/src/node.rs | 48 +++++++++++++++++++++++++++ crates/node/builder/src/launch/mod.rs | 12 +++---- crates/optimism/rpc/src/eth/mod.rs | 30 +++++++++-------- 3 files changed, 71 insertions(+), 19 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index 50e87f98b7c3..f902941bcd6d 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -189,3 +189,51 @@ impl BuilderProvider for () { } const fn noop_builder(_: ()) {} + +/// Helper trait to relax trait bounds on [`NodeTypes`], when defining types. +pub trait NodeTy { + /// The node's primitive types, defining basic operations and structures. + type Primitives; + /// The node's engine types, defining the interaction with the consensus engine. + type Engine; + /// The type used for configuration of the EVM. + type ChainSpec; +} + +impl NodeTy for T +where + T: NodeTypes, +{ + type Primitives = ::Primitives; + type Engine = ::Engine; + type ChainSpec = ::ChainSpec; +} + +/// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when +/// defining types. +pub trait NodeCore: NodeTy { + /// Underlying database type used by the node to store and retrieve data. + type DB; + /// The provider type used to interact with the node. + type Provider; + /// The transaction pool of the node. + type Pool; + /// The node's EVM configuration, defining settings for the Ethereum Virtual Machine. + type Evm; + /// The type that knows how to execute blocks. + type Executor; + /// Network API. + type Network; +} + +impl NodeCore for T +where + T: FullNodeComponents, +{ + type DB = ::DB; + type Provider = ::Provider; + type Pool = ::Pool; + type Network = ::Network; + type Evm = ::Evm; + type Executor = ::Executor; +} diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index c579de92eb2b..95c065044266 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -21,7 +21,7 @@ use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, use reth_engine_util::EngineMessageStreamExt; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider}; -use reth_node_api::{FullNodeComponents, FullNodeTypes, NodeAddOns}; +use reth_node_api::{FullNodeTypes, NodeAddOns, NodeCore}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, exit::NodeExitFuture, @@ -50,12 +50,12 @@ use crate::{ /// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`FullNodeComponents`]. pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< - ::Provider, - ::Pool, - ::Evm, - ::Network, + ::Provider, + ::Pool, + ::Evm, + ::Network, TaskExecutor, - ::Provider, + ::Provider, >; /// A general purpose trait that launches a new node of any kind. diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index 8d6690b07e4b..f8a7fba6c163 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -10,17 +10,16 @@ pub mod rpc; use std::{fmt, sync::Arc}; -use crate::eth::rpc::SequencerClient; use alloy_primitives::U256; use op_alloy_network::AnyNetwork; use reth_chainspec::ChainSpec; use reth_evm::ConfigureEvm; use reth_network_api::NetworkInfo; -use reth_node_api::{BuilderProvider, FullNodeComponents, FullNodeTypes}; +use reth_node_api::{BuilderProvider, FullNodeComponents, NodeCore}; use reth_node_builder::EthApiBuilderCtx; use reth_provider::{ - BlockIdReader, BlockNumReader, BlockReaderIdExt, ChainSpecProvider, HeaderProvider, - StageCheckpointReader, StateProviderFactory, + BlockIdReader, BlockNumReader, BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider, + HeaderProvider, StageCheckpointReader, StateProviderFactory, }; use reth_rpc::eth::{core::EthApiInner, DevSigner}; use reth_rpc_eth_api::{ @@ -37,14 +36,14 @@ use reth_tasks::{ }; use reth_transaction_pool::TransactionPool; -use crate::OpEthApiError; +use crate::{eth::rpc::SequencerClient, OpEthApiError}; /// Adapter for [`EthApiInner`], which holds all the data required to serve core `eth_` API. pub type EthApiNodeBackend = EthApiInner< - ::Provider, - ::Pool, - ::Network, - ::Evm, + ::Provider, + ::Pool, + ::Network, + ::Evm, >; /// OP-Reth `Eth` API implementation. @@ -57,12 +56,17 @@ pub type EthApiNodeBackend = EthApiInner< /// /// This type implements the [`FullEthApi`](reth_rpc_eth_api::helpers::FullEthApi) by implemented /// all the `Eth` helper traits and prerequisite traits. -pub struct OpEthApi { +pub struct OpEthApi { inner: Arc>, sequencer_client: parking_lot::RwLock>, } -impl OpEthApi { +impl OpEthApi +where + N: NodeCore< + Provider: BlockReaderIdExt + ChainSpecProvider + CanonStateSubscriptions + Clone + 'static, + >, +{ /// Creates a new instance for given context. #[allow(clippy::type_complexity)] pub fn with_spawner(ctx: &EthApiBuilderCtx) -> Self { @@ -90,7 +94,7 @@ impl OpEthApi { impl Clone for OpEthApi where - N: FullNodeComponents, + N: NodeCore, Self: Send + Sync, { fn clone(&self) -> Self { @@ -104,7 +108,7 @@ where impl EthApiTypes for OpEthApi where Self: Send + Sync, - N: FullNodeComponents, + N: NodeCore, { type Error = OpEthApiError; type NetworkTypes = AnyNetwork; From a64bfa707088738dd4e33b4b195b497888d5a533 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 17:22:37 +0200 Subject: [PATCH 03/21] Add auto trait bounds to reth_node_api::NodeCore --- crates/node/api/src/node.rs | 20 ++++++++++---------- crates/node/builder/src/rpc.rs | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index f902941bcd6d..d0edb7a7b22e 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -195,14 +195,14 @@ pub trait NodeTy { /// The node's primitive types, defining basic operations and structures. type Primitives; /// The node's engine types, defining the interaction with the consensus engine. - type Engine; + type Engine: Send + Sync + Clone + Unpin; /// The type used for configuration of the EVM. - type ChainSpec; + type ChainSpec: Send + Sync; } impl NodeTy for T where - T: NodeTypes, + T: NodeTypes + Clone, { type Primitives = ::Primitives; type Engine = ::Engine; @@ -211,19 +211,19 @@ where /// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when /// defining types. -pub trait NodeCore: NodeTy { +pub trait NodeCore: NodeTy + Clone { /// Underlying database type used by the node to store and retrieve data. - type DB; + type DB: Send + Sync + Clone + Unpin; /// The provider type used to interact with the node. - type Provider; + type Provider: Send + Sync + Clone + Unpin; /// The transaction pool of the node. - type Pool; + type Pool: Send + Sync + Clone + Unpin; /// The node's EVM configuration, defining settings for the Ethereum Virtual Machine. - type Evm; + type Evm: Send + Sync + Clone + Unpin; /// The type that knows how to execute blocks. - type Executor; + type Executor: Send + Sync + Clone + Unpin; /// Network API. - type Network; + type Network: Send + Sync + Clone; } impl NodeCore for T diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 141bca1f92bc..40d0247c8e91 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -6,7 +6,7 @@ use std::{ }; use futures::TryFutureExt; -use reth_node_api::{BuilderProvider, FullNodeComponents}; +use reth_node_api::{BuilderProvider, FullNodeComponents, NodeCore}; use reth_node_core::{ node_config::NodeConfig, rpc::{ @@ -376,7 +376,7 @@ where } /// Provides builder for the core `eth` API type. -pub trait EthApiBuilderProvider: BuilderProvider + EthApiTypes { +pub trait EthApiBuilderProvider: BuilderProvider + EthApiTypes { /// Returns the eth api builder. #[allow(clippy::type_complexity)] fn eth_api_builder() -> Box) -> Self + Send>; @@ -384,7 +384,7 @@ pub trait EthApiBuilderProvider: BuilderProvider + Eth impl EthApiBuilderProvider for F where - N: FullNodeComponents, + N: NodeCore, for<'a> F: BuilderProvider = &'a EthApiBuilderCtx> + EthApiTypes, { fn eth_api_builder() -> Box) -> Self + Send> { From 5c3f0605974c55fe5bc744902ac10bc45195c38e Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 17:30:43 +0200 Subject: [PATCH 04/21] Relax trait bounds for reth_node_api::BuilderProvider --- crates/node/api/src/node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index d0edb7a7b22e..d6fb3a75789d 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -171,7 +171,7 @@ impl NodeAddOns for () { } /// Returns the builder for type. -pub trait BuilderProvider: Send { +pub trait BuilderProvider: Send { /// Context required to build type. type Ctx<'a>; @@ -180,7 +180,7 @@ pub trait BuilderProvider: Send { fn builder() -> Box Fn(Self::Ctx<'a>) -> Self + Send>; } -impl BuilderProvider for () { +impl BuilderProvider for () { type Ctx<'a> = (); fn builder() -> Box Fn(Self::Ctx<'a>) -> Self + Send> { From 0d228c9bd48dbf9b30152df16bcbf632e1d9ae9b Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 17:31:51 +0200 Subject: [PATCH 05/21] Relax trait bounds for OpEthApi --- crates/node/builder/src/rpc.rs | 6 +++--- crates/optimism/rpc/src/eth/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 40d0247c8e91..141bca1f92bc 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -6,7 +6,7 @@ use std::{ }; use futures::TryFutureExt; -use reth_node_api::{BuilderProvider, FullNodeComponents, NodeCore}; +use reth_node_api::{BuilderProvider, FullNodeComponents}; use reth_node_core::{ node_config::NodeConfig, rpc::{ @@ -376,7 +376,7 @@ where } /// Provides builder for the core `eth` API type. -pub trait EthApiBuilderProvider: BuilderProvider + EthApiTypes { +pub trait EthApiBuilderProvider: BuilderProvider + EthApiTypes { /// Returns the eth api builder. #[allow(clippy::type_complexity)] fn eth_api_builder() -> Box) -> Self + Send>; @@ -384,7 +384,7 @@ pub trait EthApiBuilderProvider: BuilderProvider + EthApiTypes { impl EthApiBuilderProvider for F where - N: NodeCore, + N: FullNodeComponents, for<'a> F: BuilderProvider = &'a EthApiBuilderCtx> + EthApiTypes, { fn eth_api_builder() -> Box) -> Self + Send> { diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index f8a7fba6c163..6506c1a0aed3 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -260,7 +260,7 @@ where } } -impl fmt::Debug for OpEthApi { +impl fmt::Debug for OpEthApi { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OpEthApi").finish_non_exhaustive() } From 8a97ca63656bd75bbd979d986b91cfe782f08ad1 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 29 Aug 2024 17:36:07 +0200 Subject: [PATCH 06/21] Fix docs --- crates/node/builder/src/launch/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index 95c065044266..e0dd6968facd 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -48,7 +48,7 @@ use crate::{ AddOns, NodeBuilderWithComponents, NodeHandle, }; -/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`FullNodeComponents`]. +/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`NodeCore`]. pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< ::Provider, ::Pool, From 9593550b3b348d3b6199fcecc25bb8af4d4fd2a5 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Wed, 4 Sep 2024 16:20:59 +0200 Subject: [PATCH 07/21] Cargo update --- Cargo.lock | 85 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e3e9e3f97d0..e4b61f87d3a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76a2336889f3d0624b18213239d27f4f34eb476eb35bef22f6a8cc24e0c0078" +checksum = "396c07726030fa0f9dab5da8c71ccd69d5eb74a7fe1072b7ae453a67e4fe553e" dependencies = [ "alloy-primitives 0.8.0", "alloy-serde", @@ -756,9 +756,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd491aade72a82d51db430379f48a44a1d388ff03711a2023f1faa302c5b675d" +checksum = "398a977d774db13446b8cead8cfa9517aebf9e03fc8a1512892dc1e03e70bb04" dependencies = [ "alloy-primitives 0.8.0", "alloy-rlp", @@ -1086,9 +1086,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", @@ -1632,9 +1632,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" dependencies = [ "jobserver", "libc", @@ -3634,9 +3634,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", @@ -3644,7 +3644,7 @@ dependencies = [ "hyper-util", "log", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls", @@ -5048,9 +5048,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f024d4e0aebc67d887600f90b38ef5c410bce74561995abd79bcb2a8139a52eb" +checksum = "3b7fbb0f5c3754c22c6ea30e100dca6aea73b747e693e27763e23ca92fb02f2f" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5064,9 +5064,9 @@ dependencies = [ [[package]] name = "op-alloy-network" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90477039fba02e655363be5f034da3bbaea03404d6b3fc92cddaee278e3d64b" +checksum = "ff4d24313531c4a988f590da377491accd4a108711b44243ccd6615a3afb9c3f" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5079,9 +5079,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a8514b4b8571ef7202c6ad9de623e820952c6356285d928f64d4debbacdc09" +checksum = "b1fbb93dcb71aba9cd555784375011efce1fdaaea67e01972a0a9bc9eb90c626" dependencies = [ "alloy-network", "alloy-primitives 0.8.0", @@ -5094,9 +5094,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types-engine" -version = "0.2.2" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620e645c36cc66220909bf97e6632e7a154a2309356221cbf33ae78bf5294478" +checksum = "14716d1b1e82ca710de448f16efb62e29b2ed999f0ea0060801fd037666fabc7" dependencies = [ "alloy-primitives 0.8.0", "alloy-rpc-types-engine", @@ -5701,9 +5701,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "pin-project-lite", @@ -5719,9 +5719,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", @@ -5736,15 +5736,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5983,9 +5983,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "regress" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16fe0a24af5daaae947294213d2fd2646fbf5e1fbacc1d4ba3e84b2393854842" +checksum = "1541daf4e4ed43a0922b7969bdc2170178bcacc5dabf7e39bc508a9fa3953a7a" dependencies = [ "hashbrown 0.14.5", "memchr", @@ -6016,7 +6016,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-pemfile", "rustls-pki-types", "serde", @@ -8920,9 +8920,9 @@ dependencies = [ [[package]] name = "rlimit" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3560f70f30a0f16d11d01ed078a07740fe6b489667abc7c7b029155d9f21c3d8" +checksum = "7043b63bd0cd1aaa628e476b80e6d4023a3b50eb32789f2728908107bd0c793a" dependencies = [ "libc", ] @@ -9076,6 +9076,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -9104,7 +9117,7 @@ dependencies = [ "log", "once_cell", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki", "security-framework", @@ -9772,9 +9785,9 @@ dependencies = [ [[package]] name = "symbolic-common" -version = "12.10.1" +version = "12.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1944ea8afd197111bca0c0edea1e1f56abb3edd030e240c1035cc0e3ff51fec" +checksum = "9c1db5ac243c7d7f8439eb3b8f0357888b37cf3732957e91383b0ad61756374e" dependencies = [ "debugid", "memmap2", @@ -9784,9 +9797,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.10.1" +version = "12.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddaccaf1bf8e73c4f64f78dbb30aadd6965c71faa4ff3fba33f8d7296cf94a87" +checksum = "ea26e430c27d4a8a5dea4c4b81440606c7c1a415bd611451ef6af8c81416afc3" dependencies = [ "cpp_demangle", "rustc-demangle", From cf1ef10ebe329d1cfa6e625d6d70c3850ea47498 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Fri, 4 Oct 2024 19:17:15 +0200 Subject: [PATCH 08/21] Fix merge conflicts --- crates/node/api/src/node.rs | 23 ++++++++++------------- crates/node/builder/src/launch/mod.rs | 7 +++---- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index d915aafbf954..3df1d7b6115e 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -114,21 +114,18 @@ const fn noop_builder(_: ()) {} /// Helper trait to relax trait bounds on [`NodeTypes`], when defining types. pub trait NodeTy { - /// The node's primitive types, defining basic operations and structures. - type Primitives; - /// The node's engine types, defining the interaction with the consensus engine. - type Engine: Send + Sync + Clone + Unpin; - /// The type used for configuration of the EVM. - type ChainSpec: Send + Sync; + /// Node's types with the database. + type Types; + /// The provider type used to interact with the node. + type Provider; } impl NodeTy for T where - T: NodeTypesWithEngine + Clone, + T: FullNodeTypes, { - type Primitives = ::Primitives; - type Engine = ::Engine; - type ChainSpec = ::ChainSpec; + type Types = T::Types; + type Provider = T::Provider; } /// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when @@ -152,9 +149,9 @@ impl NodeCore for T where T: FullNodeComponents, { - type DB = ::DB; - type Provider = ::Provider; - type Pool = ::Pool; + type DB = ::DB; + type Provider = T::Provider; + type Pool = T::Pool; type Network = ::Network; type Evm = ::Evm; type Executor = ::Executor; diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index 1d4c5b9c2f0a..621a9d138e27 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -24,9 +24,7 @@ use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, use reth_engine_util::EngineMessageStreamExt; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider}; -use reth_node_api::{ - FullNodeComponents, FullNodeTypes, NodeAddOns, NodeCore, NodeTypesWithDB, NodeTypesWithEngine, -}; +use reth_node_api::{FullNodeTypes, NodeAddOns, NodeCore, NodeTypesWithDB, NodeTypesWithEngine}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, exit::NodeExitFuture, @@ -52,13 +50,14 @@ use crate::{ }; /// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`NodeCore`]. -pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< +pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< ::Provider, ::Pool, ::Evm, ::Network, TaskExecutor, ::Provider, + Eth, >; /// A general purpose trait that launches a new node of any kind. From 362f4099dac2f2c588383559f36ceb7fd912ada0 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 13:07:48 +0800 Subject: [PATCH 09/21] Fix merge conflicts --- crates/node/api/src/node.rs | 19 ------------------- crates/optimism/rpc/src/eth/mod.rs | 14 +------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index 821d33447b76..f7d21772870b 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -123,25 +123,6 @@ impl NodeAddOns for () { Ok(()) } } -/// Returns the builder for type. -pub trait BuilderProvider: Send { - /// Context required to build type. - type Ctx<'a>; - - /// Returns builder for type. - #[allow(clippy::type_complexity)] - fn builder() -> Box Fn(Self::Ctx<'a>) -> Self + Send>; -} - -impl BuilderProvider for () { - type Ctx<'a> = (); - - fn builder() -> Box Fn(Self::Ctx<'a>) -> Self + Send> { - Box::new(noop_builder) - } -} - -const fn noop_builder(_: ()) {} /// Helper trait to relax trait bounds on [`NodeTypes`], when defining types. pub trait NodeTy { diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index 9a27dcb5f4c2..d67107541758 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -17,7 +17,7 @@ use op_alloy_network::Optimism; use reth_chainspec::EthereumHardforks; use reth_evm::ConfigureEvm; use reth_network_api::NetworkInfo; -use reth_node_api::{FullNodeComponents, FullNodeTypes, NodeCore, NodeTypes}; +use reth_node_api::{FullNodeComponents, NodeCore, NodeTypes}; use reth_node_builder::EthApiBuilderCtx; use reth_primitives::Header; use reth_provider::{ @@ -249,18 +249,6 @@ where } } -impl BuilderProvider for OpEthApi -where - Self: Send, - N: FullNodeComponents, -{ - type Ctx<'a> = &'a EthApiBuilderCtx; - - fn builder() -> Box Fn(Self::Ctx<'a>) -> Self + Send> { - Box::new(Self::with_spawner) - } -} - impl fmt::Debug for OpEthApi { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OpEthApi").finish_non_exhaustive() From 45760bacde23728d50c151ae7f42e164337cd232 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 15:19:01 +0800 Subject: [PATCH 10/21] Add FullNodeComponents getters to NodeCore --- crates/node/api/src/node.rs | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index f7d21772870b..73ad69344a3b 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -155,6 +155,32 @@ pub trait NodeCore: NodeTy + Clone { type Executor: Send + Sync + Clone + Unpin; /// Network API. type Network: Send + Sync + Clone; + + /// Returns the transaction pool of the node. + fn pool(&self) -> &Self::Pool; + + /// Returns the node's evm config. + fn evm_config(&self) -> &Self::Evm; + + /// Returns the node's executor type. + fn block_executor(&self) -> &Self::Executor; + + /// Returns the node's consensus type. + fn consensus(&self) -> &Self::Consensus; + + /// Returns the handle to the network + fn network(&self) -> &Self::Network; + + /// Returns the handle to the payload builder service. + fn payload_builder( + &self, + ) -> &PayloadBuilderHandle<::Engine>; + + /// Returns the provider of the node. + fn provider(&self) -> &Self::Provider; + + /// Returns handle to runtime. + fn task_executor(&self) -> &TaskExecutor; } impl NodeCore for T @@ -167,4 +193,38 @@ where type Network = ::Network; type Evm = ::Evm; type Executor = ::Executor; + + fn pool(&self) -> &Self::Pool { + FullNodeComponents::pool(self) + } + + fn evm_config(&self) -> &Self::Evm { + FullNodeComponents::evm_config(self) + } + + fn block_executor(&self) -> &Self::Executor { + FullNodeComponents::block_executor(self) + } + + fn consensus(&self) -> &Self::Consensus { + FullNodeComponents::consensus(self) + } + + fn network(&self) -> &Self::Network { + FullNodeComponents::network(self) + } + + fn payload_builder( + &self, + ) -> &PayloadBuilderHandle<::Engine> { + FullNodeComponents::payload_builder(self) + } + + fn provider(&self) -> &Self::Provider { + FullNodeComponents::provider(self) + } + + fn task_executor(&self) -> &TaskExecutor { + FullNodeComponents::task_executor(self) + } } From 421b261ed083705ab600ba999ead09fe47d98aa9 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 15:32:00 +0800 Subject: [PATCH 11/21] Rescope NodeCore and NodeTy to RpcNodeCore and RpcNodeTy --- crates/node/api/src/node.rs | 49 +++------------------------ crates/node/builder/src/launch/mod.rs | 14 ++++---- crates/optimism/rpc/src/eth/mod.rs | 18 +++++----- 3 files changed, 21 insertions(+), 60 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index 73ad69344a3b..bdd18bc36bf5 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -125,34 +125,27 @@ impl NodeAddOns for () { } /// Helper trait to relax trait bounds on [`NodeTypes`], when defining types. -pub trait NodeTy { - /// Node's types with the database. - type Types; +pub trait RpcNodeTy { /// The provider type used to interact with the node. type Provider; } -impl NodeTy for T +impl RpcNodeTy for T where T: FullNodeTypes, { - type Types = T::Types; type Provider = T::Provider; } /// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when /// defining types. -pub trait NodeCore: NodeTy + Clone { - /// Underlying database type used by the node to store and retrieve data. - type DB: Send + Sync + Clone + Unpin; +pub trait RpcNodeCore: RpcNodeTy + Clone { /// The provider type used to interact with the node. type Provider: Send + Sync + Clone + Unpin; /// The transaction pool of the node. type Pool: Send + Sync + Clone + Unpin; /// The node's EVM configuration, defining settings for the Ethereum Virtual Machine. type Evm: Send + Sync + Clone + Unpin; - /// The type that knows how to execute blocks. - type Executor: Send + Sync + Clone + Unpin; /// Network API. type Network: Send + Sync + Clone; @@ -162,37 +155,21 @@ pub trait NodeCore: NodeTy + Clone { /// Returns the node's evm config. fn evm_config(&self) -> &Self::Evm; - /// Returns the node's executor type. - fn block_executor(&self) -> &Self::Executor; - - /// Returns the node's consensus type. - fn consensus(&self) -> &Self::Consensus; - /// Returns the handle to the network fn network(&self) -> &Self::Network; - /// Returns the handle to the payload builder service. - fn payload_builder( - &self, - ) -> &PayloadBuilderHandle<::Engine>; - /// Returns the provider of the node. fn provider(&self) -> &Self::Provider; - - /// Returns handle to runtime. - fn task_executor(&self) -> &TaskExecutor; } -impl NodeCore for T +impl RpcNodeCore for T where T: FullNodeComponents, { - type DB = ::DB; type Provider = T::Provider; type Pool = T::Pool; type Network = ::Network; type Evm = ::Evm; - type Executor = ::Executor; fn pool(&self) -> &Self::Pool { FullNodeComponents::pool(self) @@ -202,29 +179,11 @@ where FullNodeComponents::evm_config(self) } - fn block_executor(&self) -> &Self::Executor { - FullNodeComponents::block_executor(self) - } - - fn consensus(&self) -> &Self::Consensus { - FullNodeComponents::consensus(self) - } - fn network(&self) -> &Self::Network { FullNodeComponents::network(self) } - fn payload_builder( - &self, - ) -> &PayloadBuilderHandle<::Engine> { - FullNodeComponents::payload_builder(self) - } - fn provider(&self) -> &Self::Provider { FullNodeComponents::provider(self) } - - fn task_executor(&self) -> &TaskExecutor { - FullNodeComponents::task_executor(self) - } } diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index 29323c222af1..dd7750333db6 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -23,7 +23,9 @@ use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, use reth_engine_util::EngineMessageStreamExt; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider}; -use reth_node_api::{AddOnsContext, FullNodeTypes, NodeCore, NodeTypesWithDB, NodeTypesWithEngine}; +use reth_node_api::{ + AddOnsContext, FullNodeTypes, NodeTypesWithDB, NodeTypesWithEngine, RpcNodeCore, +}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, exit::NodeExitFuture, @@ -47,12 +49,12 @@ use crate::{ /// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`NodeCore`]. pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< - ::Provider, - ::Pool, - ::Evm, - ::Network, + ::Provider, + ::Pool, + ::Evm, + ::Network, TaskExecutor, - ::Provider, + ::Provider, >; /// A general purpose trait that launches a new node of any kind. diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index d67107541758..f87f1dd0d4e2 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -17,7 +17,7 @@ use op_alloy_network::Optimism; use reth_chainspec::EthereumHardforks; use reth_evm::ConfigureEvm; use reth_network_api::NetworkInfo; -use reth_node_api::{FullNodeComponents, NodeCore, NodeTypes}; +use reth_node_api::{FullNodeComponents, NodeTypes, RpcNodeCore}; use reth_node_builder::EthApiBuilderCtx; use reth_primitives::Header; use reth_provider::{ @@ -43,10 +43,10 @@ use crate::{OpEthApiError, OpTxBuilder, SequencerClient}; /// Adapter for [`EthApiInner`], which holds all the data required to serve core `eth_` API. pub type EthApiNodeBackend = EthApiInner< - ::Provider, - ::Pool, - ::Network, - ::Evm, + ::Provider, + ::Pool, + ::Network, + ::Evm, >; /// OP-Reth `Eth` API implementation. @@ -60,7 +60,7 @@ pub type EthApiNodeBackend = EthApiInner< /// This type implements the [`FullEthApi`](reth_rpc_eth_api::helpers::FullEthApi) by implemented /// all the `Eth` helper traits and prerequisite traits. #[derive(Clone, Deref)] -pub struct OpEthApi { +pub struct OpEthApi { /// Gateway to node's core components. #[deref] inner: Arc>, @@ -71,7 +71,7 @@ pub struct OpEthApi { impl OpEthApi where - N: NodeCore< + N: RpcNodeCore< Provider: BlockReaderIdExt + ChainSpecProvider + CanonStateSubscriptions + Clone + 'static, >, { @@ -103,7 +103,7 @@ where impl EthApiTypes for OpEthApi where Self: Send + Sync, - N: NodeCore, + N: RpcNodeCore, { type Error = OpEthApiError; type NetworkTypes = Optimism; @@ -249,7 +249,7 @@ where } } -impl fmt::Debug for OpEthApi { +impl fmt::Debug for OpEthApi { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OpEthApi").finish_non_exhaustive() } From 1ff6f2d0a60137fd5c69f5f62707bcddd83dedac Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 15:46:10 +0800 Subject: [PATCH 12/21] Remove RpcNodeTy to remove unambiguous AT for provider --- crates/node/api/src/node.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index bdd18bc36bf5..840068908a2f 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -124,22 +124,9 @@ impl NodeAddOns for () { } } -/// Helper trait to relax trait bounds on [`NodeTypes`], when defining types. -pub trait RpcNodeTy { - /// The provider type used to interact with the node. - type Provider; -} - -impl RpcNodeTy for T -where - T: FullNodeTypes, -{ - type Provider = T::Provider; -} - /// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when /// defining types. -pub trait RpcNodeCore: RpcNodeTy + Clone { +pub trait RpcNodeCore: Clone { /// The provider type used to interact with the node. type Provider: Send + Sync + Clone + Unpin; /// The transaction pool of the node. From 209fd9adedac72a0d56bb81ebe9269184bef7619 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 22:57:43 +0800 Subject: [PATCH 13/21] Move reth_node_api::RpcNodeCore into reth-rpc-eth-api by removing cyclical deps --- Cargo.lock | 319 +++++++++++++------------- crates/e2e-test-utils/src/rpc.rs | 7 +- crates/ethereum/node/tests/e2e/dev.rs | 2 +- crates/node/api/Cargo.toml | 1 - crates/node/api/src/lib.rs | 2 - crates/node/api/src/node.rs | 51 ---- crates/node/builder/src/launch/mod.rs | 5 +- crates/node/builder/src/node.rs | 2 +- crates/node/builder/src/rpc.rs | 6 +- crates/node/core/Cargo.toml | 2 - crates/node/core/src/lib.rs | 9 - crates/optimism/rpc/src/eth/mod.rs | 15 +- crates/rpc/rpc-eth-api/Cargo.toml | 1 + crates/rpc/rpc-eth-api/src/lib.rs | 2 + crates/rpc/rpc-eth-api/src/node.rs | 54 +++++ crates/rpc/rpc/Cargo.toml | 1 - crates/rpc/rpc/src/eth/filter.rs | 5 +- crates/rpc/rpc/src/eth/mod.rs | 2 +- 18 files changed, 237 insertions(+), 249 deletions(-) create mode 100644 crates/rpc/rpc-eth-api/src/node.rs diff --git a/Cargo.lock b/Cargo.lock index 3449e381f98f..fbd6233095f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,9 +130,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6228abfc751a29cde117b0879b805a3e0b3b641358f063272c83ca459a56886" +checksum = "5647fce5a168f9630f935bf7821c4207b1755184edaeba783cb4e11d35058484" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -209,9 +209,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d46eb5871592c216d39192499c95a99f7175cb94104f88c307e6dc960676d9f1" +checksum = "4b5671117c38b1c2306891f97ad3828d85487087f54ebe2c7591a055ea5bcea7" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -256,9 +256,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a968c063fcfcb937736665c865a71fc2242b68916156f5ffa41fee7b44bb695" +checksum = "514f70ee2a953db21631cd817b13a1571474ec77ddc03d47616d5e8203489fde" dependencies = [ "alloy-consensus", "alloy-eips", @@ -378,9 +378,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -389,13 +389,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -619,7 +619,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -635,7 +635,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "syn-solidity", "tiny-keccak", ] @@ -651,15 +651,15 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f631f0bd9a9d79619b27c91b6b1ab2c4ef4e606a65192369a1ee05d40dcf81cc" +checksum = "45d1fbee9e698f3ba176b6e7a145f4aefe6d2b746b611e8bb246fe11a0e9f6c4" dependencies = [ "serde", "winnow", @@ -667,9 +667,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2841af22d99e2c0f82a78fe107b6481be3dd20b89bfb067290092794734343a" +checksum = "086f41bc6ebcd8cb15f38ba20e47be38dd03692149681ce8061c35d960dbf850" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -842,9 +842,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "aquamarine" @@ -857,7 +857,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1033,9 +1033,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "brotli", "flate2", @@ -1080,7 +1080,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1091,7 +1091,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1129,7 +1129,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1235,7 +1235,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1417,7 +1417,7 @@ checksum = "240f4126219a83519bad05c9a40bfc0303921eeb571fc2d7e44c17ffac99d3f1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "synstructure", ] @@ -1539,7 +1539,7 @@ checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -1550,9 +1550,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -1751,7 +1751,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2208,7 +2208,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2232,7 +2232,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2243,7 +2243,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2365,7 +2365,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2376,7 +2376,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2397,7 +2397,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "unicode-xid", ] @@ -2511,7 +2511,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2659,7 +2659,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2670,7 +2670,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -2727,7 +2727,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -3282,7 +3282,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -3808,7 +3808,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -3958,7 +3958,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -4126,7 +4126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" dependencies = [ "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -4374,7 +4374,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -4783,6 +4783,16 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "metrics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae428771d17306715c5091d446327d1cfdedc82185c65ba8423ab404e45bf10" +dependencies = [ + "ahash", + "portable-atomic", +] + [[package]] name = "metrics-derive" version = "0.1.0" @@ -4792,7 +4802,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -4803,7 +4813,7 @@ checksum = "b4f0c8427b39666bf970460908b213ec09b3b350f20c0c2eabcbba51704a08e6" dependencies = [ "base64 0.22.1", "indexmap 2.6.0", - "metrics", + "metrics 0.23.0", "metrics-util", "quanta", "thiserror", @@ -4811,14 +4821,14 @@ dependencies = [ [[package]] name = "metrics-process" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69e6ced169644e186e060ddc15f3923fdf06862c811a867bb1e5e7c7824f4d0" +checksum = "57ca8ecd85575fbb143b2678cb123bb818779391ec0f745b1c4a9dbabadde407" dependencies = [ "libc", "libproc", "mach2", - "metrics", + "metrics 0.24.0", "once_cell", "procfs 0.17.0", "rlimit", @@ -4834,7 +4844,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "hashbrown 0.14.5", - "metrics", + "metrics 0.23.0", "num_cpus", "quanta", "sketches-ddsketch", @@ -4939,7 +4949,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -4984,7 +4994,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.8.0", + "unsigned-varint", "url", ] @@ -5001,12 +5011,12 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" dependencies = [ "core2", - "unsigned-varint 0.7.2", + "unsigned-varint", ] [[package]] @@ -5187,7 +5197,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -5240,9 +5250,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d49163f952491820088dd0e66f3a35d63337c3066eceff0a931bf83a8e2101" +checksum = "ba7c98055fd048073738df0cc6d6537e992a0d8828f39d99a469e870db126dbd" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5258,9 +5268,9 @@ dependencies = [ [[package]] name = "op-alloy-genesis" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e46c2ab105f679f0cbfbc3fb762f3456d4b8556c841e667fc8f3c2226eb6c1e" +checksum = "d631e8113cf88d30e621022677209caa148a9ca3ccb590fd34bbd1c731e3aff3" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5272,9 +5282,9 @@ dependencies = [ [[package]] name = "op-alloy-network" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ff1ea317441b9eb6317b24d13f9088e3b14ef48b15bfb6a125ca404df036d8" +checksum = "1eabe7683d7e19c7cc5171d664e49fc449176cf1334ffff82808e2a7eea5933a" dependencies = [ "alloy-consensus", "alloy-network", @@ -5286,9 +5296,9 @@ dependencies = [ [[package]] name = "op-alloy-protocol" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c439457b2a1791325603fc18a94cc175e0b4b1127f11ff8a45071f05d044dcb" +checksum = "9b39574acb1873315e6bd89df174f6223e897188fb87eeea2ad1eda04f7d28eb" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5303,9 +5313,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9556293835232b019ec9c6fd84e4265a3151111af60ea09b5b513e3dbed41c" +checksum = "919e9b69212d61f3c8932bfb717c7ad458ea3fc52072b3433d99994f8223d555" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5321,9 +5331,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types-engine" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a42a5ac4e07ed226b6a2aeefaad9b2cc7ec160e372ba626a4214d681a355fc2" +checksum = "0e3a47ea24cee189b4351be247fd138c68571704ee57060cf5a722502f44412c" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", @@ -5541,7 +5551,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -5555,29 +5565,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -5737,12 +5747,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904afd36257cdb6ce0bee88b7981847bd7b955e5e216bb32f466b302923ad446" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -5793,14 +5803,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -5891,7 +5901,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -6375,7 +6385,7 @@ dependencies = [ "alloy-rlp", "futures-core", "futures-util", - "metrics", + "metrics 0.23.0", "reth-chainspec", "reth-evm", "reth-metrics", @@ -6401,7 +6411,7 @@ dependencies = [ "assert_matches", "futures", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "reth-blockchain-tree", "reth-blockchain-tree-api", "reth-chainspec", @@ -6488,7 +6498,7 @@ dependencies = [ "aquamarine", "assert_matches", "linked_hash_set", - "metrics", + "metrics 0.23.0", "parking_lot", "reth-blockchain-tree-api", "reth-chainspec", @@ -6538,7 +6548,7 @@ dependencies = [ "alloy-signer-local", "auto_impl", "derive_more 1.0.0", - "metrics", + "metrics 0.23.0", "parking_lot", "pin-project", "rand 0.8.5", @@ -6706,7 +6716,7 @@ dependencies = [ "proc-macro2", "quote", "similar-asserts", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -6787,7 +6797,7 @@ dependencies = [ "derive_more 1.0.0", "eyre", "iai-callgrind", - "metrics", + "metrics 0.23.0", "page_size", "parking_lot", "paste", @@ -6824,7 +6834,7 @@ dependencies = [ "arbitrary", "bytes", "derive_more 1.0.0", - "metrics", + "metrics 0.23.0", "modular-bitfield", "parity-scale-codec", "proptest", @@ -6924,7 +6934,7 @@ dependencies = [ "enr", "futures", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "rand 0.8.5", "reth-chainspec", "reth-ethereum-forks", @@ -6976,7 +6986,7 @@ dependencies = [ "futures", "futures-util", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "pin-project", "rand 0.8.5", "rayon", @@ -7147,7 +7157,7 @@ dependencies = [ "alloy-rpc-types-engine", "assert_matches", "futures", - "metrics", + "metrics 0.23.0", "reth-beacon-consensus", "reth-blockchain-tree", "reth-blockchain-tree-api", @@ -7394,7 +7404,7 @@ dependencies = [ "alloy-primitives", "auto_impl", "futures-util", - "metrics", + "metrics 0.23.0", "parking_lot", "reth-chainspec", "reth-consensus", @@ -7478,7 +7488,7 @@ dependencies = [ "eyre", "futures", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "parking_lot", "rand 0.8.5", "reth-blockchain-tree", @@ -7647,7 +7657,7 @@ name = "reth-metrics" version = "1.1.0" dependencies = [ "futures", - "metrics", + "metrics 0.23.0", "metrics-derive", "tokio", "tokio-util", @@ -7692,7 +7702,7 @@ dependencies = [ "enr", "futures", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "parking_lot", "pin-project", "pprof", @@ -7840,7 +7850,6 @@ dependencies = [ "reth-payload-primitives", "reth-primitives", "reth-provider", - "reth-rpc-eth-api", "reth-tasks", "reth-transaction-pool", ] @@ -7940,8 +7949,6 @@ dependencies = [ "reth-network-peers", "reth-primitives", "reth-prune-types", - "reth-rpc-api", - "reth-rpc-eth-api", "reth-rpc-eth-types", "reth-rpc-server-types", "reth-rpc-types-compat", @@ -8032,7 +8039,7 @@ dependencies = [ "eyre", "http", "jsonrpsee", - "metrics", + "metrics 0.23.0", "metrics-exporter-prometheus", "metrics-process", "metrics-util", @@ -8325,7 +8332,7 @@ dependencies = [ "alloy-rpc-types", "async-trait", "futures-util", - "metrics", + "metrics 0.23.0", "reth-chain-state", "reth-ethereum-engine-primitives", "reth-metrics", @@ -8454,7 +8461,7 @@ dependencies = [ "dashmap 6.1.0", "eyre", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "notify", "parking_lot", "rand 0.8.5", @@ -8497,7 +8504,7 @@ dependencies = [ "alloy-primitives", "assert_matches", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "rayon", "reth-chainspec", "reth-config", @@ -8597,7 +8604,6 @@ dependencies = [ "reth-network-api", "reth-network-peers", "reth-network-types", - "reth-node-api", "reth-primitives", "reth-provider", "reth-revm", @@ -8682,7 +8688,7 @@ dependencies = [ "clap", "http", "jsonrpsee", - "metrics", + "metrics 0.23.0", "pin-project", "reth-beacon-consensus", "reth-chainspec", @@ -8730,7 +8736,7 @@ dependencies = [ "async-trait", "jsonrpsee-core", "jsonrpsee-types", - "metrics", + "metrics 0.23.0", "reth-beacon-consensus", "reth-chainspec", "reth-engine-primitives", @@ -8779,6 +8785,7 @@ dependencies = [ "reth-evm", "reth-execution-types", "reth-network-api", + "reth-node-api", "reth-primitives", "reth-provider", "reth-revm", @@ -8811,7 +8818,7 @@ dependencies = [ "itertools 0.13.0", "jsonrpsee-core", "jsonrpsee-types", - "metrics", + "metrics 0.23.0", "rand 0.8.5", "reth-chain-state", "reth-chainspec", @@ -8945,7 +8952,7 @@ dependencies = [ "assert_matches", "auto_impl", "futures-util", - "metrics", + "metrics 0.23.0", "reth-consensus", "reth-errors", "reth-metrics", @@ -9052,7 +9059,7 @@ dependencies = [ "auto_impl", "dyn-clone", "futures-util", - "metrics", + "metrics 0.23.0", "pin-project", "rayon", "reth-metrics", @@ -9112,7 +9119,7 @@ dependencies = [ "bitflags 2.6.0", "criterion", "futures-util", - "metrics", + "metrics 0.23.0", "parking_lot", "paste", "pprof", @@ -9154,7 +9161,7 @@ dependencies = [ "bincode", "criterion", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "proptest", "proptest-arbitrary-interop", "rayon", @@ -9204,7 +9211,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "derive_more 1.0.0", - "metrics", + "metrics 0.23.0", "proptest", "proptest-arbitrary-interop", "reth-chainspec", @@ -9234,7 +9241,7 @@ dependencies = [ "criterion", "derive_more 1.0.0", "itertools 0.13.0", - "metrics", + "metrics 0.23.0", "proptest", "proptest-arbitrary-interop", "rand 0.8.5", @@ -9273,9 +9280,9 @@ dependencies = [ [[package]] name = "revm" -version = "17.0.0" +version = "17.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eab16cb0a8cd5ac88b11230b20df588b7e8aae7dfab4b3f830e98aebeb4b365" +checksum = "055bee6a81aaeee8c2389ae31f0d4de87f44df24f4444a1116f9755fd87a76ad" dependencies = [ "auto_impl", "cfg-if", @@ -9838,22 +9845,22 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -9888,7 +9895,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -9939,7 +9946,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -9962,7 +9969,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10248,7 +10255,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10306,9 +10313,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.80" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e185e337f816bc8da115b8afcb3324006ccc82eeaddf35113888d3bd8e44ac" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -10324,7 +10331,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10350,7 +10357,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10427,7 +10434,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10451,22 +10458,22 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10619,9 +10626,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -10643,7 +10650,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -10844,7 +10851,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11144,12 +11151,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsigned-varint" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" - [[package]] name = "unsigned-varint" version = "0.8.0" @@ -11301,7 +11302,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -11335,7 +11336,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -11491,7 +11492,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11502,7 +11503,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11513,7 +11514,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11524,7 +11525,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11799,7 +11800,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "synstructure", ] @@ -11821,7 +11822,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11841,7 +11842,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", "synstructure", ] @@ -11862,7 +11863,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] @@ -11884,7 +11885,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.80", + "syn 2.0.85", ] [[package]] diff --git a/crates/e2e-test-utils/src/rpc.rs b/crates/e2e-test-utils/src/rpc.rs index b8cbe4d77add..7b7dabdf2404 100644 --- a/crates/e2e-test-utils/src/rpc.rs +++ b/crates/e2e-test-utils/src/rpc.rs @@ -4,12 +4,15 @@ use alloy_primitives::{Bytes, B256}; use reth::{ builder::{rpc::RpcRegistry, FullNodeComponents}, rpc::api::{ - eth::helpers::{EthApiSpec, EthTransactions, TraceExt}, + eth::{ + helpers::{EthApiSpec, EthTransactions, TraceExt}, + EthApiTypes, + }, DebugApiServer, }, }; use reth_chainspec::EthereumHardforks; -use reth_node_builder::{EthApiTypes, NodeTypes}; +use reth_node_builder::NodeTypes; #[allow(missing_debug_implementations)] pub struct RpcTestContext { diff --git a/crates/ethereum/node/tests/e2e/dev.rs b/crates/ethereum/node/tests/e2e/dev.rs index cad2fb34e5de..c683ed5a9b91 100644 --- a/crates/ethereum/node/tests/e2e/dev.rs +++ b/crates/ethereum/node/tests/e2e/dev.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use alloy_genesis::Genesis; use alloy_primitives::{b256, hex}; use futures::StreamExt; -use reth::{args::DevArgs, core::rpc::eth::helpers::EthTransactions}; +use reth::{args::DevArgs, rpc::api::eth::helpers::EthTransactions}; use reth_chainspec::ChainSpec; use reth_e2e_test_utils::setup; use reth_node_api::FullNodeComponents; diff --git a/crates/node/api/Cargo.toml b/crates/node/api/Cargo.toml index c2c3eb46326b..6b263d6c532b 100644 --- a/crates/node/api/Cargo.toml +++ b/crates/node/api/Cargo.toml @@ -21,7 +21,6 @@ reth-transaction-pool.workspace = true reth-payload-builder.workspace = true reth-payload-primitives.workspace = true reth-tasks.workspace = true -reth-rpc-eth-api.workspace = true reth-network-api.workspace = true reth-node-types.workspace = true reth-primitives.workspace = true diff --git a/crates/node/api/src/lib.rs b/crates/node/api/src/lib.rs index 7692ed6f2cae..099cf82b5fe0 100644 --- a/crates/node/api/src/lib.rs +++ b/crates/node/api/src/lib.rs @@ -25,5 +25,3 @@ pub use node::*; // re-export for convenience pub use reth_node_types::*; pub use reth_provider::FullProvider; - -pub use reth_rpc_eth_api::EthApiTypes; diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index 840068908a2f..3173fd2b3985 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -123,54 +123,3 @@ impl NodeAddOns for () { Ok(()) } } - -/// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when -/// defining types. -pub trait RpcNodeCore: Clone { - /// The provider type used to interact with the node. - type Provider: Send + Sync + Clone + Unpin; - /// The transaction pool of the node. - type Pool: Send + Sync + Clone + Unpin; - /// The node's EVM configuration, defining settings for the Ethereum Virtual Machine. - type Evm: Send + Sync + Clone + Unpin; - /// Network API. - type Network: Send + Sync + Clone; - - /// Returns the transaction pool of the node. - fn pool(&self) -> &Self::Pool; - - /// Returns the node's evm config. - fn evm_config(&self) -> &Self::Evm; - - /// Returns the handle to the network - fn network(&self) -> &Self::Network; - - /// Returns the provider of the node. - fn provider(&self) -> &Self::Provider; -} - -impl RpcNodeCore for T -where - T: FullNodeComponents, -{ - type Provider = T::Provider; - type Pool = T::Pool; - type Network = ::Network; - type Evm = ::Evm; - - fn pool(&self) -> &Self::Pool { - FullNodeComponents::pool(self) - } - - fn evm_config(&self) -> &Self::Evm { - FullNodeComponents::evm_config(self) - } - - fn network(&self) -> &Self::Network { - FullNodeComponents::network(self) - } - - fn provider(&self) -> &Self::Provider { - FullNodeComponents::provider(self) - } -} diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index dd7750333db6..e71f995f19b8 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -23,15 +23,14 @@ use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider, use reth_engine_util::EngineMessageStreamExt; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider}; -use reth_node_api::{ - AddOnsContext, FullNodeTypes, NodeTypesWithDB, NodeTypesWithEngine, RpcNodeCore, -}; +use reth_node_api::{AddOnsContext, FullNodeTypes, NodeTypesWithDB, NodeTypesWithEngine}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, exit::NodeExitFuture, }; use reth_node_events::{cl::ConsensusLayerHealthEvents, node}; use reth_provider::providers::BlockchainProvider; +use reth_rpc::eth::RpcNodeCore; use reth_tasks::TaskExecutor; use reth_tracing::tracing::{debug, info}; use reth_transaction_pool::TransactionPool; diff --git a/crates/node/builder/src/node.rs b/crates/node/builder/src/node.rs index 3e3d5b696c39..3b2f467d61c0 100644 --- a/crates/node/builder/src/node.rs +++ b/crates/node/builder/src/node.rs @@ -11,10 +11,10 @@ use reth_node_api::{EngineTypes, FullNodeComponents}; use reth_node_core::{ dirs::{ChainPath, DataDirPath}, node_config::NodeConfig, - rpc::api::EngineApiClient, }; use reth_payload_builder::PayloadBuilderHandle; use reth_provider::ChainSpecProvider; +use reth_rpc_api::EngineApiClient; use reth_rpc_builder::{auth::AuthServerHandle, RpcServerHandle}; use reth_tasks::TaskExecutor; diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 18293118dc66..4c1ea32d045d 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -14,12 +14,14 @@ use reth_node_api::{ }; use reth_node_core::{ node_config::NodeConfig, - rpc::eth::{EthApiTypes, FullEthApiServer}, version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA}, }; use reth_payload_builder::PayloadBuilderHandle; use reth_provider::providers::ProviderNodeTypes; -use reth_rpc::EthApi; +use reth_rpc::{ + eth::{EthApiTypes, FullEthApiServer}, + EthApi, +}; use reth_rpc_api::eth::helpers::AddDevSigners; use reth_rpc_builder::{ auth::{AuthRpcModule, AuthServerHandle}, diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index 0c9672d17779..cae5a4979605 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -23,8 +23,6 @@ reth-network-p2p.workspace = true reth-rpc-eth-types.workspace = true reth-rpc-server-types.workspace = true reth-rpc-types-compat.workspace = true -reth-rpc-api = { workspace = true, features = ["client"] } -reth-rpc-eth-api = { workspace = true, features = ["client"] } reth-transaction-pool.workspace = true reth-tracing.workspace = true reth-config.workspace = true diff --git a/crates/node/core/src/lib.rs b/crates/node/core/src/lib.rs index 6af822e22eeb..a69a255a3c67 100644 --- a/crates/node/core/src/lib.rs +++ b/crates/node/core/src/lib.rs @@ -22,15 +22,6 @@ pub mod primitives { /// Re-export of `reth_rpc_*` crates. pub mod rpc { - /// Re-exported from `reth_rpc_api`. - pub mod api { - pub use reth_rpc_api::*; - } - /// Re-exported from `reth_rpc::eth`. - pub mod eth { - pub use reth_rpc_eth_api::*; - } - /// Re-exported from `reth_rpc::rpc`. pub mod result { pub use reth_rpc_server_types::result::*; diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index f4d11dcdf10e..a1a9f6e8f04f 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -17,7 +17,7 @@ use op_alloy_network::Optimism; use reth_chainspec::EthereumHardforks; use reth_evm::ConfigureEvm; use reth_network_api::NetworkInfo; -use reth_node_api::{FullNodeComponents, NodeTypes, RpcNodeCore}; +use reth_node_api::{FullNodeComponents, NodeTypes}; use reth_node_builder::EthApiBuilderCtx; use reth_primitives::Header; use reth_provider::{ @@ -30,7 +30,7 @@ use reth_rpc_eth_api::{ AddDevSigners, EthApiSpec, EthFees, EthSigner, EthState, LoadBlock, LoadFee, LoadState, SpawnBlocking, Trace, }, - EthApiTypes, + EthApiTypes, RpcNodeCore, }; use reth_rpc_eth_types::{EthStateCache, FeeHistoryCache, GasPriceOracle}; use reth_tasks::{ @@ -59,7 +59,7 @@ pub type EthApiNodeBackend = EthApiInner< /// /// This type implements the [`FullEthApi`](reth_rpc_eth_api::helpers::FullEthApi) by implemented /// all the `Eth` helper traits and prerequisite traits. -#[derive(Deref)] +#[derive(Deref, Clone)] pub struct OpEthApi { /// Gateway to node's core components. #[deref] @@ -258,12 +258,3 @@ impl fmt::Debug for OpEthApi { f.debug_struct("OpEthApi").finish_non_exhaustive() } } - -impl Clone for OpEthApi -where - N: FullNodeComponents, -{ - fn clone(&self) -> Self { - Self { inner: self.inner.clone(), sequencer_client: self.sequencer_client.clone() } - } -} diff --git a/crates/rpc/rpc-eth-api/Cargo.toml b/crates/rpc/rpc-eth-api/Cargo.toml index 9d0f6cfd83d6..edfd57b201d9 100644 --- a/crates/rpc/rpc-eth-api/Cargo.toml +++ b/crates/rpc/rpc-eth-api/Cargo.toml @@ -30,6 +30,7 @@ reth-rpc-eth-types.workspace = true reth-rpc-server-types.workspace = true reth-network-api.workspace = true reth-trie.workspace = true +reth-node-api.workspace = true # ethereum alloy-eips.workspace = true diff --git a/crates/rpc/rpc-eth-api/src/lib.rs b/crates/rpc/rpc-eth-api/src/lib.rs index 849c8e2e4c8f..bc46d526c6f0 100644 --- a/crates/rpc/rpc-eth-api/src/lib.rs +++ b/crates/rpc/rpc-eth-api/src/lib.rs @@ -16,6 +16,7 @@ pub mod bundle; pub mod core; pub mod filter; pub mod helpers; +pub mod node; pub mod pubsub; pub mod types; @@ -25,6 +26,7 @@ pub use bundle::{EthBundleApiServer, EthCallBundleApiServer}; pub use core::{EthApiServer, FullEthApiServer}; pub use filter::EthFilterApiServer; pub use helpers::error::{AsEthApiError, FromEthApiError, FromEvmError, IntoEthApiError}; +pub use node::RpcNodeCore; pub use pubsub::EthPubSubApiServer; pub use types::{EthApiTypes, FullEthApiTypes, RpcBlock, RpcReceipt, RpcTransaction}; diff --git a/crates/rpc/rpc-eth-api/src/node.rs b/crates/rpc/rpc-eth-api/src/node.rs new file mode 100644 index 000000000000..ef5034d337bd --- /dev/null +++ b/crates/rpc/rpc-eth-api/src/node.rs @@ -0,0 +1,54 @@ +//! Helper trait for interfacing with [`FullNodeComponents`]. + +use reth_node_api::FullNodeComponents; + +/// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when +/// defining types. +pub trait RpcNodeCore: Clone { + /// The provider type used to interact with the node. + type Provider: Send + Sync + Clone + Unpin; + /// The transaction pool of the node. + type Pool: Send + Sync + Clone + Unpin; + /// The node's EVM configuration, defining settings for the Ethereum Virtual Machine. + type Evm: Send + Sync + Clone + Unpin; + /// Network API. + type Network: Send + Sync + Clone; + + /// Returns the transaction pool of the node. + fn pool(&self) -> &Self::Pool; + + /// Returns the node's evm config. + fn evm_config(&self) -> &Self::Evm; + + /// Returns the handle to the network + fn network(&self) -> &Self::Network; + + /// Returns the provider of the node. + fn provider(&self) -> &Self::Provider; +} + +impl RpcNodeCore for T +where + T: FullNodeComponents, +{ + type Provider = T::Provider; + type Pool = T::Pool; + type Network = ::Network; + type Evm = ::Evm; + + fn pool(&self) -> &Self::Pool { + FullNodeComponents::pool(self) + } + + fn evm_config(&self) -> &Self::Evm { + FullNodeComponents::evm_config(self) + } + + fn network(&self) -> &Self::Network { + FullNodeComponents::network(self) + } + + fn provider(&self) -> &Self::Provider { + FullNodeComponents::provider(self) + } +} diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml index fe150e36eed5..dab86ac25872 100644 --- a/crates/rpc/rpc/Cargo.toml +++ b/crates/rpc/rpc/Cargo.toml @@ -31,7 +31,6 @@ reth-network-peers = { workspace = true, features = ["secp256k1"] } reth-evm.workspace = true reth-rpc-eth-types.workspace = true reth-rpc-server-types.workspace = true -reth-node-api.workspace = true reth-network-types.workspace = true reth-trie.workspace = true diff --git a/crates/rpc/rpc/src/eth/filter.rs b/crates/rpc/rpc/src/eth/filter.rs index 24058da1734c..5ef224609c5b 100644 --- a/crates/rpc/rpc/src/eth/filter.rs +++ b/crates/rpc/rpc/src/eth/filter.rs @@ -17,10 +17,11 @@ use alloy_rpc_types::{ use async_trait::async_trait; use jsonrpsee::{core::RpcResult, server::IdProvider}; use reth_chainspec::ChainInfo; -use reth_node_api::EthApiTypes; use reth_primitives::{Receipt, SealedBlockWithSenders, TransactionSignedEcRecovered}; use reth_provider::{BlockIdReader, BlockReader, EvmEnvProvider, ProviderError}; -use reth_rpc_eth_api::{EthFilterApiServer, FullEthApiTypes, RpcTransaction, TransactionCompat}; +use reth_rpc_eth_api::{ + EthApiTypes, EthFilterApiServer, FullEthApiTypes, RpcTransaction, TransactionCompat, +}; use reth_rpc_eth_types::{ logs_utils::{self, append_matching_block_logs, ProviderOrBlock}, EthApiError, EthFilterConfig, EthStateCache, EthSubscriptionIdProvider, diff --git a/crates/rpc/rpc/src/eth/mod.rs b/crates/rpc/rpc/src/eth/mod.rs index 99919110da7b..4d1833add3e7 100644 --- a/crates/rpc/rpc/src/eth/mod.rs +++ b/crates/rpc/rpc/src/eth/mod.rs @@ -15,4 +15,4 @@ pub use pubsub::EthPubSub; pub use helpers::{signer::DevSigner, types::EthTxBuilder}; -pub use reth_rpc_eth_api::EthApiServer; +pub use reth_rpc_eth_api::{EthApiServer, EthApiTypes, FullEthApiServer, RpcNodeCore}; From 2c2eb4d14ccdd727f85076fa1c20c995f63d0137 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 22:59:45 +0800 Subject: [PATCH 14/21] Add RpcNodeCore as super trait of EthApiSpec --- crates/optimism/rpc/src/eth/mod.rs | 41 ++++++++++++++++------ crates/rpc/rpc-eth-api/src/helpers/spec.rs | 20 +++++------ crates/rpc/rpc/src/eth/core.rs | 31 +++++++++++++++- crates/rpc/rpc/src/eth/helpers/spec.rs | 14 ++------ 4 files changed, 72 insertions(+), 34 deletions(-) diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index a1a9f6e8f04f..ccff477892f2 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -114,24 +114,43 @@ where } } -impl EthApiSpec for OpEthApi +impl RpcNodeCore for OpEthApi where - Self: Send + Sync, - N: FullNodeComponents>, + Self: Clone, + N: RpcNodeCore, { - #[inline] - fn provider( - &self, - ) -> impl ChainSpecProvider + BlockNumReader + StageCheckpointReader - { - self.inner.provider() + type Provider = N::Provider; + type Pool = N::Pool; + type Network = ::Network; + type Evm = ::Evm; + + fn pool(&self) -> &Self::Pool { + self.inner.pool() } - #[inline] - fn network(&self) -> impl NetworkInfo { + fn evm_config(&self) -> &Self::Evm { + self.inner.evm_config() + } + + fn network(&self) -> &Self::Network { self.inner.network() } + fn provider(&self) -> &Self::Provider { + self.inner.provider() + } +} + +impl EthApiSpec for OpEthApi +where + Self: Send + Sync, + N: RpcNodeCore< + Provider: ChainSpecProvider + + BlockNumReader + + StageCheckpointReader, + Network: NetworkInfo, + >, +{ #[inline] fn starting_block(&self) -> U256 { self.inner.starting_block() diff --git a/crates/rpc/rpc-eth-api/src/helpers/spec.rs b/crates/rpc/rpc-eth-api/src/helpers/spec.rs index 5976cf29c07d..5aa0509e8bbe 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/spec.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/spec.rs @@ -8,21 +8,21 @@ use reth_errors::{RethError, RethResult}; use reth_network_api::NetworkInfo; use reth_provider::{BlockNumReader, ChainSpecProvider, StageCheckpointReader}; -use super::EthSigner; +use crate::{helpers::EthSigner, RpcNodeCore}; /// `Eth` API trait. /// /// Defines core functionality of the `eth` API implementation. #[auto_impl::auto_impl(&, Arc)] -pub trait EthApiSpec: Send + Sync { - /// Returns a handle for reading data from disk. - fn provider( - &self, - ) -> impl ChainSpecProvider + BlockNumReader + StageCheckpointReader; - - /// Returns a handle for reading network data summary. - fn network(&self) -> impl NetworkInfo; - +pub trait EthApiSpec: + RpcNodeCore< + Provider: ChainSpecProvider + + BlockNumReader + + StageCheckpointReader, + Network: NetworkInfo, + > + Send + + Sync +{ /// Returns the block node is started on. fn starting_block(&self) -> U256; diff --git a/crates/rpc/rpc/src/eth/core.rs b/crates/rpc/rpc/src/eth/core.rs index 21787873e966..3fca76e8b0cc 100644 --- a/crates/rpc/rpc/src/eth/core.rs +++ b/crates/rpc/rpc/src/eth/core.rs @@ -10,7 +10,7 @@ use reth_primitives::BlockNumberOrTag; use reth_provider::{BlockReaderIdExt, CanonStateSubscriptions, ChainSpecProvider}; use reth_rpc_eth_api::{ helpers::{EthSigner, SpawnBlocking}, - EthApiTypes, + EthApiTypes, RpcNodeCore, }; use reth_rpc_eth_types::{ EthApiBuilderCtx, EthApiError, EthStateCache, FeeHistoryCache, GasCap, GasPriceOracle, @@ -140,6 +140,35 @@ where } } +impl RpcNodeCore for EthApi +where + Provider: Send + Sync + Clone + Unpin, + Pool: Send + Sync + Clone + Unpin, + Network: Send + Sync + Clone, + EvmConfig: Send + Sync + Clone + Unpin, +{ + type Provider = Provider; + type Pool = Pool; + type Network = Network; + type Evm = EvmConfig; + + fn pool(&self) -> &Self::Pool { + self.inner.pool() + } + + fn evm_config(&self) -> &Self::Evm { + self.inner.evm_config() + } + + fn network(&self) -> &Self::Network { + self.inner.network() + } + + fn provider(&self) -> &Self::Provider { + self.inner.provider() + } +} + impl std::fmt::Debug for EthApi { diff --git a/crates/rpc/rpc/src/eth/helpers/spec.rs b/crates/rpc/rpc/src/eth/helpers/spec.rs index 92445bf5ed1b..c5c8d54c64bc 100644 --- a/crates/rpc/rpc/src/eth/helpers/spec.rs +++ b/crates/rpc/rpc/src/eth/helpers/spec.rs @@ -2,13 +2,14 @@ use alloy_primitives::U256; use reth_chainspec::EthereumHardforks; use reth_network_api::NetworkInfo; use reth_provider::{BlockNumReader, ChainSpecProvider, StageCheckpointReader}; -use reth_rpc_eth_api::helpers::EthApiSpec; +use reth_rpc_eth_api::{helpers::EthApiSpec, RpcNodeCore}; use reth_transaction_pool::TransactionPool; use crate::EthApi; impl EthApiSpec for EthApi where + Self: RpcNodeCore, Pool: TransactionPool + 'static, Provider: ChainSpecProvider + BlockNumReader @@ -17,17 +18,6 @@ where Network: NetworkInfo + 'static, EvmConfig: Send + Sync, { - fn provider( - &self, - ) -> impl ChainSpecProvider + BlockNumReader + StageCheckpointReader - { - self.inner.provider() - } - - fn network(&self) -> impl NetworkInfo { - self.inner.network() - } - fn starting_block(&self) -> U256 { self.inner.starting_block() } From aac5aeea341ad7e97719a95ec2a204e8e9a81d81 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 23:26:55 +0800 Subject: [PATCH 15/21] Fix docs --- crates/node/builder/src/launch/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index e71f995f19b8..50438e79d2b6 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -46,7 +46,7 @@ use crate::{ AddOns, NodeBuilderWithComponents, NodeHandle, }; -/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`NodeCore`]. +/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`RpcNodeCore`]. pub type EthApiBuilderCtx = reth_rpc_eth_types::EthApiBuilderCtx< ::Provider, ::Pool, From 8cdc8336312a013a849609b9c3607ad06f537846 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 24 Oct 2024 23:39:05 +0800 Subject: [PATCH 16/21] Fix docs --- crates/rpc/rpc-eth-api/src/node.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/rpc/rpc-eth-api/src/node.rs b/crates/rpc/rpc-eth-api/src/node.rs index ef5034d337bd..76d20b50ae83 100644 --- a/crates/rpc/rpc-eth-api/src/node.rs +++ b/crates/rpc/rpc-eth-api/src/node.rs @@ -2,8 +2,7 @@ use reth_node_api::FullNodeComponents; -/// Helper trait to relax trait bounds on [`FullNodeComponents`] and [`FullNodeTypes`], when -/// defining types. +/// Helper trait to relax trait bounds on [`FullNodeComponents`], when defining types. pub trait RpcNodeCore: Clone { /// The provider type used to interact with the node. type Provider: Send + Sync + Clone + Unpin; From a79c495c2f79c3b3cd8c6b3bbbf9b91c783e2dbd Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Fri, 25 Oct 2024 20:25:28 +0800 Subject: [PATCH 17/21] Fix merge conflicts --- Cargo.lock | 316 ++++++++++++++++++++++++++--------------------------- 1 file changed, 156 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b14832b94968..1ec2851f4783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,9 +150,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5647fce5a168f9630f935bf7821c4207b1755184edaeba783cb4e11d35058484" +checksum = "e6228abfc751a29cde117b0879b805a3e0b3b641358f063272c83ca459a56886" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -229,9 +229,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5671117c38b1c2306891f97ad3828d85487087f54ebe2c7591a055ea5bcea7" +checksum = "d46eb5871592c216d39192499c95a99f7175cb94104f88c307e6dc960676d9f1" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -276,9 +276,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514f70ee2a953db21631cd817b13a1571474ec77ddc03d47616d5e8203489fde" +checksum = "9a968c063fcfcb937736665c865a71fc2242b68916156f5ffa41fee7b44bb695" dependencies = [ "alloy-consensus", "alloy-eips", @@ -398,9 +398,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -409,13 +409,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -639,7 +639,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -655,7 +655,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "syn-solidity", "tiny-keccak", ] @@ -671,15 +671,15 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45d1fbee9e698f3ba176b6e7a145f4aefe6d2b746b611e8bb246fe11a0e9f6c4" +checksum = "f631f0bd9a9d79619b27c91b6b1ab2c4ef4e606a65192369a1ee05d40dcf81cc" dependencies = [ "serde", "winnow", @@ -687,9 +687,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086f41bc6ebcd8cb15f38ba20e47be38dd03692149681ce8061c35d960dbf850" +checksum = "c2841af22d99e2c0f82a78fe107b6481be3dd20b89bfb067290092794734343a" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -862,9 +862,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "aquamarine" @@ -877,7 +877,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1053,9 +1053,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.17" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" dependencies = [ "brotli", "flate2", @@ -1100,7 +1100,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1111,7 +1111,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1149,7 +1149,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1255,7 +1255,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1437,7 +1437,7 @@ checksum = "240f4126219a83519bad05c9a40bfc0303921eeb571fc2d7e44c17ffac99d3f1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "synstructure", ] @@ -1559,7 +1559,7 @@ checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -1570,9 +1570,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] @@ -1771,7 +1771,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2228,7 +2228,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2252,7 +2252,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2263,7 +2263,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2385,7 +2385,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2396,7 +2396,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2417,7 +2417,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "unicode-xid", ] @@ -2531,7 +2531,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2679,7 +2679,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2690,7 +2690,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -2747,7 +2747,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -3302,7 +3302,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -3828,7 +3828,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -3978,7 +3978,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -4146,7 +4146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -4394,7 +4394,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -4803,16 +4803,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "metrics" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae428771d17306715c5091d446327d1cfdedc82185c65ba8423ab404e45bf10" -dependencies = [ - "ahash", - "portable-atomic", -] - [[package]] name = "metrics-derive" version = "0.1.0" @@ -4822,7 +4812,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -4833,7 +4823,7 @@ checksum = "b4f0c8427b39666bf970460908b213ec09b3b350f20c0c2eabcbba51704a08e6" dependencies = [ "base64 0.22.1", "indexmap 2.6.0", - "metrics 0.23.0", + "metrics", "metrics-util", "quanta", "thiserror", @@ -4841,14 +4831,14 @@ dependencies = [ [[package]] name = "metrics-process" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ca8ecd85575fbb143b2678cb123bb818779391ec0f745b1c4a9dbabadde407" +checksum = "e69e6ced169644e186e060ddc15f3923fdf06862c811a867bb1e5e7c7824f4d0" dependencies = [ "libc", "libproc", "mach2", - "metrics 0.24.0", + "metrics", "once_cell", "procfs 0.17.0", "rlimit", @@ -4864,7 +4854,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "hashbrown 0.14.5", - "metrics 0.23.0", + "metrics", "num_cpus", "quanta", "sketches-ddsketch", @@ -4969,7 +4959,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -5014,7 +5004,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.8.0", "url", ] @@ -5031,12 +5021,12 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -5217,7 +5207,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -5270,9 +5260,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7c98055fd048073738df0cc6d6537e992a0d8828f39d99a469e870db126dbd" +checksum = "99d49163f952491820088dd0e66f3a35d63337c3066eceff0a931bf83a8e2101" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5288,9 +5278,9 @@ dependencies = [ [[package]] name = "op-alloy-genesis" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d631e8113cf88d30e621022677209caa148a9ca3ccb590fd34bbd1c731e3aff3" +checksum = "8e46c2ab105f679f0cbfbc3fb762f3456d4b8556c841e667fc8f3c2226eb6c1e" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5302,9 +5292,9 @@ dependencies = [ [[package]] name = "op-alloy-network" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eabe7683d7e19c7cc5171d664e49fc449176cf1334ffff82808e2a7eea5933a" +checksum = "75ff1ea317441b9eb6317b24d13f9088e3b14ef48b15bfb6a125ca404df036d8" dependencies = [ "alloy-consensus", "alloy-network", @@ -5316,9 +5306,9 @@ dependencies = [ [[package]] name = "op-alloy-protocol" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b39574acb1873315e6bd89df174f6223e897188fb87eeea2ad1eda04f7d28eb" +checksum = "6c439457b2a1791325603fc18a94cc175e0b4b1127f11ff8a45071f05d044dcb" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5333,9 +5323,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919e9b69212d61f3c8932bfb717c7ad458ea3fc52072b3433d99994f8223d555" +checksum = "9c9556293835232b019ec9c6fd84e4265a3151111af60ea09b5b513e3dbed41c" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5351,9 +5341,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types-engine" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3a47ea24cee189b4351be247fd138c68571704ee57060cf5a722502f44412c" +checksum = "8a42a5ac4e07ed226b6a2aeefaad9b2cc7ec160e372ba626a4214d681a355fc2" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", @@ -5571,7 +5561,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -5585,29 +5575,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -5767,12 +5757,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "904afd36257cdb6ce0bee88b7981847bd7b955e5e216bb32f466b302923ad446" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -5823,14 +5813,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -5921,7 +5911,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -6405,7 +6395,7 @@ dependencies = [ "alloy-rlp", "futures-core", "futures-util", - "metrics 0.23.0", + "metrics", "reth-chainspec", "reth-evm", "reth-metrics", @@ -6431,7 +6421,7 @@ dependencies = [ "assert_matches", "futures", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "reth-blockchain-tree", "reth-blockchain-tree-api", "reth-chainspec", @@ -6518,7 +6508,7 @@ dependencies = [ "aquamarine", "assert_matches", "linked_hash_set", - "metrics 0.23.0", + "metrics", "parking_lot", "reth-blockchain-tree-api", "reth-chainspec", @@ -6568,7 +6558,7 @@ dependencies = [ "alloy-signer-local", "auto_impl", "derive_more 1.0.0", - "metrics 0.23.0", + "metrics", "parking_lot", "pin-project", "rand 0.8.5", @@ -6741,7 +6731,7 @@ dependencies = [ "proc-macro2", "quote", "similar-asserts", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -6822,7 +6812,7 @@ dependencies = [ "derive_more 1.0.0", "eyre", "iai-callgrind", - "metrics 0.23.0", + "metrics", "page_size", "parking_lot", "paste", @@ -6859,7 +6849,7 @@ dependencies = [ "arbitrary", "bytes", "derive_more 1.0.0", - "metrics 0.23.0", + "metrics", "modular-bitfield", "parity-scale-codec", "proptest", @@ -6959,7 +6949,7 @@ dependencies = [ "enr", "futures", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "rand 0.8.5", "reth-chainspec", "reth-ethereum-forks", @@ -7011,7 +7001,7 @@ dependencies = [ "futures", "futures-util", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "pin-project", "rand 0.8.5", "rayon", @@ -7183,7 +7173,7 @@ dependencies = [ "alloy-rpc-types-engine", "assert_matches", "futures", - "metrics 0.23.0", + "metrics", "reth-beacon-consensus", "reth-blockchain-tree", "reth-blockchain-tree-api", @@ -7430,7 +7420,7 @@ dependencies = [ "alloy-primitives", "auto_impl", "futures-util", - "metrics 0.23.0", + "metrics", "parking_lot", "reth-chainspec", "reth-consensus", @@ -7514,7 +7504,7 @@ dependencies = [ "eyre", "futures", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "parking_lot", "rand 0.8.5", "reth-blockchain-tree", @@ -7683,7 +7673,7 @@ name = "reth-metrics" version = "1.1.0" dependencies = [ "futures", - "metrics 0.23.0", + "metrics", "metrics-derive", "tokio", "tokio-util", @@ -7728,7 +7718,7 @@ dependencies = [ "enr", "futures", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "parking_lot", "pin-project", "pprof", @@ -8068,7 +8058,7 @@ dependencies = [ "eyre", "http", "jsonrpsee", - "metrics 0.23.0", + "metrics", "metrics-exporter-prometheus", "metrics-process", "metrics-util", @@ -8363,7 +8353,7 @@ dependencies = [ "alloy-rpc-types", "async-trait", "futures-util", - "metrics 0.23.0", + "metrics", "reth-chain-state", "reth-ethereum-engine-primitives", "reth-metrics", @@ -8492,7 +8482,7 @@ dependencies = [ "dashmap 6.1.0", "eyre", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "notify", "parking_lot", "rand 0.8.5", @@ -8535,7 +8525,7 @@ dependencies = [ "alloy-primitives", "assert_matches", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "rayon", "reth-chainspec", "reth-config", @@ -8719,7 +8709,7 @@ dependencies = [ "clap", "http", "jsonrpsee", - "metrics 0.23.0", + "metrics", "pin-project", "reth-beacon-consensus", "reth-chainspec", @@ -8767,7 +8757,7 @@ dependencies = [ "async-trait", "jsonrpsee-core", "jsonrpsee-types", - "metrics 0.23.0", + "metrics", "reth-beacon-consensus", "reth-chainspec", "reth-engine-primitives", @@ -8849,7 +8839,7 @@ dependencies = [ "itertools 0.13.0", "jsonrpsee-core", "jsonrpsee-types", - "metrics 0.23.0", + "metrics", "rand 0.8.5", "reth-chain-state", "reth-chainspec", @@ -8983,7 +8973,7 @@ dependencies = [ "assert_matches", "auto_impl", "futures-util", - "metrics 0.23.0", + "metrics", "reth-consensus", "reth-errors", "reth-metrics", @@ -9090,7 +9080,7 @@ dependencies = [ "auto_impl", "dyn-clone", "futures-util", - "metrics 0.23.0", + "metrics", "pin-project", "rayon", "reth-metrics", @@ -9150,7 +9140,7 @@ dependencies = [ "bitflags 2.6.0", "criterion", "futures-util", - "metrics 0.23.0", + "metrics", "parking_lot", "paste", "pprof", @@ -9192,7 +9182,7 @@ dependencies = [ "bincode", "criterion", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "proptest", "proptest-arbitrary-interop", "rayon", @@ -9242,7 +9232,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "derive_more 1.0.0", - "metrics 0.23.0", + "metrics", "proptest", "proptest-arbitrary-interop", "reth-chainspec", @@ -9272,7 +9262,7 @@ dependencies = [ "criterion", "derive_more 1.0.0", "itertools 0.13.0", - "metrics 0.23.0", + "metrics", "proptest", "proptest-arbitrary-interop", "rand 0.8.5", @@ -9311,9 +9301,9 @@ dependencies = [ [[package]] name = "revm" -version = "17.1.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055bee6a81aaeee8c2389ae31f0d4de87f44df24f4444a1116f9755fd87a76ad" +checksum = "2eab16cb0a8cd5ac88b11230b20df588b7e8aae7dfab4b3f830e98aebeb4b365" dependencies = [ "auto_impl", "cfg-if", @@ -9876,22 +9866,22 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.213" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -9926,7 +9916,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -9977,7 +9967,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10000,7 +9990,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10286,7 +10276,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10344,9 +10334,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "e6e185e337f816bc8da115b8afcb3324006ccc82eeaddf35113888d3bd8e44ac" dependencies = [ "proc-macro2", "quote", @@ -10362,7 +10352,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10388,7 +10378,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10465,7 +10455,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10489,22 +10479,22 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10657,9 +10647,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -10681,7 +10671,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -10882,7 +10872,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11182,6 +11172,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "unsigned-varint" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" + [[package]] name = "unsigned-varint" version = "0.8.0" @@ -11344,7 +11340,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "wasm-bindgen-shared", ] @@ -11378,7 +11374,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -11534,7 +11530,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11545,7 +11541,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11556,7 +11552,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11567,7 +11563,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11842,7 +11838,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "synstructure", ] @@ -11864,7 +11860,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11884,7 +11880,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", "synstructure", ] @@ -11905,7 +11901,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11927,7 +11923,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.80", ] [[package]] @@ -11956,4 +11952,4 @@ checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", -] \ No newline at end of file +] From 11bb733e1a6a72b9884eb0e73a66b3d2eebf65be Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 26 Oct 2024 17:40:03 +0800 Subject: [PATCH 18/21] Fix deps --- crates/node/core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/node/core/Cargo.toml b/crates/node/core/Cargo.toml index cae5a4979605..1c6c9d98c80b 100644 --- a/crates/node/core/Cargo.toml +++ b/crates/node/core/Cargo.toml @@ -36,7 +36,7 @@ reth-stages-types.workspace = true # ethereum alloy-primitives.workspace = true -alloy-rpc-types-engine = { workspace = true, features = ["jwt"] } +alloy-rpc-types-engine = { workspace = true, features = ["std", "jwt"] } alloy-consensus.workspace = true alloy-eips.workspace = true From d550a277cab80edc774c11e84142e4a136467fbe Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 26 Oct 2024 17:54:47 +0800 Subject: [PATCH 19/21] Fix deps --- crates/consensus/debug-client/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/consensus/debug-client/Cargo.toml b/crates/consensus/debug-client/Cargo.toml index c37beef10742..e73125a80bd7 100644 --- a/crates/consensus/debug-client/Cargo.toml +++ b/crates/consensus/debug-client/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] # reth reth-node-api.workspace = true -reth-rpc-api.workspace = true +reth-rpc-api = { workspace = true, features = ["client"] } reth-rpc-builder.workspace = true reth-tracing.workspace = true From 4a76db2382cb824aeb1b260b8eab4113ac8a2ce2 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 26 Oct 2024 18:40:23 +0800 Subject: [PATCH 20/21] Update docs --- crates/rpc/rpc-eth-api/src/node.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/rpc/rpc-eth-api/src/node.rs b/crates/rpc/rpc-eth-api/src/node.rs index 76d20b50ae83..8488677e32fb 100644 --- a/crates/rpc/rpc-eth-api/src/node.rs +++ b/crates/rpc/rpc-eth-api/src/node.rs @@ -2,7 +2,12 @@ use reth_node_api::FullNodeComponents; -/// Helper trait to relax trait bounds on [`FullNodeComponents`], when defining types. +/// Helper trait to relax trait bounds on [`FullNodeComponents`]. +/// +/// Helpful when defining types that would otherwise have a generic `N: FullNodeComponents`. Using +/// `N: RpcNodeCore` instead, allows access to all the associated types on [`FullNodeComponents`] +/// that are used in RPC, but with more flexibility since they have no trait bounds (asides auto +/// traits). pub trait RpcNodeCore: Clone { /// The provider type used to interact with the node. type Provider: Send + Sync + Clone + Unpin; From 897f293468b6c653730f0210c14906989bc3b5af Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 26 Oct 2024 20:48:38 +0800 Subject: [PATCH 21/21] Fix broken doc tests --- crates/rpc/rpc-builder/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index ceafe206531a..fc98cd6ff4ef 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -36,7 +36,7 @@ //! block_executor: BlockExecutor, //! ) where //! Provider: FullRpcProvider + AccountReader + ChangeSetReader, -//! Pool: TransactionPool + 'static, +//! Pool: TransactionPool + Unpin + 'static, //! Network: NetworkInfo + Peers + Clone + 'static, //! Events: CanonStateSubscriptions + Clone + 'static, //! EvmConfig: ConfigureEvm
, @@ -85,6 +85,7 @@ //! use reth_tasks::TokioTaskExecutor; //! use reth_transaction_pool::TransactionPool; //! use tokio::try_join; +//! //! pub async fn launch< //! Provider, //! Pool, @@ -104,7 +105,7 @@ //! block_executor: BlockExecutor, //! ) where //! Provider: FullRpcProvider + AccountReader + ChangeSetReader, -//! Pool: TransactionPool + 'static, +//! Pool: TransactionPool + Unpin + 'static, //! Network: NetworkInfo + Peers + Clone + 'static, //! Events: CanonStateSubscriptions + Clone + 'static, //! EngineApi: EngineApiServer,