Skip to content

Commit

Permalink
chore(engine): disable parallel state root (#11024)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Sep 19, 2024
1 parent ae9b13f commit 2924d88
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,12 @@ pub struct EngineApiTreeHandler<P, E, T: EngineTypes> {
payload_builder: PayloadBuilderHandle<T>,
/// Configuration settings.
config: TreeConfig,
/// Metrics for the engine api.
metrics: EngineApiMetrics,
/// An invalid block hook.
invalid_block_hook: Box<dyn InvalidBlockHook>,
/// Temporary flag to disable parallel state root.
parallel_state_root_enabled: bool,
/// Metrics for the engine api.
metrics: EngineApiMetrics,
}

impl<P: Debug, E: Debug, T: EngineTypes + Debug> std::fmt::Debug for EngineApiTreeHandler<P, E, T> {
Expand All @@ -512,8 +514,9 @@ impl<P: Debug, E: Debug, T: EngineTypes + Debug> std::fmt::Debug for EngineApiTr
.field("canonical_in_memory_state", &self.canonical_in_memory_state)
.field("payload_builder", &self.payload_builder)
.field("config", &self.config)
.field("metrics", &self.metrics)
.field("invalid_block_hook", &format!("{:p}", self.invalid_block_hook))
.field("parallel_state_root_enabled", &self.parallel_state_root_enabled)
.field("metrics", &self.metrics)
.finish()
}
}
Expand Down Expand Up @@ -555,9 +558,10 @@ where
canonical_in_memory_state,
payload_builder,
config,
metrics: Default::default(),
incoming_tx,
invalid_block_hook: Box::new(NoopInvalidBlockHook),
parallel_state_root_enabled: false,
metrics: Default::default(),
}
}

Expand Down Expand Up @@ -2178,7 +2182,7 @@ where
// we are computing in parallel, because we initialize a different database transaction
// per thread and it might end up with a different view of the database.
let persistence_in_progress = self.persistence_state.in_progress();
if !persistence_in_progress {
if self.parallel_state_root_enabled && !persistence_in_progress {
state_root_result = match self
.compute_state_root_in_parallel(block.parent_hash, &hashed_state)
{
Expand Down

0 comments on commit 2924d88

Please sign in to comment.