revert: feat(engine): run sync state root if not enough parallelism (#20127) (#20378)

This commit is contained in:
Alexey Shekhirin
2025-12-15 14:05:54 +00:00
committed by GitHub
parent 21216e2f24
commit 5576d4547f
2 changed files with 3 additions and 8 deletions

View File

@@ -101,7 +101,7 @@ pub struct TreeConfig {
state_provider_metrics: bool, state_provider_metrics: bool,
/// Cross-block cache size in bytes. /// Cross-block cache size in bytes.
cross_block_cache_size: u64, 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, has_enough_parallelism: bool,
/// Whether multiproof task should chunk proof targets. /// Whether multiproof task should chunk proof targets.
multiproof_chunking_enabled: bool, multiproof_chunking_enabled: bool,
@@ -403,17 +403,12 @@ impl TreeConfig {
self 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 { pub const fn with_has_enough_parallelism(mut self, has_enough_parallelism: bool) -> Self {
self.has_enough_parallelism = has_enough_parallelism; self.has_enough_parallelism = has_enough_parallelism;
self 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. /// Setter for state provider metrics.
pub const fn with_state_provider_metrics(mut self, state_provider_metrics: bool) -> Self { pub const fn with_state_provider_metrics(mut self, state_provider_metrics: bool) -> Self {
self.state_provider_metrics = state_provider_metrics; self.state_provider_metrics = state_provider_metrics;

View File

@@ -876,7 +876,7 @@ where
/// Note: Use state root task only if prefix sets are empty, otherwise proof generation is /// 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. /// too expensive because it requires walking all paths in every proof.
const fn plan_state_root_computation(&self) -> StateRootStrategy { 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 StateRootStrategy::Synchronous
} else if self.config.use_state_root_task() { } else if self.config.use_state_root_task() {
StateRootStrategy::StateRootTask StateRootStrategy::StateRootTask