From 67e29aa60d4a20204fa75e7ca961e58f2e3b7fa8 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:06:50 +0100 Subject: [PATCH] chore(engine): remove MIN_WORKER_COUNT (#21829) --- crates/engine/primitives/src/config.rs | 19 +++++++++++-------- crates/node/core/src/args/engine.rs | 2 +- docs/vocs/docs/pages/cli/op-reth/node.mdx | 2 +- docs/vocs/docs/pages/cli/reth/node.mdx | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crates/engine/primitives/src/config.rs b/crates/engine/primitives/src/config.rs index 700b8852d0..2cb5796648 100644 --- a/crates/engine/primitives/src/config.rs +++ b/crates/engine/primitives/src/config.rs @@ -8,14 +8,11 @@ pub const DEFAULT_PERSISTENCE_THRESHOLD: u64 = 2; /// How close to the canonical head we persist blocks. pub const DEFAULT_MEMORY_BLOCK_BUFFER_TARGET: u64 = 0; -/// Minimum number of workers we allow configuring explicitly. -pub const MIN_WORKER_COUNT: usize = 32; - /// Returns the default number of storage worker threads based on available parallelism. fn default_storage_worker_count() -> usize { #[cfg(feature = "std")] { - std::thread::available_parallelism().map_or(8, |n| n.get() * 2).min(MIN_WORKER_COUNT) + std::thread::available_parallelism().map_or(8, |n| n.get() * 2) } #[cfg(not(feature = "std"))] { @@ -539,9 +536,12 @@ impl TreeConfig { /// Setter for the number of storage proof worker threads. /// /// No-op if it's [`None`]. - pub fn with_storage_worker_count_opt(mut self, storage_worker_count: Option) -> Self { + pub const fn with_storage_worker_count_opt( + mut self, + storage_worker_count: Option, + ) -> Self { if let Some(count) = storage_worker_count { - self.storage_worker_count = count.max(MIN_WORKER_COUNT); + self.storage_worker_count = count; } self } @@ -554,9 +554,12 @@ impl TreeConfig { /// Setter for the number of account proof worker threads. /// /// No-op if it's [`None`]. - pub fn with_account_worker_count_opt(mut self, account_worker_count: Option) -> Self { + pub const fn with_account_worker_count_opt( + mut self, + account_worker_count: Option, + ) -> Self { if let Some(count) = account_worker_count { - self.account_worker_count = count.max(MIN_WORKER_COUNT); + self.account_worker_count = count; } self } diff --git a/crates/node/core/src/args/engine.rs b/crates/node/core/src/args/engine.rs index f45e002cb8..90bffeba9f 100644 --- a/crates/node/core/src/args/engine.rs +++ b/crates/node/core/src/args/engine.rs @@ -335,7 +335,7 @@ pub struct EngineArgs { pub allow_unwind_canonical_header: bool, /// 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. + /// If not specified, defaults to 2x available parallelism. #[arg(long = "engine.storage-worker-count", default_value = Resettable::from(DefaultEngineValues::get_global().storage_worker_count.map(|v| v.to_string().into())))] pub storage_worker_count: Option, diff --git a/docs/vocs/docs/pages/cli/op-reth/node.mdx b/docs/vocs/docs/pages/cli/op-reth/node.mdx index 6b1b3e1416..8a06e8f4c6 100644 --- a/docs/vocs/docs/pages/cli/op-reth/node.mdx +++ b/docs/vocs/docs/pages/cli/op-reth/node.mdx @@ -1001,7 +1001,7 @@ Engine: Allow unwinding canonical header to ancestor during forkchoice updates. See `TreeConfig::unwind_canonical_header` for more details --engine.storage-worker-count - 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 + Configure the number of storage proof workers in the Tokio blocking pool. If not specified, defaults to 2x available parallelism --engine.account-worker-count Configure the number of account proof workers in the Tokio blocking pool. If not specified, defaults to the same count as storage workers diff --git a/docs/vocs/docs/pages/cli/reth/node.mdx b/docs/vocs/docs/pages/cli/reth/node.mdx index 895e09088f..d7cf5f36de 100644 --- a/docs/vocs/docs/pages/cli/reth/node.mdx +++ b/docs/vocs/docs/pages/cli/reth/node.mdx @@ -1001,7 +1001,7 @@ Engine: Allow unwinding canonical header to ancestor during forkchoice updates. See `TreeConfig::unwind_canonical_header` for more details --engine.storage-worker-count - 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 + Configure the number of storage proof workers in the Tokio blocking pool. If not specified, defaults to 2x available parallelism --engine.account-worker-count Configure the number of account proof workers in the Tokio blocking pool. If not specified, defaults to the same count as storage workers