Skip to content
Open
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
956 changes: 508 additions & 448 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ serde = { version = "1.0.219", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.140", default-features = false }

# Kona
kona-client = { git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-host = { git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-proof = { git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-preimage = {git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-genesis = { git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-registry = { git="https://github.com/op-rs/kona", rev= "kona-node/v1.2.8", default-features = false }
kona-client = { git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }
kona-host = { git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }
kona-proof = { git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }
kona-preimage = {git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }
kona-genesis = { git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }
kona-registry = { git="https://github.com/ethereum-optimism/optimism", rev= "kona-node/v1.2.10-rc.1", default-features = false }

# Alloy
alloy-primitives = { version = "1.4.1", default-features = false }
alloy-primitives = { version = "1.5.6", default-features = false }

[patch."crates-io"]
# Unify op-alloy crates to use the same git revision as kona
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", rev = "kona-node/v1.2.10-rc.1" }
op-alloy-network = { git = "https://github.com/ethereum-optimism/optimism", rev = "kona-node/v1.2.10-rc.1" }
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", rev = "kona-node/v1.2.10-rc.1" }
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", rev = "kona-node/v1.2.10-rc.1" }

12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SED = $(shell which gsed 2>/dev/null || echo sed)

.PHONY: chain
chain:
git clone --depth 1 -b op-node/v1.16.6 https://github.com/ethereum-optimism/optimism ./chain
git clone --depth 1 -b op-node/v1.16.7 https://github.com/ethereum-optimism/optimism ./chain
# override devnet config
cp kurtosis/kurtosis.yaml ./chain/kurtosis-devnet/optimism-package-trampoline/kurtosis.yml
cp kurtosis/main.star ./chain/kurtosis-devnet/optimism-package-trampoline/main.star
Expand Down Expand Up @@ -37,6 +37,14 @@ wait:

.PHONY: server-up
server-up:
$(MAKE) _server-up PREIMAGE_DISTANCE=50

.PHONY: server-up-long
server-up-long:
$(MAKE) _server-up PREIMAGE_DISTANCE=300

.PHONY: _server-up
_server-up:
mkdir -p .preimage && true
mkdir -p .finalized_l1 && true
@L2_ROLLUP_PORT=$$(jq -r '.l2RollupPort' hostPort.json);\
Expand All @@ -52,7 +60,7 @@ server-up:
--l1-chain-config=$$L1_CHAIN_CONFIG \
--initial-claimed-l2=53 \
--ttl=1800 \
--preimage-distance=50 \
--preimage-distance=$(PREIMAGE_DISTANCE) \
--purger-interval-seconds=100

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2025-05-01
nightly-2025-08-25
2 changes: 1 addition & 1 deletion scripts/sync_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def overwrite_lock(lock_a_path: str, lock_b_path: str, ignore: set, replace: dic

if __name__ == "__main__":
# Paths are relative to this script
lock_kona = "../../../op-rs/kona/Cargo.lock"
lock_kona = "../../../ethereum-optimism/optimism/rust/Cargo.lock"
lock_self = "../Cargo.lock"

overwrite_lock(lock_kona, lock_self, set(), {})
2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kona-registry = { workspace = true }
alloy-primitives = { workspace = true, features = ["map", "serde"] }

# optimism derivation
optimism-derivation = { git = "https://github.com/datachainlab/optimism-elc", rev = "v0.1.11", default-features = false }
optimism-derivation = { git = "https://github.com/datachainlab/optimism-elc", rev = "c67a2d3a4349e784d97e5e0760f04a6d638ab705", default-features = false }

[dev-dependencies]
prost = "0.11.9"
Expand Down
2 changes: 1 addition & 1 deletion server/src/client/period.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn compute_slot_at_timestamp(timestamp: u64, genesis_time: u64) -> Option<u6
return None;
}
let elapsed = timestamp - genesis_time;
if elapsed % SECONDS_PER_SLOT != 0 {
if !elapsed.is_multiple_of(SECONDS_PER_SLOT) {
// Allow non-aligned timestamps by rounding down
return Some(elapsed / SECONDS_PER_SLOT);
}
Expand Down
5 changes: 2 additions & 3 deletions server/src/derivation/host/single/local_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

use crate::derivation::host::single::handler::Derivation;
use alloy_primitives::B256;
use anyhow::Result;
use kona_host::KeyValueStore;
use kona_host::{HostError, KeyValueStore};
use kona_preimage::PreimageKey;
use kona_proof::boot::{
L1_CONFIG_KEY, L1_HEAD_KEY, L2_CHAIN_ID_KEY, L2_CLAIM_BLOCK_NUMBER_KEY, L2_CLAIM_KEY,
Expand Down Expand Up @@ -53,7 +52,7 @@ impl KeyValueStore for LocalKeyValueStore {
}
}

fn set(&mut self, _: B256, _: Vec<u8>) -> Result<()> {
fn set(&mut self, _: B256, _: Vec<u8>) -> Result<(), HostError> {
unreachable!("LocalKeyValueStore is read-only")
}
}
5 changes: 2 additions & 3 deletions server/src/derivation/host/single/trace.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Contains a concrete implementation of the [KeyValueStore] trait that stores data in memory.

use alloy_primitives::B256;
use anyhow::Result;
use kona_host::KeyValueStore;
use kona_host::{HostError, KeyValueStore};
use kona_preimage::PreimageKey;
use optimism_derivation::types::{Preimage, Preimages};

Expand All @@ -27,7 +26,7 @@ impl KeyValueStore for TracingKeyValueStore {
self.inner.get(key)
}

fn set(&mut self, key: B256, value: Vec<u8>) -> Result<()> {
fn set(&mut self, key: B256, value: Vec<u8>) -> Result<(), HostError> {
self.inner.set(key, value.clone())?;
self.used.insert(PreimageKey::try_from(key.0)?, value);
Ok(())
Expand Down