Skip to content

Commit 75289ce

Browse files
authored
rename: leaf->vm; root->stark; (#154)
* rename: leaf->vm; root->stark; * minor
1 parent 0deffb1 commit 75289ce

File tree

16 files changed

+77
-87
lines changed

16 files changed

+77
-87
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Dockerfile.backup
1111

1212
docs
1313

14+
releases
15+
1416
*.yml
1517

1618
*.sh

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ openvm-bigint-guest = { git = "https://github.com/openvm-org/openvm.git", rev =
4141
openvm-pairing-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "5368d4756993fc1e51092499a816867cf4808de0", default-features = false }
4242
openvm-rv32im-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "5368d4756993fc1e51092499a816867cf4808de0", default-features = false }
4343

44-
# openvm guest libs
44+
# openvm host libs
4545
openvm-build = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.2.1-rc.1", default-features = false }
4646
openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.2.1-rc.1", default-features = false }
4747
openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.2.1-rc.1", default-features = false }
@@ -64,8 +64,6 @@ sbv-kv = { git = "https://github.com/scroll-tech/stateless-block-verifier", bran
6464
sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" }
6565
sbv-precompile = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" }
6666

67-
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth", rev = "090d7950d169abbfb896875a7b1ff3f8ca356ac8", default-features = false }
68-
6967

7068
alloy-primitives = { version = "1.2", default-features = false, features = ["std", "map-hashbrown", "map-fxhash", "rkyv"] }
7169
alloy-serde = { version = "1.0.13", default-features = false }

crates/build-guest/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ fn run_stage4_dump_vk_json(
295295
{
296296
let app_vk = scroll_zkvm_types::types_agg::ProgramCommitment {
297297
exe: *exe,
298-
leaf: *leaf,
298+
vm: *leaf,
299299
}
300300
.serialize();
301301

crates/circuits/batch-circuit/src/circuit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ impl AggCircuit for BatchCircuit {
4848

4949
fn verify_commitments(commitment: &ProgramCommitment) {
5050
assert_eq!(
51-
commitment.leaf,
51+
commitment.vm,
5252
child_commitments::LEAF_COMMIT,
5353
"mismatch chunk-proof leaf commitment: expected={:?}, got={:?}",
5454
child_commitments::LEAF_COMMIT,
55-
commitment.leaf,
55+
commitment.vm,
5656
);
5757
assert_eq!(
5858
commitment.exe,

crates/circuits/bundle-circuit/src/circuit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ impl AggCircuit for BundleCircuit {
4141

4242
fn verify_commitments(commitment: &ProgramCommitment) {
4343
assert_eq!(
44-
commitment.leaf,
44+
commitment.vm,
4545
child_commitments::LEAF_COMMIT,
4646
"mismatch batch-proof leaf commitment: expected={:?}, got={:?}",
4747
child_commitments::LEAF_COMMIT,
48-
commitment.leaf,
48+
commitment.vm,
4949
);
5050
assert_eq!(
5151
commitment.exe,

crates/integration/src/lib.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use scroll_zkvm_prover::{
66
utils::{read_json, vm::ExecutionResult, write_json},
77
};
88
use scroll_zkvm_types::{
9-
proof::{EvmProof, ProofEnum, RootProof},
9+
proof::{EvmProof, ProofEnum, StarkProof},
1010
public_inputs::ForkName,
1111
};
1212
use scroll_zkvm_verifier::verifier::UniversalVerifier;
@@ -155,7 +155,7 @@ pub trait ProverTester {
155155

156156
fn build_guest_input<'a>(
157157
witness: &Self::Witness,
158-
aggregated_proofs: impl Iterator<Item = &'a RootProof>,
158+
aggregated_proofs: impl Iterator<Item = &'a StarkProof>,
159159
) -> Result<StdIn, rkyv::rancor::Error> {
160160
use openvm_native_recursion::hints::Hintable;
161161

@@ -270,7 +270,7 @@ pub fn tester_execute<T: ProverTester>(
270270
witness,
271271
proofs
272272
.iter()
273-
.map(|p| p.as_root_proof().expect("must be stark proof")),
273+
.map(|p| p.as_stark_proof().expect("must be stark proof")),
274274
)?;
275275

276276
let ret = prover.execute_and_check_with_full_result(&stdin)?;
@@ -307,7 +307,7 @@ pub fn prove_verify<T: ProverTester>(
307307
witness,
308308
proofs
309309
.iter()
310-
.map(|p| p.as_root_proof().expect("must be stark proof")),
310+
.map(|p| p.as_stark_proof().expect("must be stark proof")),
311311
)?;
312312
// Construct stark proof for the circuit.
313313
let proof = prover.gen_proof_stark(stdin)?.into();
@@ -318,7 +318,10 @@ pub fn prove_verify<T: ProverTester>(
318318
};
319319

320320
// Verify proof.
321-
UniversalVerifier::verify_proof(proof.as_root_proof().expect("should be stark proof"), &vk)?;
321+
UniversalVerifier::verify_stark_proof(
322+
proof.as_stark_proof().expect("should be stark proof"),
323+
&vk,
324+
)?;
322325

323326
Ok(proof)
324327
}
@@ -363,7 +366,7 @@ where
363366
witness,
364367
proofs
365368
.iter()
366-
.map(|p| p.as_root_proof().expect("must be stark proof")),
369+
.map(|p| p.as_stark_proof().expect("must be stark proof")),
367370
)?;
368371
// Construct stark proof for the circuit.
369372
let proof: EvmProof = prover.gen_proof_snark(stdin)?.into();
@@ -374,16 +377,14 @@ where
374377

375378
let vk = prover.get_app_vk();
376379
// Verify proof.
377-
assert!(
378-
verifier.verify_proof_evm(
379-
&proof
380-
.clone()
381-
.into_evm_proof()
382-
.expect("must be evm proof")
383-
.into(),
384-
&vk,
385-
)?
386-
);
380+
verifier.verify_evm_proof(
381+
&proof
382+
.clone()
383+
.into_evm_proof()
384+
.expect("must be evm proof")
385+
.into(),
386+
&vk,
387+
)?;
387388

388389
Ok((proof, verifier, path_assets))
389390
}

crates/integration/tests/batch_circuit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn test_e2e_execute() -> eyre::Result<()> {
4848

4949
let stdin = BatchProverTester::build_guest_input(
5050
&wit,
51-
agg_proofs.iter().map(|p| p.as_root_proof().unwrap()),
51+
agg_proofs.iter().map(|p| p.as_stark_proof().unwrap()),
5252
)?;
5353
let _ = prover.execute_and_check_with_full_result(&stdin)?;
5454

crates/integration/tests/chunk_circuit.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ fn exec_chunk(prover: &Prover, wit: &ChunkWitness) -> eyre::Result<(ExecutionRes
2323
let cycle_count = exec_result.total_cycle as u64;
2424
let cycle_per_gas = cycle_count / stats.total_gas_used;
2525
println!(
26-
"blk {blk}->{}, cycle {cycle_count}, gas {}, cycle-per-gas {cycle_per_gas}, tick-per-gas {}",
26+
"blk {blk}->{}, cycle {cycle_count}, gas {}, cycle-per-gas {cycle_per_gas}",
2727
wit.blocks.last().unwrap().header.number,
2828
stats.total_gas_used,
29-
exec_result.total_tick as u64 / stats.total_gas_used,
3029
);
3130
Ok((exec_result, stats.total_gas_used))
3231
}
@@ -140,30 +139,27 @@ fn test_execute_multi() -> eyre::Result<()> {
140139
.build()
141140
.unwrap();
142141
// Execute tasks in parallel
143-
let (total_gas, total_cycle, total_tick) = pool.install(|| {
142+
let (total_gas, total_cycle) = pool.install(|| {
144143
// comment by [email protected]: why we need to load prover multiple times (which is time costing)
145144
let prover = ChunkProverTester::load_prover(false).unwrap();
146-
let init = (0u64, 0u64, 0u64);
147-
let adder = |(gas1, cycle1, tick1): (u64, u64, u64),
148-
(gas2, cycle2, tick2): (u64, u64, u64)| {
149-
(gas1 + gas2, cycle1 + cycle2, tick1 + tick2)
150-
};
145+
let init = (0u64, 0u64);
146+
let adder =
147+
|(gas1, cycle1): (u64, u64), (gas2, cycle2): (u64, u64)| (gas1 + gas2, cycle1 + cycle2);
151148
preset_chunk_multiple()
152149
.into_iter()
153-
.map(|task| -> (u64, u64, u64) {
150+
.map(|task| -> (u64, u64) {
154151
let (exec_result, gas) =
155152
exec_chunk(&prover, &task.gen_proving_witnesses().unwrap()).unwrap();
156-
(gas, exec_result.total_cycle, exec_result.total_tick)
153+
(gas, exec_result.total_cycle)
157154
})
158155
.fold(init, adder)
159156
});
160157

161158
println!(
162-
"Total gas: {}, Total cycles: {}, Average cycle/gas: {}, Average tick/gas: {}",
159+
"Total gas: {}, Total cycles: {}, Average cycle/gas: {}",
163160
total_gas,
164161
total_cycle,
165162
total_cycle as f64 / total_gas as f64,
166-
total_tick as f64 / total_gas as f64,
167163
);
168164

169165
Ok(())

crates/prover/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ version.workspace = true
99
scroll-zkvm-types.workspace = true
1010
scroll-zkvm-types-chunk = { workspace = true, features = ["scroll-compress-ratio"] }
1111
scroll-zkvm-verifier.workspace = true
12-
13-
scroll-alloy-evm = { workspace = true, features = ["std", "zstd_compression"] }
12+
scroll-zkvm-types-batch.workspace = true
1413

1514
alloy-primitives = { workspace = true, features = ["tiny-keccak"] }
1615
rkyv.workspace = true

0 commit comments

Comments
 (0)