diff --git a/crates/driver/src/core.rs b/crates/driver/src/core.rs index f42027571..7fc73e2e4 100644 --- a/crates/driver/src/core.rs +++ b/crates/driver/src/core.rs @@ -109,7 +109,7 @@ where }; self.executor.update_safe_head(self.cursor.l2_safe_head_header().clone()); - let header = match self.executor.execute_payload(attributes.clone()) { + let header = match self.executor.execute_payload(attributes.clone()).await { Ok(header) => header, Err(e) => { error!(target: "client", "Failed to execute L2 block: {}", e); @@ -133,7 +133,7 @@ where // Retry the execution. self.executor.update_safe_head(self.cursor.l2_safe_head_header().clone()); - match self.executor.execute_payload(attributes.clone()) { + match self.executor.execute_payload(attributes.clone()).await { Ok(header) => header, Err(e) => { error!( diff --git a/crates/driver/src/executor.rs b/crates/driver/src/executor.rs index c099db14c..2e57ca54f 100644 --- a/crates/driver/src/executor.rs +++ b/crates/driver/src/executor.rs @@ -27,7 +27,10 @@ pub trait Executor { fn update_safe_head(&mut self, header: Sealed
); /// Execute the gicen [OpPayloadAttributes]. - fn execute_payload(&mut self, attributes: OpPayloadAttributes) -> Result<&Header, Self::Error>; + async fn execute_payload( + &mut self, + attributes: OpPayloadAttributes, + ) -> Result; /// Computes the output root. /// Expected to be called after the payload has been executed. diff --git a/crates/proof-sdk/proof/src/executor.rs b/crates/proof-sdk/proof/src/executor.rs index 6c66eb31d..3ceaaba0a 100644 --- a/crates/proof-sdk/proof/src/executor.rs +++ b/crates/proof-sdk/proof/src/executor.rs @@ -79,11 +79,17 @@ where } /// Execute the given payload attributes. - fn execute_payload(&mut self, attributes: OpPayloadAttributes) -> Result<&Header, Self::Error> { - self.inner.as_mut().map_or_else( - || Err(kona_executor::ExecutorError::MissingExecutor), - |e| e.execute_payload(attributes), - ) + async fn execute_payload( + &mut self, + attributes: OpPayloadAttributes, + ) -> Result { + self.inner + .as_mut() + .map_or_else( + || Err(kona_executor::ExecutorError::MissingExecutor), + |e| e.execute_payload(attributes), + ) + .cloned() } /// Computes the output root.