mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: Support txpool.locals in txpool.cli (#5971)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
use crate::cli::config::RethTransactionPoolConfig;
|
||||
use clap::Args;
|
||||
use reth_primitives::Address;
|
||||
use reth_transaction_pool::{
|
||||
LocalTransactionConfig, PoolConfig, PriceBumpConfig, SubPoolLimit, DEFAULT_PRICE_BUMP,
|
||||
REPLACE_BLOB_PRICE_BUMP, TXPOOL_MAX_ACCOUNT_SLOTS_PER_SENDER,
|
||||
TXPOOL_SUBPOOL_MAX_SIZE_MB_DEFAULT, TXPOOL_SUBPOOL_MAX_TXS_DEFAULT,
|
||||
};
|
||||
|
||||
/// Parameters for debugging purposes
|
||||
#[derive(Debug, Args, PartialEq)]
|
||||
#[clap(next_help_heading = "TxPool")]
|
||||
@@ -47,6 +47,9 @@ pub struct TxPoolArgs {
|
||||
/// Flag to disable local transaction exemptions.
|
||||
#[arg(long = "txpool.nolocals")]
|
||||
pub no_locals: bool,
|
||||
/// Flag to allow certain addresses as local
|
||||
#[arg(long = "txpool.locals")]
|
||||
pub locals: Vec<Address>,
|
||||
}
|
||||
|
||||
impl Default for TxPoolArgs {
|
||||
@@ -62,6 +65,7 @@ impl Default for TxPoolArgs {
|
||||
price_bump: DEFAULT_PRICE_BUMP,
|
||||
blob_transaction_price_bump: REPLACE_BLOB_PRICE_BUMP,
|
||||
no_locals: false,
|
||||
locals: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +74,10 @@ impl RethTransactionPoolConfig for TxPoolArgs {
|
||||
/// Returns transaction pool configuration.
|
||||
fn pool_config(&self) -> PoolConfig {
|
||||
PoolConfig {
|
||||
local_transactions_config: LocalTransactionConfig { no_exemptions: self.no_locals },
|
||||
local_transactions_config: LocalTransactionConfig {
|
||||
no_exemptions: self.no_locals,
|
||||
local_addresses: self.locals.clone().into_iter().collect(),
|
||||
},
|
||||
pending_limit: SubPoolLimit {
|
||||
max_txs: self.pending_max_count,
|
||||
max_size: self.pending_max_size * 1024 * 1024,
|
||||
|
||||
Reference in New Issue
Block a user