Skip to content

Commit

Permalink
Merge branch 'main' into rkhalil/multiblock
Browse files Browse the repository at this point in the history
  • Loading branch information
hashcashier authored Jan 14, 2025
2 parents 1609187 + e7bfe4d commit 0406381
Show file tree
Hide file tree
Showing 23 changed files with 1,259 additions and 133 deletions.
262 changes: 143 additions & 119 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ members = [
"crates/driver",
"crates/executor",
"crates/mpt",
"crates/interop",
"crates/proof-sdk/*",
"bin/*"
]
Expand Down Expand Up @@ -64,10 +65,10 @@ lto = "fat"
# Workspace
kona-mpt = { path = "crates/mpt", version = "0.1.2", default-features = false }
kona-client = { path = "bin/client", version = "0.1.0", default-features = false }
kona-derive = { path = "crates/derive", version = "0.2.1", default-features = false }
kona-driver = { path = "crates/driver", version = "0.2.1", default-features = false }
kona-executor = { path = "crates/executor", version = "0.2.1", default-features = false }
kona-proof = { path = "crates/proof-sdk/proof", version = "0.2.1", default-features = false }
kona-derive = { path = "crates/derive", version = "0.2.2", default-features = false }
kona-driver = { path = "crates/driver", version = "0.2.2", default-features = false }
kona-executor = { path = "crates/executor", version = "0.2.2", default-features = false }
kona-proof = { path = "crates/proof-sdk/proof", version = "0.2.2", default-features = false }
kona-std-fpvm = { path = "crates/proof-sdk/std-fpvm", version = "0.1.2", default-features = false }
kona-preimage = { path = "crates/proof-sdk/preimage", version = "0.2.1", default-features = false }
kona-std-fpvm-proc = { path = "crates/proof-sdk/std-fpvm-proc", version = "0.1.2", default-features = false }
Expand All @@ -91,6 +92,7 @@ alloy-node-bindings = { version = "0.9.2", default-features = false }
alloy-transport-http = { version = "0.9.2", default-features = false }
alloy-rpc-types-engine = { version = "0.9.2", default-features = false }
alloy-rpc-types-beacon = { version = "0.9.2", default-features = false }
alloy-sol-types = { version = "0.8.18", default-features = false }

