diff --git a/crates/driver/src/core.rs b/crates/driver/src/core.rs index aeba51304..f42027571 100644 --- a/crates/driver/src/core.rs +++ b/crates/driver/src/core.rs @@ -54,6 +54,11 @@ where } } + /// Waits until the executor is ready. + pub async fn wait_for_executor(&mut self) { + self.executor.wait_until_ready().await; + } + /// Advances the derivation pipeline to the target block number. /// /// ## Takes diff --git a/crates/driver/src/executor.rs b/crates/driver/src/executor.rs index d7edc76e5..c099db14c 100644 --- a/crates/driver/src/executor.rs +++ b/crates/driver/src/executor.rs @@ -1,5 +1,6 @@ //! An abstraction for the driver's block executor. +use alloc::boxed::Box; use core::{ error::Error, fmt::{Debug, Display}, @@ -19,6 +20,9 @@ pub trait Executor { /// The error type for the Executor. type Error: Error + Debug + Display + ToString; + /// Waits for the executor to be ready. + async fn wait_until_ready(&mut self); + /// Updates the safe header. fn update_safe_head(&mut self, header: Sealed
); diff --git a/crates/proof-sdk/proof/src/executor.rs b/crates/proof-sdk/proof/src/executor.rs index ddc38d21a..6c66eb31d 100644 --- a/crates/proof-sdk/proof/src/executor.rs +++ b/crates/proof-sdk/proof/src/executor.rs @@ -1,8 +1,9 @@ //! An executor constructor. -use alloc::sync::Arc; +use alloc::{boxed::Box, sync::Arc}; use alloy_consensus::{Header, Sealed}; use alloy_primitives::B256; +use async_trait::async_trait; use kona_driver::Executor; use kona_executor::{KonaHandleRegister, StatelessL2BlockExecutor, TrieDBProvider}; use kona_mpt::TrieHinter; @@ -45,6 +46,7 @@ where } } +#[async_trait] impl Executor for KonaExecutor<'_, P, H> where P: TrieDBProvider + Send + Sync + Clone, @@ -52,6 +54,12 @@ where { type Error = kona_executor::ExecutorError; + /// Waits for the executor to be ready. + async fn wait_until_ready(&mut self) { + /* no-op for the kona executor */ + /* This is used when an engine api is used instead of a stateless block executor */ + } + /// Updates the safe header. /// /// Since the L2 block executor is stateless, on an update to the safe head,