mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: make additional validation tasks size configurable (#10200)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
5
book/cli/reth/node.md
vendored
5
book/cli/reth/node.md
vendored
@ -430,6 +430,11 @@ TxPool:
|
||||
--txpool.no-local-transactions-propagation
|
||||
Flag to toggle local transaction propagation
|
||||
|
||||
--txpool.additional-validation-tasks <ADDITIONAL_VALIDATION_TASKS>
|
||||
Number of additional transaction validation tasks to spawn
|
||||
|
||||
[default: 1]
|
||||
|
||||
Builder:
|
||||
--builder.extradata <EXTRADATA>
|
||||
Block extra data set by the payload builder
|
||||
|
||||
@ -144,7 +144,7 @@ where
|
||||
.with_head_timestamp(ctx.head().timestamp)
|
||||
.kzg_settings(ctx.kzg_settings()?)
|
||||
.with_local_transactions_config(pool_config.local_transactions_config.clone())
|
||||
.with_additional_tasks(1)
|
||||
.with_additional_tasks(ctx.config().txpool.additional_validation_tasks)
|
||||
.build_with_tasks(
|
||||
ctx.provider().clone(),
|
||||
ctx.task_executor().clone(),
|
||||
|
||||
@ -6,8 +6,9 @@ use reth_primitives::Address;
|
||||
use reth_transaction_pool::{
|
||||
blobstore::disk::DEFAULT_MAX_CACHED_BLOBS, validate::DEFAULT_MAX_TX_INPUT_BYTES,
|
||||
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,
|
||||
DEFAULT_TXPOOL_ADDITIONAL_VALIDATION_TASKS, 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, Clone, Args, PartialEq, Eq)]
|
||||
@ -63,6 +64,9 @@ pub struct TxPoolArgs {
|
||||
/// Flag to toggle local transaction propagation.
|
||||
#[arg(long = "txpool.no-local-transactions-propagation")]
|
||||
pub no_local_transactions_propagation: bool,
|
||||
/// Number of additional transaction validation tasks to spawn.
|
||||
#[arg(long = "txpool.additional-validation-tasks", alias = "txpool.additional_validation_tasks", default_value_t = DEFAULT_TXPOOL_ADDITIONAL_VALIDATION_TASKS)]
|
||||
pub additional_validation_tasks: usize,
|
||||
}
|
||||
|
||||
impl Default for TxPoolArgs {
|
||||
@ -82,6 +86,7 @@ impl Default for TxPoolArgs {
|
||||
no_locals: false,
|
||||
locals: Default::default(),
|
||||
no_local_transactions_propagation: false,
|
||||
additional_validation_tasks: DEFAULT_TXPOOL_ADDITIONAL_VALIDATION_TASKS,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ where
|
||||
let validator = TransactionValidationTaskExecutor::eth_builder(ctx.chain_spec())
|
||||
.with_head_timestamp(ctx.head().timestamp)
|
||||
.kzg_settings(ctx.kzg_settings()?)
|
||||
.with_additional_tasks(1)
|
||||
.with_additional_tasks(ctx.config().txpool.additional_validation_tasks)
|
||||
.build_with_tasks(
|
||||
ctx.provider().clone(),
|
||||
ctx.task_executor().clone(),
|
||||
|
||||
@ -10,6 +10,9 @@ pub const TXPOOL_SUBPOOL_MAX_TXS_DEFAULT: usize = 10_000;
|
||||
/// The default maximum allowed size of the given subpool.
|
||||
pub const TXPOOL_SUBPOOL_MAX_SIZE_MB_DEFAULT: usize = 20;
|
||||
|
||||
/// The default additional validation tasks size.
|
||||
pub const DEFAULT_TXPOOL_ADDITIONAL_VALIDATION_TASKS: usize = 1;
|
||||
|
||||
/// Default price bump (in %) for the transaction pool underpriced check.
|
||||
pub const DEFAULT_PRICE_BUMP: u128 = 10;
|
||||
|
||||
|
||||
@ -163,8 +163,9 @@ pub use crate::{
|
||||
blobstore::{BlobStore, BlobStoreError},
|
||||
config::{
|
||||
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,
|
||||
DEFAULT_TXPOOL_ADDITIONAL_VALIDATION_TASKS, REPLACE_BLOB_PRICE_BUMP,
|
||||
TXPOOL_MAX_ACCOUNT_SLOTS_PER_SENDER, TXPOOL_SUBPOOL_MAX_SIZE_MB_DEFAULT,
|
||||
TXPOOL_SUBPOOL_MAX_TXS_DEFAULT,
|
||||
},
|
||||
error::PoolResult,
|
||||
ordering::{CoinbaseTipOrdering, Priority, TransactionOrdering},
|
||||
|
||||
@ -55,7 +55,7 @@ where
|
||||
let validator = TransactionValidationTaskExecutor::eth_builder(ctx.chain_spec())
|
||||
.with_head_timestamp(ctx.head().timestamp)
|
||||
.kzg_settings(ctx.kzg_settings()?)
|
||||
.with_additional_tasks(5)
|
||||
.with_additional_tasks(ctx.config().txpool.additional_validation_tasks)
|
||||
.build_with_tasks(
|
||||
ctx.provider().clone(),
|
||||
ctx.task_executor().clone(),
|
||||
|
||||
Reference in New Issue
Block a user