# OP Alloy
op-alloy-genesis = { version = "0.9.2", default-features = false }
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ see the [SDK section of the book](https://op-rs.github.io/kona/sdk/intro.html).
- [`executor`](./crates/executor): `no_std` stateless block executor for the [OP Stack][op-stack].
- [`derive`](./crates/derive): `no_std` compatible implementation of the [derivation pipeline][g-derivation-pipeline].
- [`driver`](./crates/driver): Stateful derivation pipeline driver.
- [`interop`](./crates/interop): Core functionality and primitives for the [Interop feature](https://specs.optimism.io/interop/overview.html) of the OP Stack.

**Proof SDK**

Expand All @@ -86,12 +87,12 @@ getting started with building your own programs, and a reference for the librari
[cannon-rs]: https://github.com/op-rs/cannon-rs
[badboi-cannon-rs]: https://github.com/BadBoiLabs/cannon-rs
[asterisc]: https://github.com/etheruem-optimism/asterisc
[fpp-specs]: https://specs.optimism.io/experimental/fault-proof/index.html
[fpp-specs]: https://specs.optimism.io/fault-proof/index.html
[book]: https://op-rs.github.io/kona/
[op-succinct]: https://github.com/succinctlabs/op-succinct
[op-labs]: https://github.com/ethereum-optimism
[bad-boi-labs]: https://github.com/BadBoiLabs
[g-output-root]: https://specs.optimism.io/glossary.html#l2-output-root
[g-derivation-pipeline]: https://specs.optimism.io/protocol/derivation.html#l2-chain-derivation-pipeline
[g-fault-proof-vm]: https://specs.optimism.io/experimental/fault-proof/index.html#fault-proof-vm
[g-preimage-oracle]: https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle
[g-preimage-oracle]: https://specs.optimism.io/fault-proof/index.html#pre-image-oracle
9 changes: 9 additions & 0 deletions crates/derive/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.2](https://github.com/op-rs/kona/compare/kona-derive-v0.2.1...kona-derive-v0.2.2) - 2025-01-13

### Other

- Move temporary error logs to lower level than WARN ([#897](https://github.com/op-rs/kona/pull/897))
- *(deps)* Replace dep `alloy-rs/op-alloy-registry`->`op-rs/maili-registry` (#892)
- *(deps)* Replace dep `alloy-rs/op-alloy-protocol`->`op-rs/maili-protocol` (#890)
- *(derive)* Test Ignoring EIP-7702 (#887)

## [0.2.1](https://github.com/op-rs/kona/compare/kona-derive-v0.2.0...kona-derive-v0.2.1) - 2025-01-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion crates/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kona-derive"
description = "A no_std derivation pipeline implementation for the OP Stack"
version = "0.2.1"
version = "0.2.2"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions crates/derive/src/pipeline/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ where
}
StepResult::AdvancedOrigin
}
PipelineErrorKind::Temporary(_) => {
trace!(target: "pipeline", "Attributes queue step failed due to temporary error: {:?}", err);
StepResult::StepFailed(err)
}
_ => {
warn!(target: "pipeline", "Attributes queue step failed: {:?}", err);
StepResult::StepFailed(err)
Expand Down
7 changes: 7 additions & 0 deletions crates/driver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.2](https://github.com/op-rs/kona/compare/kona-driver-v0.2.1...kona-driver-v0.2.2) - 2025-01-13

### Other

- Move temporary error logs to lower level than WARN ([#897](https://github.com/op-rs/kona/pull/897))
- *(deps)* Replace dep `alloy-rs/op-alloy-protocol`->`op-rs/maili-protocol` (#890)

## [0.2.1](https://github.com/op-rs/kona/compare/kona-driver-v0.2.0...kona-driver-v0.2.1) - 2025-01-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion crates/driver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kona-driver"
description = "A no_std derivation pipeline driver"
version = "0.2.1"
version = "0.2.2"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down
13 changes: 9 additions & 4 deletions crates/driver/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ where
info!(target: "client_derivation_driver", "Advanced origin")
}
StepResult::OriginAdvanceErr(e) | StepResult::StepFailed(e) => {
warn!(target: "client_derivation_driver", "Failed to step derivation pipeline: {:?}", e);

// Break the loop unless the error signifies that there is not enough data to
// complete the current step. In this case, we retry the step to see if other
// stages can make progress.
match e {
PipelineErrorKind::Temporary(_) => continue,
PipelineErrorKind::Temporary(_) => {
trace!(target: "client_derivation_driver", "Failed to step derivation pipeline temporarily: {:?}", e);
continue
}
PipelineErrorKind::Reset(e) => {
warn!(target: "client_derivation_driver", "Failed to step derivation pipeline due to reset: {:?}", e);
let system_config = self
.system_config_by_number(l2_safe_head.block_info.number)
.await?;
Expand Down Expand Up @@ -85,7 +87,10 @@ where
.await?;
}
}
PipelineErrorKind::Critical(_) => return Err(e),
PipelineErrorKind::Critical(_) => {
warn!(target: "client_derivation_driver", "Failed to step derivation pipeline: {:?}", e);
return Err(e)
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions crates/executor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.2](https://github.com/op-rs/kona/compare/kona-executor-v0.2.1...kona-executor-v0.2.2) - 2025-01-13

### Other

- update Cargo.toml dependencies

## [0.2.1](https://github.com/op-rs/kona/compare/kona-executor-v0.2.0...kona-executor-v0.2.1) - 2025-01-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion crates/executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kona-executor"
description = "An no_std implementation of a stateless L2 block executor for the OP Stack."
version = "0.2.1"
version = "0.2.2"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down
37 changes: 37 additions & 0 deletions crates/interop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "kona-interop"
description = "Core functionality and primitives for the Interop feature of the OP Stack."
version = "0.1.0"
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true

[lints]
workspace = true

[dependencies]
# General
thiserror.workspace = true
async-trait.workspace = true
tracing.workspace = true

# Alloy
alloy-primitives = { workspace = true, features = ["rlp"] }
alloy-sol-types.workspace = true
alloy-consensus.workspace = true
alloy-rlp.workspace = true
op-alloy-consensus.workspace = true

# Arbitrary
arbitrary = { version = "1.4", features = ["derive"], optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["full"] }
alloy-primitives = { workspace = true, features = ["rlp", "arbitrary"] }
arbitrary = { version = "1.4", features = ["derive"] }
rand.workspace = true

[features]
arbitrary = ["dep:arbitrary", "alloy-primitives/arbitrary"]
8 changes: 8 additions & 0 deletions crates/interop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# `kona-interop`

<a href="https://github.com/op-rs/kona/actions/workflows/rust_ci.yaml"><img src="https://github.com/op-rs/kona/actions/workflows/rust_ci.yaml/badge.svg?label=ci" alt="CI"></a>
<a href="https://crates.io/crates/kona-interop"><img src="https://img.shields.io/crates/v/kona-interop.svg?label=kona-interop&labelColor=2a2f35" alt="Kona MPT"></a>
<a href="https://github.com/op-rs/kona/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-d1d1f6.svg?label=license&labelColor=2a2f35" alt="License"></a>
<a href="https://img.shields.io/codecov/c/github/op-rs/kona"><img src="https://img.shields.io/codecov/c/github/op-rs/kona" alt="Codecov"></a>

Core functionality and primitives for the [Interop feature](https://specs.optimism.io/interop/overview.html) of the OP Stack.
15 changes: 15 additions & 0 deletions crates/interop/src/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! Constants for the OP Stack interop protocol.
use alloy_primitives::{address, Address};

/// The address of the L2 cross chain inbox predeploy proxy.
pub const CROSS_L2_INBOX_ADDRESS: Address = address!("4200000000000000000000000000000000000022");

/// The expiry window for relaying an initiating message (in seconds).
/// <https://specs.optimism.io/interop/messaging.html#message-expiry-invariant>
pub const MESSAGE_EXPIRY_WINDOW: u64 = 180 * 24 * 60 * 60;

/// The current version of the [SuperRoot] encoding format.
///
/// [SuperRoot]: crate::SuperRoot
pub const SUPER_ROOT_VERSION: u8 = 1;
71 changes: 71 additions & 0 deletions crates/interop/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//! Error types for the `kona-interop` crate.
use alloc::vec::Vec;
use alloy_primitives::{Address, B256};
use thiserror::Error;

/// An error type for the [MessageGraph] struct.
///
/// [MessageGraph]: crate::MessageGraph
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum MessageGraphError {
/// Dependency set is impossibly empty
#[error("Dependency set is impossibly empty")]
EmptyDependencySet,
/// Remote message not found
#[error("Remote message not found on chain ID {0} with message hash {1}")]
RemoteMessageNotFound(u64, B256),
/// Invalid message origin
#[error("Invalid message origin. Expected {0}, got {1}")]
InvalidMessageOrigin(Address, Address),
/// Invalid message payload hash
#[error("Invalid message hash. Expected {0}, got {1}")]
InvalidMessageHash(B256, B256),
/// Invalid message timestamp
#[error("Invalid message timestamp. Expected {0}, got {1}")]
InvalidMessageTimestamp(u64, u64),
/// Message is in the future
#[error("Message is in the future. Expected timestamp to be <= {0}, got {1}")]
MessageInFuture(u64, u64),
/// Invalid messages were found
#[error("Invalid messages found on chains: {0:?}")]
InvalidMessages(Vec<u64>),
/// Interop provider error
#[error("Interop provider: {0}")]
InteropProviderError(#[from] InteropProviderError),
}

/// A [Result] alias for the [MessageGraphError] type.
pub type MessageGraphResult<T> = core::result::Result<T, MessageGraphError>;

/// An error type for the [InteropProvider] trait.
///
/// [InteropProvider]: crate::InteropProvider
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum InteropProviderError {
/// Unknown Chain ID
#[error("Unknown Chain ID")]
UnknownChainId,
/// Not found
#[error("Not found")]
NotFound,
}

/// A [Result] alias for the [InteropProviderError] type.
pub type InteropProviderResult<T> = core::result::Result<T, InteropProviderError>;

/// An error type for the [SuperRoot] struct's serialization and deserialization.
///
/// [SuperRoot]: crate::SuperRoot
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum SuperRootError {
/// Invalid super root version byte
#[error("Invalid super root version byte")]
InvalidVersionByte,
/// Unexpected encoded super root length
#[error("Unexpected encoded super root length")]
UnexpectedLength,
}

/// A [Result] alias for the [SuperRootError] type.
pub type SuperRootResult<T> = core::result::Result<T, SuperRootError>;
Loading

0 comments on commit 0406381

Please sign in to comment.