From 8eff3c3a7c7dacbb56e30ef9b32798aed9a4f188 Mon Sep 17 00:00:00 2001 From: refcell Date: Tue, 26 Nov 2024 17:31:44 -0500 Subject: [PATCH] feat: advance without target --- Cargo.lock | 64 ++++++++++++++++++------------------- Cargo.toml | 4 +-- crates/driver/src/driver.rs | 19 ++++++++--- 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9172453..3764016 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6cee6a35793f3db8a5ffe60e86c695f321d081a567211245f503e8c498fce8" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -191,9 +191,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84c506bf264110fa7e90d9924f742f40ef53c6572ea56a0b0bd714a567ed389" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -253,9 +253,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fce5dbd6a4f118eecc4719eaa9c7ffc31c315e6c5ccde3642db927802312425" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "alloy-rlp", "arbitrary", @@ -266,7 +266,7 @@ dependencies = [ "derive_more", "foldhash", "getrandom", - "hashbrown 0.15.1", + "hashbrown 0.15.2", "hex-literal", "indexmap 2.6.0", "itoa", @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9343289b4a7461ed8bab8618504c995c049c082b70c7332efd7b32125633dc05" +checksum = "5c0279d09463a4695788a3622fd95443625f7be307422deba4b55dd491a9c7a1" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -527,9 +527,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4222d70bec485ceccc5d8fd4f2909edd65b5d5e43d4aca0b5dcee65d519ae98f" +checksum = "4feea540fc8233df2ad1156efd744b2075372f43a8f942a68b3b19c8a00e2c12" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -545,9 +545,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e17f2677369571b976e51ea1430eb41c3690d344fef567b840bfc0b01b6f83a" +checksum = "2a0ad281f3d1b613af814b66977ee698e443d4644a1510962d0241f26e0e53ae" dependencies = [ "const-hex", "dunce", @@ -560,9 +560,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa64d80ae58ffaafdff9d5d84f58d03775f66c84433916dc9a64ed16af5755da" +checksum = "96eff16c797438add6c37bb335839d015b186c5421ee5626f5559a7bfeb38ef5" dependencies = [ "serde", "winnow", @@ -570,9 +570,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6520d427d4a8eb7aa803d852d7a52ceb0c519e784c292f64bb339e636918cf27" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -2667,9 +2667,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", @@ -3460,7 +3460,7 @@ checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "arbitrary", "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", "serde", ] @@ -3562,9 +3562,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -3661,7 +3661,7 @@ dependencies = [ [[package]] name = "kona-derive" version = "0.1.0" -source = "git+https://github.com/anton-rs/kona?branch=main#657d313bc458a09823d9f5bc07842eb197e9b774" +source = "git+https://github.com/anton-rs/kona?branch=rf/chore/driver-advancing#9f2cc0ff5886802da9f0dae4ab601a36ef7b14bf" dependencies = [ "alloy-consensus", "alloy-eips", @@ -3680,7 +3680,7 @@ dependencies = [ [[package]] name = "kona-driver" version = "0.1.0" -source = "git+https://github.com/anton-rs/kona?branch=main#657d313bc458a09823d9f5bc07842eb197e9b774" +source = "git+https://github.com/anton-rs/kona?branch=rf/chore/driver-advancing#9f2cc0ff5886802da9f0dae4ab601a36ef7b14bf" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -4231,7 +4231,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -4281,9 +4281,9 @@ dependencies = [ [[package]] name = "metrics" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae428771d17306715c5091d446327d1cfdedc82185c65ba8423ab404e45bf10" +checksum = "7a7deb012b3b2767169ff203fadb4c6b0b82b947512e5eb9e0b78c2e186ad9e3" dependencies = [ "ahash", "portable-atomic", @@ -4329,7 +4329,7 @@ checksum = "15b482df36c13dd1869d73d14d28cd4855fbd6cfc32294bee109908a9f4a4ed7" dependencies = [ "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.15.1", + "hashbrown 0.15.2", "metrics", "quanta", "sketches-ddsketch", @@ -7974,9 +7974,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f76fe0a3e1476bdaa0775b9aec5b869ed9520c2b2fedfe9c6df3618f8ea6290b" +checksum = "6bdaa7b9e815582ba343a20c66627437cf45f1c6fba7f69772cbfd1358c7e197" dependencies = [ "paste", "proc-macro2", @@ -8398,9 +8398,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", diff --git a/Cargo.toml b/Cargo.toml index 685e10e..38a4b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/crates/driver/src/driver.rs b/crates/driver/src/driver.rs index 19f1e1b..3611002 100644 --- a/crates/driver/src/driver.rs +++ b/crates/driver/src/driver.rs @@ -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}; @@ -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 @@ -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?; }