Skip to content

Commit

Permalink
Merge pull request #131 from anton-rs/rf/feat/advance-without-target
Browse files Browse the repository at this point in the history
feat: advance without target
  • Loading branch information
refcell authored Nov 26, 2024
2 parents 349fcf4 + 8eff3c3 commit d9e91c8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 39 deletions.
64 changes: 32 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[patch.crates-io]
kona-derive = { git = "https://github.com/anton-rs/kona", branch = "main" }
kona-driver = { git = "https://github.com/anton-rs/kona", branch = "main" }
kona-derive = { git = "https://github.com/anton-rs/kona", branch = "rf/chore/driver-advancing" }
kona-driver = { git = "https://github.com/anton-rs/kona", branch = "rf/chore/driver-advancing" }

[workspace.dependencies]
# Workspace
Expand Down
19 changes: 14 additions & 5 deletions crates/driver/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use alloy_transport::TransportResult;
use kona_derive::{errors::PipelineErrorKind, traits::SignalReceiver, types::ResetSignal};
use kona_driver::{Driver, DriverPipeline, PipelineCursor, TipCursor};
use kona_driver::{Driver, PipelineCursor, TipCursor};
use std::sync::Arc;

use hilo_engine::{EngineApi, HiloExecutorConstructor};
Expand All @@ -26,6 +26,9 @@ pub enum DriverError {
/// A pipeline reset failed.
#[error("pipeline reset error: {0}")]
PipelineReset(#[from] PipelineErrorKind),
/// Kona's driver unexpectedly errored.
#[error("kona driver error")]
DriverErrored,
}

/// HiloDriver is a wrapper around the `Driver` that
Expand Down Expand Up @@ -122,10 +125,16 @@ where
// Step 3: Start the processing loop
loop {
tokio::select! {
Ok(_) = driver.pipeline.produce_payload(*driver.cursor.l2_safe_head()) => {
info!("Produced payload");
// todo
}
result = driver.advance_to_target(&self.cfg.rollup_config, None) => match result {
Ok((bn, hash)) => {
error!("Driver unexpectedly stopped at target block: {} {}", bn, hash);
}
Err(e) => {
error!("Driver error: {}", e);
// TODO: optionally allow recovery
return Err(DriverError::DriverErrored);
}
},
Some(notification) = self.ctx.recv_notification() => {
self.handle_notification(notification, &mut driver).await?;
}
Expand Down

0 comments on commit d9e91c8

Please sign in to comment.