Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencartavia committed Dec 2, 2024
1 parent 091d15a commit 1f0b0ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ where
let debug_ext = OpDebugWitnessApi::new(
ctx.node.provider().clone(),
ctx.node.evm_config().clone(),
Box::new(ctx.task_executor().clone()),
Box::new(ctx.node.task_executor().clone()),
);

self.0
Expand Down
16 changes: 13 additions & 3 deletions crates/optimism/rpc/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,20 @@ where
let _permit = self.inner.semaphore.acquire().await;

let parent_header = self.parent_header(parent_block_hash).to_rpc_result()?;

let provider = self.inner.provider.clone();
let builder = self.inner.builder.clone();

// Spawn the CPU-intensive work on a blocking task
self.inner
.builder
.payload_witness(&self.inner.provider, parent_header, attributes)
.map_err(|err| internal_rpc_err(err.to_string()))
.task_spawner
.spawn_blocking(move || {
builder
.payload_witness(&provider, parent_header, attributes)
.map_err(|err| internal_rpc_err(err.to_string()))
})
.await
.map_err(|err| internal_rpc_err(err.to_string()))?
}
}

Expand Down

0 comments on commit 1f0b0ea

Please sign in to comment.