mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add RethTransactionPoolConfig (#5729)
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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<C> RethNetworkConfig for reth_network::NetworkManager<C> {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use crate::{
|
||||
},
|
||||
cli::{
|
||||
components::RethNodeComponentsImpl,
|
||||
config::RethRpcConfig,
|
||||
config::{RethRpcConfig, RethTransactionPoolConfig},
|
||||
ext::{RethCliExt, RethNodeCommandConfig},
|
||||
},
|
||||
dirs::{ChainPath, DataDirPath, MaybePlatformPath},
|
||||
|
||||
Reference in New Issue
Block a user