Skip to content
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
2,152 changes: 1,492 additions & 660 deletions Cargo.lock

Large diffs are not rendered by default.

63 changes: 32 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ codegen-units = 1
lto = "fat"

[workspace.dependencies]
kona-client = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-host = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-derive = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-driver = { version = "0.4.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-executor = { version = "0.4.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-preimage = { version = "0.3.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-proof = { version = "0.3.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-std-fpvm = { version = "0.2.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-std-fpvm-proc = { version = "0.2.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-genesis = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-protocol = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-cli = { version = "0.3.2", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14", default-features = false }
kona-client = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-host = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-derive = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-driver = { version = "0.4.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-executor = { version = "0.4.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-preimage = { version = "0.3.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-proof = { version = "0.3.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-std-fpvm = { version = "0.2.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-std-fpvm-proc = { version = "0.2.0", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-genesis = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-protocol = { version = "0.4.5", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }
kona-cli = { version = "0.3.2", git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2", default-features = false }

# Workspace
hokulea-host-bin = { path = "bin/host", version = "0.1.0", default-features = false }
Expand All @@ -57,24 +57,24 @@ hokulea-sp1-bn-verifier = { path = "crates/sp1-bn-verifier", version = "0.1.0",
eigenda-cert = { path = "crates/eigenda-cert" }

# Alloy (Network)
alloy-consensus = { version = "=1.6.3", default-features = false }
alloy-genesis = { version = "=1.6.3", default-features = false }
alloy-consensus = { version = "=2.0.4", default-features = false }
alloy-genesis = { version = "=2.0.4", default-features = false }
alloy-primitives = { version = "1.5.6", default-features = false }
alloy-provider = { version = "=1.6.3", default-features = false }
alloy-provider = { version = "=2.0.4", default-features = false }
alloy-rlp = { version = "0.3.13", default-features = false }
alloy-rpc-client = { version = "=1.6.3", default-features = false }
alloy-rpc-types = { version = "=1.6.3", default-features = false }
alloy-rpc-client = { version = "=2.0.4", default-features = false }
alloy-rpc-types = { version = "=2.0.4", default-features = false }
alloy-sol-types = { version = "1.5.6", default-features = false }

# Execution
alloy-evm = { version = "0.27.2", default-features = false }
alloy-op-evm = { version = "0.26.3", default-features = false }
op-revm = { version = "15.0.0", default-features = false }
revm = { version = "34.0.0", default-features = false }
revm-primitives = { version = "21.0.2", default-features = false }
alloy-evm = { version = "0.34.0", default-features = false }
alloy-op-evm = { version = "0.32.0", default-features = false }
op-revm = { version = "20.0.0", default-features = false }
revm = { version = "38.0.0", default-features = false }
revm-primitives = { version = "23.0.0", default-features = false }

# OP Alloy
op-alloy-consensus = { version = "=0.23.1", default-features = false }
op-alloy-consensus = { version = "=2.0.0", default-features = false }

# Reth
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", default-features = false }
Expand Down Expand Up @@ -150,11 +150,12 @@ hex = "0.4"
url = { version = "2.5.4" }

[patch.crates-io]
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy-network = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy-provider = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
alloy-op-evm = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.2.14" }
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-alloy-network = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-alloy-provider = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
alloy-op-evm = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-alloy = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
op-revm = { git = "https://github.com/ethereum-optimism/optimism", tag = "kona-client/v1.5.2" }
1 change: 1 addition & 0 deletions bin/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
kona-client.workspace = true
kona-preimage.workspace = true
kona-proof.workspace = true
kona-genesis.workspace = true
kona-std-fpvm.workspace = true
kona-std-fpvm-proc.workspace = true

Expand Down
16 changes: 13 additions & 3 deletions bin/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ use alloc::sync::Arc;
use core::fmt::Debug;

use kona_client::single::FaultProofProgramError;
use kona_genesis::RollupConfig;
use kona_preimage::{HintWriterClient, PreimageOracleClient};
use kona_proof::{l1::OracleBlobProvider, CachingOracle};

use hokulea_client::fp_client;
use hokulea_proof::eigenda_provider::OracleEigenDAPreimageProvider;

use alloy_evm::{EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::block::OpTxEnv;
use op_alloy_consensus::OpTxEnvelope;
use alloy_evm::{block::BlockExecutorFactory, EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::{
block::{OpAlloyReceiptBuilder, OpTxEnv},
OpBlockExecutionCtx, OpBlockExecutorFactory,
};
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
use op_revm::OpSpecId;
use revm::context::BlockEnv;

Expand All @@ -31,6 +35,12 @@ where
Evm: EvmFactory<Spec = OpSpecId, BlockEnv = BlockEnv> + Send + Sync + Debug + Clone + 'static,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
const ORACLE_LRU_SIZE: usize = 1024;

Expand Down
3 changes: 2 additions & 1 deletion bin/client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use kona_preimage::{HintWriter, OracleReader};
use kona_std_fpvm::{FileChannel, FileDescriptor};
use kona_std_fpvm_proc::client_entry;

use alloy_op_evm::post_exec::PostExecEvmFactoryAdapter;
use kona_client::fpvm_evm::FpvmOpEvmFactory;

/// The global preimage oracle reader pipe.
Expand All @@ -30,6 +31,6 @@ fn main() -> Result<(), String> {
kona_proof::block_on(run_direct_client(
ORACLE_READER,
HINT_WRITER,
FpvmOpEvmFactory::new(HINT_WRITER, ORACLE_READER),
PostExecEvmFactoryAdapter::new(FpvmOpEvmFactory::new(HINT_WRITER, ORACLE_READER)),
))
}
1 change: 1 addition & 0 deletions bin/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ kona-client.workspace = true

# Alloy
alloy-primitives = { workspace = true, features = ["serde"] }
alloy-op-evm.workspace = true

# General
anyhow.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions bin/host/src/cfg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::eigenda_preimage::OnlineEigenDAPreimageProvider;
use crate::handler::SingleChainHintHandlerWithEigenDA;
use alloy_op_evm::post_exec::PostExecEvmFactoryAdapter;
use anyhow::Result;
use clap::Parser;
use hokulea_proof::hint::ExtendedHintType;
Expand Down Expand Up @@ -144,10 +145,10 @@ impl SingleChainHostWithEigenDA {
let client_task = task::spawn(hokulea_client_bin::client::run_direct_client(
OracleReader::new(preimage.client.clone()),
HintWriter::new(hint.client.clone()),
FpvmOpEvmFactory::new(
PostExecEvmFactoryAdapter::new(FpvmOpEvmFactory::new(
HintWriter::new(hint.client),
OracleReader::new(preimage.client),
),
)),
));

let (_, client_result) = tokio::try_join!(server_task, client_task)?;
Expand Down
9 changes: 6 additions & 3 deletions canoe/sp1-cc/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ edition = "2021"
sp1-cc-client-executor.workspace = true
sp1-cc-host-executor.workspace = true

alloy-genesis.workspace = true
# sp1-cc runs on the reth-1.9.3 / alloy-1.x stack (sp1-cc tag reth-1.9.3-sp1-6.1.0),
# so these alloy crates are pinned to the steel/sp1-compatible 1.6.x versions rather
# than the workspace's alloy-2.x pins used on the Kona (L2) side.
alloy-genesis = { version = "1.6.3", default-features = false }
alloy-primitives.workspace = true
alloy-rpc-client.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-client = { version = "1.6.3", default-features = false }
alloy-rpc-types = { version = "1.6.3", default-features = false }
alloy-sol-types.workspace = true
anyhow.workspace = true
async-trait.workspace = true
Expand Down
8 changes: 6 additions & 2 deletions canoe/verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ alloy-primitives = { workspace = true }
serde.workspace = true
thiserror.workspace = true

revm-primitives = { workspace = true }
# canoe verifies the EigenDA cert via an L1 view-call on the reth-1.9.3 / revm-31
# stack (shared with risc0-steel and sp1-cc), which is alloy 1.x. These types must
# match reth's, so they are pinned to the reth-compatible versions rather than the
# workspace's alloy-2.x / revm-23 pins used on the Kona (L2) side.
revm-primitives = { version = "21.0.2", default-features = false }
reth-chainspec = { workspace = true }
reth-evm = { workspace = true }
alloy-genesis = { workspace = true }
alloy-genesis = { version = "1.6.3", default-features = false }
tracing = { workspace = true }
1 change: 1 addition & 0 deletions crates/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kona-proof.workspace = true
kona-driver.workspace = true
kona-executor.workspace = true
kona-derive.workspace = true
kona-genesis.workspace = true

hokulea-eigenda.workspace = true

Expand Down
17 changes: 14 additions & 3 deletions crates/client/src/fp_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use kona_client::single::{fetch_safe_head_hash, FaultProofProgramError};
use kona_derive::BlobProvider;
use kona_driver::Driver;
use kona_executor::TrieDBProvider;
use kona_genesis::RollupConfig;
use kona_preimage::CommsClient;
use kona_proof::{
executor::KonaExecutor, l1::OracleL1ChainProvider, l1::OraclePipeline,
Expand All @@ -19,9 +20,12 @@ use kona_proof::{

use kona_derive::EthereumDataSource;

use alloy_evm::{EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::block::OpTxEnv;
use op_alloy_consensus::OpTxEnvelope;
use alloy_evm::{block::BlockExecutorFactory, EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::{
block::{OpAlloyReceiptBuilder, OpTxEnv},
OpBlockExecutionCtx, OpBlockExecutorFactory,
};
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
use op_revm::OpSpecId;
use revm::context::BlockEnv;

Expand All @@ -42,6 +46,12 @@ where
<E as EigenDAPreimageProvider>::Error: Debug,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
////////////////////////////////////////////////////////////////
// PROLOGUE //
Expand Down Expand Up @@ -117,6 +127,7 @@ where
dap,
l1_provider.clone(),
l2_provider.clone(),
None,
)
.await?;

Expand Down
6 changes: 5 additions & 1 deletion example/preloader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ tokio = { workspace = true, features = ["full"] }
tracing.workspace = true

kona-client.workspace = true
kona-genesis.workspace = true
kona-preimage.workspace = true
kona-proof.workspace = true

# Execution
alloy-evm.workspace = true
alloy-op-evm.workspace = true
alloy-rpc-client.workspace = true
# Only the `sp1-cc` feature path uses this — to build the L1 RpcClient for
# CanoeSp1CCReducedProofProvider, which lives on the reth-1.9.3 / alloy-1.x stack.
# Pinned to 1.6.x rather than the workspace's alloy-2.x so the RpcClient types match.
alloy-rpc-client = { version = "1.6.3", default-features = false }
op-alloy-consensus.workspace = true
op-revm.workspace = true
revm.workspace = true
Expand Down
39 changes: 34 additions & 5 deletions example/preloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use hokulea_host_bin::{cfg::SingleChainHostWithEigenDA, init_tracing_subscriber}
use hokulea_zkvm_verification::eigenda_witness_to_preloaded_provider;
use kona_client::fpvm_evm::FpvmOpEvmFactory;
use kona_client::single::FaultProofProgramError;
use kona_genesis::RollupConfig;
use kona_preimage::{
BidirectionalChannel, CommsClient, HintWriter, HintWriterClient, OracleReader,
PreimageOracleClient,
Expand All @@ -14,9 +15,13 @@ use tokio::task;

use core::fmt::Debug;

use alloy_evm::{EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::block::OpTxEnv;
use op_alloy_consensus::OpTxEnvelope;
use alloy_evm::{block::BlockExecutorFactory, EvmFactory, FromRecoveredTx, FromTxWithEncoded};
use alloy_op_evm::{
block::{OpAlloyReceiptBuilder, OpTxEnv},
post_exec::PostExecEvmFactoryAdapter,
OpBlockExecutionCtx, OpBlockExecutorFactory,
};
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
use op_revm::OpSpecId;
use revm::context::BlockEnv;

Expand Down Expand Up @@ -113,10 +118,10 @@ async fn main() -> anyhow::Result<()> {
let client_task = task::spawn(run_witgen_and_zk_verification(
OracleReader::new(preimage.client.clone()),
HintWriter::new(hint.client.clone()),
FpvmOpEvmFactory::new(
PostExecEvmFactoryAdapter::new(FpvmOpEvmFactory::new(
HintWriter::new(hint.client),
OracleReader::new(preimage.client),
),
)),
canoe_provider,
canoe_verifier,
canoe_address_fetcher,
Expand Down Expand Up @@ -149,6 +154,12 @@ where
Evm: EvmFactory<Spec = OpSpecId, BlockEnv = BlockEnv> + Send + Sync + Debug + Clone + 'static,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
const ORACLE_LRU_SIZE: usize = 1024;

Expand Down Expand Up @@ -195,6 +206,12 @@ where
Evm: EvmFactory<Spec = OpSpecId, BlockEnv = BlockEnv> + Send + Sync + Debug + Clone + 'static,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
// Run derivation for the first time to populate the witness data
let eigenda_preimage: EigenDAPreimage =
Expand Down Expand Up @@ -244,6 +261,12 @@ where
Evm: EvmFactory<Spec = OpSpecId, BlockEnv = BlockEnv> + Send + Sync + Debug + Clone + 'static,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
let beacon = OracleBlobProvider::new(oracle.clone());

Expand Down Expand Up @@ -279,6 +302,12 @@ where
Evm: EvmFactory<Spec = OpSpecId, BlockEnv = BlockEnv> + Send + Sync + Debug + Clone + 'static,
<Evm as EvmFactory>::Tx:
FromTxWithEncoded<OpTxEnvelope> + FromRecoveredTx<OpTxEnvelope> + OpTxEnv,
OpBlockExecutorFactory<OpAlloyReceiptBuilder, RollupConfig, Evm>: for<'a> BlockExecutorFactory<
EvmFactory = Evm,
ExecutionCtx<'a> = OpBlockExecutionCtx,
Transaction = OpTxEnvelope,
Receipt = OpReceiptEnvelope,
>,
{
info!("start the code supposed to run inside zkVM");

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = '1.92'
channel = '1.94'
profile = 'minimal'
components = ['clippy', 'rustfmt']
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "i686-unknown-linux-gnu"]
Loading