From 984bfc9e4391272780107584d76865e84094c265 Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Fri, 20 Sep 2024 12:45:13 +0200 Subject: [PATCH 1/2] replace reth-rpc-types by alloy-rpc-types in reth-node-builder --- Cargo.lock | 2 +- crates/node/builder/Cargo.toml | 2 +- crates/node/builder/src/builder/mod.rs | 6 +++--- crates/node/builder/src/launch/common.rs | 6 +++--- crates/node/builder/src/launch/engine.rs | 4 ++-- crates/node/builder/src/launch/mod.rs | 4 ++-- crates/node/builder/src/rpc.rs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1a575bb3158..793626c02136 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7716,6 +7716,7 @@ version = "1.0.7" dependencies = [ "alloy-network", "alloy-primitives", + "alloy-rpc-types", "aquamarine", "eyre", "fdlimit", @@ -7760,7 +7761,6 @@ dependencies = [ "reth-rpc-engine-api", "reth-rpc-eth-types", "reth-rpc-layer", - "reth-rpc-types", "reth-stages", "reth-static-file", "reth-tasks", diff --git a/crates/node/builder/Cargo.toml b/crates/node/builder/Cargo.toml index 65b165617ff9..2f2ddf605c24 100644 --- a/crates/node/builder/Cargo.toml +++ b/crates/node/builder/Cargo.toml @@ -50,7 +50,6 @@ reth-rpc-builder.workspace = true reth-rpc-engine-api.workspace = true reth-rpc-eth-types.workspace = true reth-rpc-layer.workspace = true -reth-rpc-types.workspace = true reth-rpc.workspace = true reth-stages.workspace = true reth-static-file.workspace = true @@ -62,6 +61,7 @@ reth-transaction-pool.workspace = true ## ethereum alloy-network.workspace = true alloy-primitives.workspace = true +alloy-rpc-types = { workspace = true, features = ["engine"] } ## async futures.workspace = true diff --git a/crates/node/builder/src/builder/mod.rs b/crates/node/builder/src/builder/mod.rs index 4255e7fdf51b..3e72cce4de8e 100644 --- a/crates/node/builder/src/builder/mod.rs +++ b/crates/node/builder/src/builder/mod.rs @@ -5,7 +5,7 @@ pub mod add_ons; mod states; -use reth_rpc_types::WithOtherFields; +use alloy_rpc_types::serde_helpers::WithOtherFields; pub use states::*; use std::sync::Arc; @@ -348,7 +348,7 @@ where > + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = WithOtherFields, + TransactionResponse = WithOtherFields, ReceiptResponse = AnyTransactionReceipt, >, > @@ -499,7 +499,7 @@ where EthApi: EthApiBuilderProvider, CB::Components>> + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = WithOtherFields, + TransactionResponse = WithOtherFields, ReceiptResponse = AnyTransactionReceipt, >, > + AddDevSigners, diff --git a/crates/node/builder/src/launch/common.rs b/crates/node/builder/src/launch/common.rs index f9974711b7df..dcaa237022aa 100644 --- a/crates/node/builder/src/launch/common.rs +++ b/crates/node/builder/src/launch/common.rs @@ -925,9 +925,9 @@ where // Verify that the healthy node is running the same chain as the current node. let chain_id = futures::executor::block_on(async { EthApiClient::< - reth_rpc_types::Transaction, - reth_rpc_types::Block, - reth_rpc_types::Receipt, + alloy_rpc_types::Transaction, + alloy_rpc_types::Block, + alloy_rpc_types::Receipt, >::chain_id(&client) .await })? diff --git a/crates/node/builder/src/launch/engine.rs b/crates/node/builder/src/launch/engine.rs index 3bceef594971..df9d5cffd133 100644 --- a/crates/node/builder/src/launch/engine.rs +++ b/crates/node/builder/src/launch/engine.rs @@ -1,5 +1,6 @@ //! Engine node related functionality. +use alloy_rpc_types::{engine::ClientVersionV1, serde_helpers::WithOtherFields}; use futures::{future::Either, stream, stream_select, StreamExt}; use reth_beacon_consensus::{ hooks::{EngineHooks, StaticFileHook}, @@ -34,7 +35,6 @@ use reth_node_events::{cl::ConsensusLayerHealthEvents, node}; use reth_payload_primitives::PayloadBuilder; use reth_provider::providers::BlockchainProvider2; use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi}; -use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields}; use reth_tasks::TaskExecutor; use reth_tokio_util::EventSender; use reth_tracing::tracing::{debug, error, info}; @@ -83,7 +83,7 @@ where EthApi: EthApiBuilderProvider> + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = WithOtherFields, + TransactionResponse = WithOtherFields, ReceiptResponse = AnyTransactionReceipt, >, > + AddDevSigners, diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index d8ebbfc03d2e..6bebfcddbbe9 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -11,6 +11,7 @@ pub use exex::ExExLauncher; use std::{future::Future, sync::Arc}; +use alloy_rpc_types::{engine::ClientVersionV1, serde_helpers::WithOtherFields}; use futures::{future::Either, stream, stream_select, StreamExt}; use reth_beacon_consensus::{ hooks::{EngineHooks, PruneHook, StaticFileHook}, @@ -38,7 +39,6 @@ use reth_node_events::{cl::ConsensusLayerHealthEvents, node}; use reth_primitives::format_ether; use reth_provider::providers::BlockchainProvider; use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi}; -use reth_rpc_types::{engine::ClientVersionV1, WithOtherFields}; use reth_tasks::TaskExecutor; use reth_tracing::tracing::{debug, info}; use reth_transaction_pool::TransactionPool; @@ -116,7 +116,7 @@ where EthApi: EthApiBuilderProvider> + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = WithOtherFields, + TransactionResponse = WithOtherFields, ReceiptResponse = AnyTransactionReceipt, >, > + AddDevSigners, diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index 6b5818ff0c32..0fd8eb6612d7 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -5,6 +5,7 @@ use std::{ ops::{Deref, DerefMut}, }; +use alloy_rpc_types::serde_helpers::WithOtherFields; use futures::TryFutureExt; use reth_chainspec::ChainSpec; use reth_node_api::{ @@ -25,7 +26,6 @@ use reth_rpc_builder::{ RpcModuleBuilder, RpcRegistryInner, RpcServerHandle, TransportRpcModules, }; use reth_rpc_layer::JwtSecret; -use reth_rpc_types::WithOtherFields; use reth_tasks::TaskExecutor; use reth_tracing::tracing::{debug, info}; @@ -308,7 +308,7 @@ where EthApi: EthApiBuilderProvider + FullEthApiServer< NetworkTypes: alloy_network::Network< - TransactionResponse = WithOtherFields, + TransactionResponse = WithOtherFields, ReceiptResponse = AnyTransactionReceipt, >, >, From e1ec107c00937c39cce1ab30cc8ec4d19d77d523 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 21 Sep 2024 12:38:18 +0200 Subject: [PATCH 2/2] cleanup --- crates/node/builder/src/builder/mod.rs | 1 - crates/node/builder/src/launch/engine.rs | 2 +- crates/node/builder/src/launch/mod.rs | 2 +- crates/node/builder/src/rpc.rs | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/node/builder/src/builder/mod.rs b/crates/node/builder/src/builder/mod.rs index 0b29be8ebc4d..506603b84d61 100644 --- a/crates/node/builder/src/builder/mod.rs +++ b/crates/node/builder/src/builder/mod.rs @@ -5,7 +5,6 @@ pub mod add_ons; mod states; -use alloy_rpc_types::serde_helpers::WithOtherFields; pub use states::*; use std::sync::Arc; diff --git a/crates/node/builder/src/launch/engine.rs b/crates/node/builder/src/launch/engine.rs index 8726f345b1b0..e8c5f7818ef1 100644 --- a/crates/node/builder/src/launch/engine.rs +++ b/crates/node/builder/src/launch/engine.rs @@ -1,6 +1,6 @@ //! Engine node related functionality. -use alloy_rpc_types::{engine::ClientVersionV1, serde_helpers::WithOtherFields}; +use alloy_rpc_types::engine::ClientVersionV1; use futures::{future::Either, stream, stream_select, StreamExt}; use reth_beacon_consensus::{ hooks::{EngineHooks, StaticFileHook}, diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index 53c90e11b2a9..ee0215e08bb1 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -11,7 +11,7 @@ pub use exex::ExExLauncher; use std::{future::Future, sync::Arc}; -use alloy_rpc_types::{engine::ClientVersionV1, serde_helpers::WithOtherFields}; +use alloy_rpc_types::engine::ClientVersionV1; use futures::{future::Either, stream, stream_select, StreamExt}; use reth_beacon_consensus::{ hooks::{EngineHooks, PruneHook, StaticFileHook}, diff --git a/crates/node/builder/src/rpc.rs b/crates/node/builder/src/rpc.rs index f585654b4096..ada7437e8bd4 100644 --- a/crates/node/builder/src/rpc.rs +++ b/crates/node/builder/src/rpc.rs @@ -5,7 +5,6 @@ use std::{ ops::{Deref, DerefMut}, }; -use alloy_rpc_types::serde_helpers::WithOtherFields; use futures::TryFutureExt; use reth_chainspec::ChainSpec; use reth_node_api::{