diff --git a/bin/reth/src/args/txpool_args.rs b/bin/reth/src/args/txpool_args.rs index 12dea777b..ba550f599 100644 --- a/bin/reth/src/args/txpool_args.rs +++ b/bin/reth/src/args/txpool_args.rs @@ -1,5 +1,6 @@ //! Transaction pool arguments +use crate::cli::config::RethTransactionPoolConfig; use clap::Args; use reth_transaction_pool::{ LocalTransactionConfig, PoolConfig, PriceBumpConfig, SubPoolLimit, DEFAULT_PRICE_BUMP, @@ -65,9 +66,9 @@ impl Default for TxPoolArgs { } } -impl TxPoolArgs { +impl RethTransactionPoolConfig for TxPoolArgs { /// Returns transaction pool configuration. - pub fn pool_config(&self) -> PoolConfig { + fn pool_config(&self) -> PoolConfig { PoolConfig { local_transactions_config: LocalTransactionConfig { no_exemptions: self.no_locals }, pending_limit: SubPoolLimit { diff --git a/bin/reth/src/cli/config.rs b/bin/reth/src/cli/config.rs index 2d3847bbb..a549a31e1 100644 --- a/bin/reth/src/cli/config.rs +++ b/bin/reth/src/cli/config.rs @@ -11,9 +11,10 @@ use reth_rpc_builder::{ auth::AuthServerConfig, error::RpcError, EthConfig, IpcServerBuilder, RpcServerConfig, ServerBuilder, TransportRpcModuleConfig, }; +use reth_transaction_pool::PoolConfig; use std::{borrow::Cow, path::PathBuf, time::Duration}; -/// A trait that provides configured RPC server. +/// A trait that provides a configured RPC server. /// /// This provides all basic config values for the RPC server and is implemented by the /// [RpcServerArgs](crate::args::RpcServerArgs) type. @@ -127,3 +128,10 @@ impl RethNetworkConfig for reth_network::NetworkManager { reth_network::NetworkManager::add_rlpx_sub_protocol(self, protocol); } } + +/// A trait that provides all basic config values for the transaction pool and is implemented by the +/// [TxPoolArgs](crate::args::TxPoolArgs) type. +pub trait RethTransactionPoolConfig { + /// Returns transaction pool configuration. + fn pool_config(&self) -> PoolConfig; +} diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index 37773a87b..dd67adc53 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -10,7 +10,7 @@ use crate::{ }, cli::{ components::RethNodeComponentsImpl, - config::RethRpcConfig, + config::{RethRpcConfig, RethTransactionPoolConfig}, ext::{RethCliExt, RethNodeCommandConfig}, }, dirs::{ChainPath, DataDirPath, MaybePlatformPath},