Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(engine): disable parallel state root #11024

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading