Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Closed
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
136 changes: 127 additions & 9 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ where
fetcher: F,
hinter: H,
) -> Self {
// comment
let trie_db = TrieDB::new(parent_header.state_root, parent_header, fetcher, hinter);
let state = StateBuilder::new_with_database(trie_db).with_bundle_update().build();
Self { config, state }
Expand Down
5 changes: 3 additions & 2 deletions crates/preimage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ async-trait.workspace = true
# local
kona-common = { path = "../common", version = "0.0.2" }

serde = { version = "1.0.203", features = ["derive"], optional = true }
# external
rkyv = { version = "0.7.44", optional = true }

[dev-dependencies]
tokio = { version = "1.38.0", features = ["full"] }
tempfile = "3.10.1"

[features]
default = []
serde = ["dep:serde"]
rkyv = ["dep:rkyv"]
10 changes: 6 additions & 4 deletions crates/preimage/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
//! the preimage oracle.

use alloy_primitives::{B256, U256};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

/// <https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-key-types>
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash)]
#[repr(u8)]
#[cfg_attr(feature = "rkyv", derive(Archive, Serialize, Deserialize))]
#[cfg_attr(feature = "rkyv", archive_attr(derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)))]
pub enum PreimageKeyType {
/// Local key types are local to a given instance of a fault-proof and context dependent.
/// Commonly these local keys are mapped to bootstrap data for the fault proof program.
Expand Down Expand Up @@ -56,8 +57,9 @@ impl TryFrom<u8> for PreimageKeyType {
/// |---------|-------------|
/// | [0, 1) | Type byte |
/// | [1, 32) | Data |
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "rkyv", derive(Archive, Serialize, Deserialize))]
#[cfg_attr(feature = "rkyv", archive_attr(derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)))]
pub struct PreimageKey {
data: [u8; 31],
key_type: PreimageKeyType,
Expand Down