diff --git a/crates/engine/primitives/src/config.rs b/crates/engine/primitives/src/config.rs index 892372bf2ef..a4dd11c11d9 100644 --- a/crates/engine/primitives/src/config.rs +++ b/crates/engine/primitives/src/config.rs @@ -121,6 +121,9 @@ pub struct TreeConfig { state_provider_metrics: bool, /// Cross-block cache size in bytes. cross_block_cache_size: usize, + /// Whether the BAL-driven parallel execution path is enabled. When false, BAL blocks fall + /// back to the serial executor. Default false. + bal_parallel_execution_enabled: bool, /// Whether the host has enough parallelism to run state root task. has_enough_parallelism: bool, /// Multiproof task chunk size for proof targets. @@ -196,6 +199,7 @@ impl Default for TreeConfig { disable_prewarming: false, state_provider_metrics: false, cross_block_cache_size: DEFAULT_CROSS_BLOCK_CACHE_SIZE, + bal_parallel_execution_enabled: false, has_enough_parallelism: has_enough_parallelism(), multiproof_chunk_size: DEFAULT_MULTIPROOF_TASK_CHUNK_SIZE, reserved_cpu_cores: DEFAULT_RESERVED_CPU_CORES, @@ -267,6 +271,7 @@ impl TreeConfig { disable_prewarming, state_provider_metrics, cross_block_cache_size, + bal_parallel_execution_enabled: false, has_enough_parallelism, multiproof_chunk_size, reserved_cpu_cores, @@ -354,6 +359,11 @@ impl TreeConfig { self.disable_prewarming } + /// Returns whether the BAL-driven parallel execution path is enabled. + pub const fn bal_parallel_execution_enabled(&self) -> bool { + self.bal_parallel_execution_enabled + } + /// Returns whether to always compare trie updates from the state root task to the trie updates /// from the regular state root calculation. pub const fn always_compare_trie_updates(&self) -> bool { @@ -470,6 +480,12 @@ impl TreeConfig { self } + /// Setter for whether the BAL-driven parallel execution path is enabled. + pub const fn with_bal_parallel_execution_enabled(mut self, enabled: bool) -> Self { + self.bal_parallel_execution_enabled = enabled; + self + } + /// Setter for whether to always compare trie updates from the state root task to the trie /// updates from the regular state root calculation. pub const fn with_always_compare_trie_updates(