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(driver): Wait for Engine #851

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions crates/driver/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
}
}

/// Waits until the executor is ready.
pub async fn wait_for_executor(&mut self) {
self.executor.wait_until_ready().await;
}

Check warning on line 60 in crates/driver/src/core.rs

View check run for this annotation

Codecov / codecov/patch

crates/driver/src/core.rs#L58-L60

Added lines #L58 - L60 were not covered by tests

/// Advances the derivation pipeline to the target block number.
///
/// ## Takes
Expand Down
4 changes: 4 additions & 0 deletions crates/driver/src/executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! An abstraction for the driver's block executor.

use alloc::boxed::Box;
use core::{
error::Error,
fmt::{Debug, Display},
Expand All @@ -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<Header>);

Expand Down
10 changes: 9 additions & 1 deletion crates/proof-sdk/proof/src/executor.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,13 +46,20 @@ where
}
}

#[async_trait]
impl<P, H> Executor for KonaExecutor<'_, P, H>
where
P: TrieDBProvider + Send + Sync + Clone,
H: TrieHinter + Send + Sync + Clone,
{
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,
Expand Down