Skip to content
Merged
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
291 changes: 153 additions & 138 deletions Cargo.lock

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,48 @@ version = "0.6.0"

[workspace.dependencies]
# openvm guest libs
openvm = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0" }
openvm-algebra-complex-macros = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-custom-insn = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-sha2 = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0" }
openvm-sha256-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-p256 = { git = "https://github.com/openvm-org/openvm.git", package = "p256", tag = "v1.4.0", features = [
openvm = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1" }
openvm-algebra-complex-macros = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-custom-insn = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-sha2 = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1" }
openvm-sha256-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-p256 = { git = "https://github.com/openvm-org/openvm.git", package = "p256", tag = "v1.4.1", features = [
"std",
] }
openvm-k256 = { git = "https://github.com/openvm-org/openvm.git", package = "k256", tag = "v1.4.0", features = [
openvm-k256 = { git = "https://github.com/openvm-org/openvm.git", package = "k256", tag = "v1.4.1", features = [
"std",
] }
openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0" }
openvm-keccak256-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-bigint-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-pairing-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-rv32im-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-pairing = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1" }
openvm-keccak256-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-bigint-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-pairing-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-rv32im-guest = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }

# openvm host libs
openvm-benchmarks-prove = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-benchmarks-utils = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-build = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-instructions = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-native-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-native-compiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-native-recursion = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-native-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false, features = [
openvm-benchmarks-prove = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-benchmarks-utils = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-build = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-instructions = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-native-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-native-compiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-native-recursion = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-native-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }
openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false, features = [
"parallel",
"evm-prove",
"legacy-v1-3",
"tco",
"unprotected"
] }
openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.0", default-features = false }
openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.4.1", default-features = false }

# more openvm related libs
openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", tag = "v1.2.0" }
openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", tag = "v1.2.1" }

sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-helpers = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion crates/circuits/batch-circuit/batch_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [895296330, 1148458384, 132512161, 428973880, 1840310420, 1233162636, 1450429136, 1332854351];
pub const COMMIT: [u32; 8] = [1202988051, 1148264508, 1543561268, 1765749557, 1182656731, 396804521, 834486540, 1245597015];
2 changes: 1 addition & 1 deletion crates/circuits/bundle-circuit/bundle_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [1257908223, 1206458759, 1468660351, 59874919, 689770277, 1592610906, 773480905, 1252681164];
pub const COMMIT: [u32; 8] = [373288848, 1343506321, 1914796275, 1793072527, 65733832, 1916923301, 963694893, 639345462];
2 changes: 1 addition & 1 deletion crates/circuits/chunk-circuit/chunk_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [988980860, 377520490, 1389793144, 1577198725, 851225072, 192704613, 306102683, 816798173];
pub const COMMIT: [u32; 8] = [1957156571, 872843267, 744762733, 1147670747, 1109472993, 163434507, 1792562840, 1106326803];
7 changes: 3 additions & 4 deletions crates/integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,11 @@ where
std::fs::create_dir_all(&cache_dir)?;

// Dump verifier-only assets to disk.
let path_verifier_code = WORKSPACE_ROOT
let path_verifier_dir = WORKSPACE_ROOT
.join("releases")
.join(guest_version())
.join("verifier")
.join("verifier.bin");
let verifier = scroll_zkvm_verifier::verifier::UniversalVerifier::setup(&path_verifier_code)?;
.join("verifier");
let verifier = scroll_zkvm_verifier::verifier::UniversalVerifier::setup(&path_verifier_dir)?;

// Try reading proof from cache if available, and early return in that case.
let task_id = witness.identifier();
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/utils/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn execute_guest(
let state = instance
.execute(stdin.clone(), None)
.map_err(|e| Error::GenProof(e.to_string()))?;
let total_cycle = state.instret;
let total_cycle = state.instret();
let final_memory = state.memory;

let public_values: Vec<u8> =
Expand Down
6 changes: 0 additions & 6 deletions crates/types/base/src/public_inputs/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ impl MultiVersionPublicInputs for ChunkInfo {
assert_eq!(prev_pi.post_msg_queue_hash, B256::ZERO);
}

// blockhash is unused for scroll domain.
if version.domain == Domain::Scroll {
assert_eq!(self.prev_blockhash, B256::ZERO);
assert_eq!(self.post_blockhash, B256::ZERO);
}

// - blockhash chaining must be validated for validiums.
// - encryption key must be the same between contiguous chunks in a batch.
if version.domain == Domain::Validium {
Expand Down
2 changes: 1 addition & 1 deletion crates/types/chunk/src/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ mod execute;
pub use execute::execute;

mod witness;
pub use witness::{ChunkWitness, ChunkWitnessWithRspTrie, LegacyChunkWitness, ValidiumInputs};
pub use witness::{ChunkWitness, LegacyChunkWitness, ValidiumInputs};
49 changes: 0 additions & 49 deletions crates/types/chunk/src/scroll/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use alloy_primitives::B256;
use sbv_core::{verifier::StateCommitMode, witness::BlockWitness};
use sbv_primitives::U256;
use sbv_primitives::types::consensus::TxL1Message;
use sbv_trie::PartialStateTrie;
use std::collections::HashSet;
use types_base::version::Version;
use types_base::{fork_name::ForkName, public_inputs::chunk::ChunkInfo};
Expand All @@ -25,25 +24,6 @@ pub struct ChunkWitness {
pub validium: Option<ValidiumInputs>,
}

/// The witness type accepted by the chunk-circuit.
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct ChunkWitnessWithRspTrie {
/// Version byte as per [version][types_base::version].
pub version: u8,
/// The block witness for each block in the chunk.
pub blocks: Vec<BlockWitness>,
/// The on-chain rolling L1 message queue hash before enqueueing any L1 msg tx from the chunk.
pub prev_msg_queue_hash: B256,
/// The code version specify the chain spec
pub fork_name: ForkName,
/// The compression ratios for each block in the chunk.
pub compression_ratios: Vec<Vec<U256>>,
/// The cached partial state trie for the chunk.
pub cached_trie: PartialStateTrie,
/// Validium encrypted txs and secret key if this is a validium chain.
pub validium: Option<ValidiumInputs>,
}

/// The validium inputs for the chunk witness.
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct ValidiumInputs {
Expand Down Expand Up @@ -208,32 +188,3 @@ impl From<ChunkWitness> for LegacyChunkWitness {
}
}
}

impl From<ChunkWitness> for ChunkWitnessWithRspTrie {
fn from(mut value: ChunkWitness) -> Self {
let pre_state_root = value
.blocks
.first()
.expect("at least one block")
.prev_state_root;
let cached_trie = PartialStateTrie::new(
pre_state_root,
value.blocks.iter().flat_map(|w| w.states.iter()),
)
.expect("trie from witness");

for block in value.blocks.iter_mut() {
block.states.clear();
}

ChunkWitnessWithRspTrie {
version: value.version,
blocks: value.blocks,
prev_msg_queue_hash: value.prev_msg_queue_hash,
fork_name: value.fork_name,
compression_ratios: value.compression_ratios,
cached_trie,
validium: value.validium,
}
}
}