From 5576d4547f46588b7a67e9ef7b363c14e0789250 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:05:54 +0000 Subject: [PATCH] revert: feat(engine): run sync state root if not enough parallelism (#20127) (#20378) --- crates/engine/primitives/src/config.rs | 9 ++------- crates/engine/tree/src/tree/payload_validator.rs | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/engine/primitives/src/config.rs b/crates/engine/primitives/src/config.rs index bd96c45ae2..10265b9a43 100644 --- a/crates/engine/primitives/src/config.rs +++ b/crates/engine/primitives/src/config.rs @@ -101,7 +101,7 @@ pub struct TreeConfig { state_provider_metrics: bool, /// Cross-block cache size in bytes. cross_block_cache_size: u64, - /// Whether the host has enough parallelism to run state root in parallel. + /// Whether the host has enough parallelism to run state root task. has_enough_parallelism: bool, /// Whether multiproof task should chunk proof targets. multiproof_chunking_enabled: bool, @@ -403,17 +403,12 @@ impl TreeConfig { self } - /// Setter for whether or not the host has enough parallelism to run state root in parallel. + /// Setter for has enough parallelism. pub const fn with_has_enough_parallelism(mut self, has_enough_parallelism: bool) -> Self { self.has_enough_parallelism = has_enough_parallelism; self } - /// Whether or not the host has enough parallelism to run state root in parallel. - pub const fn has_enough_parallelism(&self) -> bool { - self.has_enough_parallelism - } - /// Setter for state provider metrics. pub const fn with_state_provider_metrics(mut self, state_provider_metrics: bool) -> Self { self.state_provider_metrics = state_provider_metrics; diff --git a/crates/engine/tree/src/tree/payload_validator.rs b/crates/engine/tree/src/tree/payload_validator.rs index 1ba2a1d1b8..3fc003c8be 100644 --- a/crates/engine/tree/src/tree/payload_validator.rs +++ b/crates/engine/tree/src/tree/payload_validator.rs @@ -876,7 +876,7 @@ where /// Note: Use state root task only if prefix sets are empty, otherwise proof generation is /// too expensive because it requires walking all paths in every proof. const fn plan_state_root_computation(&self) -> StateRootStrategy { - if self.config.state_root_fallback() || !self.config.has_enough_parallelism() { + if self.config.state_root_fallback() { StateRootStrategy::Synchronous } else if self.config.use_state_root_task() { StateRootStrategy::StateRootTask