This commit is contained in:
Yong Kang
2025-10-10 10:39:12 +00:00
parent 42ceeddef7
commit 8e00a4a5b9
2 changed files with 13 additions and 11 deletions

View File

@@ -499,7 +499,11 @@ impl TreeConfig {
/// Setter for the number of storage proof worker threads.
pub const fn with_storage_worker_count(mut self, storage_worker_count: usize) -> Self {
self.storage_worker_count = storage_worker_count.max(MIN_WORKER_COUNT);
self.storage_worker_count = if storage_worker_count > MIN_WORKER_COUNT {
storage_worker_count
} else {
MIN_WORKER_COUNT
};
self
}
@@ -510,7 +514,11 @@ impl TreeConfig {
/// Setter for the number of account proof worker threads.
pub const fn with_account_worker_count(mut self, account_worker_count: usize) -> Self {
self.account_worker_count = account_worker_count.max(MIN_WORKER_COUNT);
self.account_worker_count = if account_worker_count > MIN_WORKER_COUNT {
account_worker_count
} else {
MIN_WORKER_COUNT
};
self
}
}

View File

@@ -1,7 +1,7 @@
//! clap [Args](clap::Args) for engine purposes
use clap::Args;
use reth_engine_primitives::{TreeConfig, DEFAULT_MULTIPROOF_TASK_CHUNK_SIZE, MIN_WORKER_COUNT};
use reth_engine_primitives::{TreeConfig, DEFAULT_MULTIPROOF_TASK_CHUNK_SIZE};
use crate::node_config::{
DEFAULT_CROSS_BLOCK_CACHE_SIZE_MB, DEFAULT_MAX_PROOF_TASK_CONCURRENCY,
@@ -111,18 +111,12 @@ pub struct EngineArgs {
/// Configure the number of storage proof workers in the Tokio blocking pool.
/// If not specified, defaults to 2x available parallelism, clamped between 2 and 64.
#[arg(
long = "engine.storage-worker-count",
value_parser = clap::value_parser!(usize).range(MIN_WORKER_COUNT..)
)]
#[arg(long = "engine.storage-worker-count")]
pub storage_worker_count: Option<usize>,
/// Configure the number of account proof workers in the Tokio blocking pool.
/// If not specified, defaults to 1.5x storage workers.
#[arg(
long = "engine.account-worker-count",
value_parser = clap::value_parser!(usize).range(MIN_WORKER_COUNT..)
)]
#[arg(long = "engine.account-worker-count")]
pub account_worker_count: Option<usize>,
}