From dbdb1117a8d314e0de776fc6f70c7c1076640ade Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Sat, 24 Aug 2024 00:36:32 -0700 Subject: [PATCH] rpc: remove special module handling for `eth_callBundle` (#10486) --- book/cli/reth/node.md | 4 +-- crates/node/core/src/args/rpc_server.rs | 13 +++------ crates/rpc/rpc-builder/src/lib.rs | 32 ++++++++--------------- crates/rpc/rpc-server-types/src/module.rs | 6 ----- 4 files changed, 17 insertions(+), 38 deletions(-) diff --git a/book/cli/reth/node.md b/book/cli/reth/node.md index a9937a8af..b3c51fdf4 100644 --- a/book/cli/reth/node.md +++ b/book/cli/reth/node.md @@ -230,7 +230,7 @@ RPC: --http.api Rpc Modules to be configured for the HTTP server - [possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle] + [possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots] --http.corsdomain Http Corsdomain to allow request from @@ -254,7 +254,7 @@ RPC: --ws.api Rpc Modules to be configured for the WS server - [possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle] + [possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots] --ipcdisable Disable the IPC-RPC server diff --git a/crates/node/core/src/args/rpc_server.rs b/crates/node/core/src/args/rpc_server.rs index 761f0c3f7..23af07521 100644 --- a/crates/node/core/src/args/rpc_server.rs +++ b/crates/node/core/src/args/rpc_server.rs @@ -366,17 +366,12 @@ mod tests { #[test] fn test_rpc_server_eth_call_bundle_args() { - let args = CommandParser::::parse_from([ - "reth", - "--http.api", - "eth,admin,debug,eth-call-bundle", - ]) - .args; + let args = + CommandParser::::parse_from(["reth", "--http.api", "eth,admin,debug"]) + .args; let apis = args.http_api.unwrap(); - let expected = - RpcModuleSelection::try_from_selection(["eth", "admin", "debug", "eth-call-bundle"]) - .unwrap(); + let expected = RpcModuleSelection::try_from_selection(["eth", "admin", "debug"]).unwrap(); assert_eq!(apis, expected); } diff --git a/crates/rpc/rpc-builder/src/lib.rs b/crates/rpc/rpc-builder/src/lib.rs index 3deaba618..852218b7c 100644 --- a/crates/rpc/rpc-builder/src/lib.rs +++ b/crates/rpc/rpc-builder/src/lib.rs @@ -1068,6 +1068,15 @@ where let mut module = eth_api.clone().into_rpc(); module.merge(eth_filter.clone().into_rpc()).expect("No conflicts"); module.merge(eth_pubsub.clone().into_rpc()).expect("No conflicts"); + module + .merge( + EthBundle::new( + eth_api.clone(), + self.blocking_pool_guard.clone(), + ) + .into_rpc(), + ) + .expect("No conflicts"); module.into() } @@ -1099,11 +1108,6 @@ where .into_rpc() .into() } - RethRpcModule::EthCallBundle => { - EthBundle::new(eth_api.clone(), self.blocking_pool_guard.clone()) - .into_rpc() - .into() - } }) .clone() }) @@ -1819,27 +1823,13 @@ impl RpcServerHandle { mod tests { use super::*; - #[test] - fn parse_eth_call_bundle() { - let selection = "eth-call-bundle".parse::().unwrap(); - assert_eq!(selection, RethRpcModule::EthCallBundle); - let selection = "eth_callBundle".parse::().unwrap(); - assert_eq!(selection, RethRpcModule::EthCallBundle); - } - #[test] fn parse_eth_call_bundle_selection() { - let selection = "eth,admin,debug,eth-call-bundle".parse::().unwrap(); + let selection = "eth,admin,debug".parse::().unwrap(); assert_eq!( selection, RpcModuleSelection::Selection( - [ - RethRpcModule::Eth, - RethRpcModule::Admin, - RethRpcModule::Debug, - RethRpcModule::EthCallBundle, - ] - .into() + [RethRpcModule::Eth, RethRpcModule::Admin, RethRpcModule::Debug,].into() ) ); } diff --git a/crates/rpc/rpc-server-types/src/module.rs b/crates/rpc/rpc-server-types/src/module.rs index a94c53d89..72a5e7c85 100644 --- a/crates/rpc/rpc-server-types/src/module.rs +++ b/crates/rpc/rpc-server-types/src/module.rs @@ -255,11 +255,6 @@ pub enum RethRpcModule { Reth, /// `ots_` module Ots, - /// For single non-standard `eth_` namespace call `eth_callBundle` - /// - /// This is separate from [`RethRpcModule::Eth`] because it is a non standardized call that - /// should be opt-in. - EthCallBundle, } // === impl RethRpcModule === @@ -308,7 +303,6 @@ impl FromStr for RethRpcModule { "rpc" => Self::Rpc, "reth" => Self::Reth, "ots" => Self::Ots, - "eth-call-bundle" | "eth_callBundle" => Self::EthCallBundle, _ => return Err(ParseError::VariantNotFound), }) }