Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bdf7826
rollback dep of zkvm-prover
noel2004 Nov 25, 2025
9839bf7
prover quit while proving process has panicked
noel2004 Nov 25, 2025
d262a63
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Nov 25, 2025
dc29c8c
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Nov 25, 2025
af63bc0
fix wrong configuration
noel2004 Nov 25, 2025
5c2803c
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Dec 3, 2025
5ae31bc
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Dec 3, 2025
98be0a0
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Dec 9, 2025
b244fa8
Merge remote-tracking branch 'origin/develop' into feat/prover_4.7
noel2004 Dec 16, 2025
e852915
update zkvm-prover
noel2004 Dec 16, 2025
b833468
add debug mode, trivial fixings
noel2004 Dec 16, 2025
930a12a
update zkvm-prover dep and openvm to 1.4.2
noel2004 Dec 16, 2025
3b174f8
add test data for mainnet galileo and prune feynman (can not be teste…
noel2004 Dec 16, 2025
74a3d7a
udpate zkvm-prover dep
noel2004 Dec 17, 2025
ede29c7
init dumper
noel2004 Dec 18, 2025
b270d96
dumper
noel2004 Dec 18, 2025
79d79ed
fix
noel2004 Dec 18, 2025
d306b38
fix
noel2004 Dec 18, 2025
03b992f
json mode
noel2004 Dec 18, 2025
492563f
Merge remote-tracking branch 'origin/develop' into feat/zkvm_prover_142
noel2004 Jan 16, 2026
6a57a2e
update dep of zkvm prover and trivial fixing
noel2004 Jan 16, 2026
8955d4f
Merge branch 'feat/zkvm_prover_143' into develop
noel2004 Feb 16, 2026
58297d3
fix e2e tool
noel2004 Feb 19, 2026
b76539b
update test env
noel2004 Feb 19, 2026
93f755c
update dep
noel2004 Feb 20, 2026
252eea9
use galileov2 for cloak test enviroment
noel2004 Feb 20, 2026
a35834d
fix make file in e2e test
noel2004 Feb 20, 2026
e1aa90b
update ZKVM_VERSION
noel2004 Feb 25, 2026
f2a9ba5
upgrade dep
noel2004 Mar 2, 2026
649c441
pump crates version
noel2004 Mar 2, 2026
09d83e1
udpate testing configuration
noel2004 Mar 6, 2026
fafcea4
Merge remote-tracking branch 'origin/develop' into feat/zkvm_prover_143
noel2004 Mar 13, 2026
bbe6c41
update proving-sdk
noel2004 Mar 18, 2026
766aa25
update zkvm-prover with patched openvm 1.4.3
noel2004 Mar 23, 2026
b4ccd70
update zkvm-prover and test stuff
noel2004 Mar 24, 2026
1408430
AI helper: init
noel2004 Feb 25, 2026
343ed78
refine the skill and update makefile
noel2004 Mar 24, 2026
ac40de8
agentic the local test
noel2004 Apr 13, 2026
7643561
add unit test agent
noel2004 Apr 14, 2026
949271c
fix "put into background" instruction
noel2004 Apr 14, 2026
00c407c
+ fix local memory instruction
noel2004 Apr 15, 2026
b19dac8
update ignore files
noel2004 Apr 15, 2026
b0575d9
update zkvm prover
lispc May 19, 2026
1e020b9
fix cargo check
Velaciela May 19, 2026
d595390
fix cargo fmt import ordering
Velaciela May 19, 2026
4657129
add docs
Velaciela May 19, 2026
d46829c
test e2e done
Velaciela May 19, 2026
13193e8
Merge origin/develop into feat/zkvm_prover_143
Velaciela May 19, 2026
4ac05e7
done
Velaciela May 20, 2026
37a43ba
fix ci
Velaciela May 20, 2026
7186b4a
remove coordinator-proxy in e2e test
Velaciela May 22, 2026
db1b42c
update .gitignore
lispc May 22, 2026
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
461 changes: 322 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ edition = "2021"
homepage = "https://scroll.io"
readme = "README.md"
repository = "https://github.com/scroll-tech/scroll"
version = "4.7.1"
version = "4.7.11"

[workspace.dependencies]
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "v0.7.1" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "v0.7.1" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "v0.7.1" }
# with openvm 1.4.2
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "4a78ca9" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "4a78ca9" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "4a78ca9" }
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", tag = "scroll-v91.2", features = ["scroll", "rkyv"] }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", tag = "scroll-v91.2" }
Expand Down
19 changes: 2 additions & 17 deletions crates/libzkp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,8 @@ use serde_json::value::RawValue;
use std::{collections::HashMap, path::Path, sync::OnceLock};
use tasks::chunk_interpreter::{ChunkInterpreter, TryFromWithInterpreter};

pub(crate) fn witness_use_legacy_mode(fork_name: &str) -> eyre::Result<bool> {
ADDITIONAL_FEATURES
.get()
.and_then(|features| features.get(fork_name))
.map(|cfg| cfg.legacy_witness_encoding)
.ok_or_else(|| {
eyre::eyre!(
"can not find features setting for unrecognized fork {}",
fork_name
)
})
}

#[derive(Debug, Default, Clone)]
struct FeatureOptions {
legacy_witness_encoding: bool,
for_openvm_13_prover: bool,
}

Expand All @@ -41,11 +27,10 @@ impl FeatureOptions {
for feat_s in feats.split(':') {
match feat_s.trim().to_lowercase().as_str() {
"legacy_witness" => {
tracing::info!("set witness encoding for legacy mode");
ret.legacy_witness_encoding = true;
tracing::warn!("legacy witness is no longer supported");
}
"openvm_13" => {
tracing::info!("set prover should use openvm 13");
tracing::warn!("set prover should use openvm 13");
ret.for_openvm_13_prover = true;
}
s => tracing::warn!("unrecognized dynamic feature: {s}"),
Expand Down
8 changes: 3 additions & 5 deletions crates/libzkp/src/proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ use crate::utils::short_git_version;
use eyre::Result;
use sbv_primitives::B256;
use scroll_zkvm_types::{
batch::BatchInfo,
bundle::BundleInfo,
chunk::ChunkInfo,
proof::{EvmProof, OpenVmEvmProof, ProofEnum, StarkProof},
public_inputs::MultiVersionPublicInputs,
scroll::{batch::BatchInfo, bundle::BundleInfo, chunk::ChunkInfo},
types_agg::AggregationInput,
utils::{serialize_vk, vec_as_base64},
version,
Expand Down Expand Up @@ -215,7 +213,7 @@ impl<Metadata: ProofMetadata> PersistableProof for WrappedProof<Metadata> {
mod tests {
use base64::{prelude::BASE64_STANDARD, Engine};
use sbv_primitives::B256;
use scroll_zkvm_types::{bundle::BundleInfo, proof::EvmProof};
use scroll_zkvm_types::{proof::EvmProof, scroll::bundle::BundleInfo};

use super::*;

Expand Down Expand Up @@ -253,7 +251,7 @@ mod tests {
msg_queue_hash: B256::repeat_byte(6),
encryption_key: None,
};
let bundle_pi_hash = bundle_info.pi_hash_euclidv1();
let bundle_pi_hash = bundle_info.pi_hash_by_version(version::Version::euclid_v1());
BundleProofMetadata {
bundle_info,
bundle_pi_hash,
Expand Down
22 changes: 9 additions & 13 deletions crates/libzkp/src/tasks/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use c_kzg::Bytes48;
use eyre::Result;
use sbv_primitives::{B256, U256};
use scroll_zkvm_types::{
batch::{
build_point_eval_witness, BatchHeader, BatchHeaderV6, BatchHeaderV7, BatchHeaderValidium,
BatchInfo, BatchWitness, Envelope, EnvelopeV6, EnvelopeV7, LegacyBatchWitness,
ReferenceHeader, N_BLOB_BYTES,
},
chunk::ChunkInfo,
public_inputs::{ForkName, MultiVersionPublicInputs, Version},
scroll::{
batch::{
build_point_eval_witness, BatchHeader, BatchHeaderV6, BatchHeaderV7,
BatchHeaderValidium, BatchInfo, BatchWitness, Envelope, EnvelopeV6, EnvelopeV7,
ReferenceHeader, N_BLOB_BYTES,
},
chunk::ChunkInfo,
},
task::ProvingTask,
utils::{to_rkyv_bytes, RancorError},
version::{Codec, Domain, STFVersion},
};

Expand Down Expand Up @@ -118,12 +119,7 @@ pub struct BatchProvingTask {
impl BatchProvingTask {
pub fn into_proving_task_with_precheck(self) -> Result<(ProvingTask, BatchInfo, B256)> {
let (witness, metadata, batch_pi_hash) = self.precheck()?;
let serialized_witness = if crate::witness_use_legacy_mode(&self.fork_name)? {
let legacy_witness = LegacyBatchWitness::from(witness);
to_rkyv_bytes::<RancorError>(&legacy_witness)?.into_vec()
} else {
super::encode_task_to_witness(&witness)?
};
let serialized_witness = super::encode_task_to_witness(&witness)?;

let proving_task = ProvingTask {
identifier: self.batch_header.batch_hash().to_string(),
Expand Down
10 changes: 2 additions & 8 deletions crates/libzkp/src/tasks/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use eyre::Result;
use sbv_primitives::B256;
use scroll_zkvm_types::{
bundle::{BundleInfo, BundleWitness, LegacyBundleWitness},
public_inputs::{MultiVersionPublicInputs, Version},
scroll::bundle::{BundleInfo, BundleWitness},
task::ProvingTask,
utils::{to_rkyv_bytes, RancorError},
};

use crate::proofs::BatchProof;
Expand All @@ -27,12 +26,7 @@ pub struct BundleProvingTask {
impl BundleProvingTask {
pub fn into_proving_task_with_precheck(self) -> Result<(ProvingTask, BundleInfo, B256)> {
let (witness, bundle_info, bundle_pi_hash) = self.precheck()?;
let serialized_witness = if crate::witness_use_legacy_mode(&self.fork_name)? {
let legacy = LegacyBundleWitness::from(witness);
to_rkyv_bytes::<RancorError>(&legacy)?.into_vec()
} else {
super::encode_task_to_witness(&witness)?
};
let serialized_witness = super::encode_task_to_witness(&witness)?;

let proving_task = ProvingTask {
identifier: self.identifier(),
Expand Down
10 changes: 2 additions & 8 deletions crates/libzkp/src/tasks/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ use eyre::Result;
use sbv_core::BlockWitness;
use sbv_primitives::{types::consensus::BlockHeader, B256};
use scroll_zkvm_types::{
chunk::{execute, ChunkInfo, ChunkWitness, LegacyChunkWitness, ValidiumInputs},
public_inputs::{MultiVersionPublicInputs, Version},
scroll::chunk::{execute, ChunkInfo, ChunkWitness, ValidiumInputs},
task::ProvingTask,
utils::{to_rkyv_bytes, RancorError},
};

use super::chunk_interpreter::*;
Expand Down Expand Up @@ -117,12 +116,7 @@ impl ChunkProvingTask {

pub fn into_proving_task_with_precheck(self) -> Result<(ProvingTask, ChunkInfo, B256)> {
let (witness, chunk_info, chunk_pi_hash) = self.precheck()?;
let serialized_witness = if crate::witness_use_legacy_mode(&self.fork_name)? {
let legacy_witness = LegacyChunkWitness::from(witness);
to_rkyv_bytes::<RancorError>(&legacy_witness)?.into_vec()
} else {
super::encode_task_to_witness(&witness)?
};
let serialized_witness = super::encode_task_to_witness(&witness)?;

let proving_task = ProvingTask {
identifier: self.identifier(),
Expand Down
3 changes: 2 additions & 1 deletion crates/prover-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition.workspace = true
scroll-zkvm-types.workspace = true
scroll-zkvm-prover.workspace = true
libzkp = { path = "../libzkp"}
scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", rev = "05648db" }
scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", rev = "22ad34e" }
serde.workspace = true
serde_json.workspace = true
once_cell.workspace =true
Expand All @@ -34,6 +34,7 @@ clap = { version = "4.5", features = ["derive"] }
ctor = "0.2.8"
url = { version = "2.5.4", features = ["serde",] }
serde_bytes = "0.11.15"
bincode = { version = "2.0", features = ["serde",] }

[features]
default = []
Expand Down
88 changes: 88 additions & 0 deletions crates/prover-bin/src/dumper.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
use async_trait::async_trait;
use libzkp::ProvingTaskExt;
use scroll_proving_sdk::prover::{
proving_service::{
GetVkRequest, GetVkResponse, ProveRequest, ProveResponse, QueryTaskRequest,
QueryTaskResponse, TaskStatus,
},
ProvingService,
};
use scroll_zkvm_types::ProvingTask;

#[derive(Default)]
pub struct Dumper {
#[allow(dead_code)]
pub target_path: String,
pub json_mode: bool,
Comment thread
lispc marked this conversation as resolved.
}

impl Dumper {
fn dump(&self, input_string: &str) -> eyre::Result<()> {
let task: ProvingTaskExt = serde_json::from_str(input_string)?;
let task = ProvingTask::from(task);

if self.json_mode {
let file = std::fs::File::create("input_task.json")?;
serde_json::to_writer(std::io::BufWriter::new(file), &task)?;
} else {
// stream-encode serialized_witness to input_task.bin using bincode 2.0
let input_file = std::fs::File::create("input_task.bin")?;
let mut input_writer = std::io::BufWriter::new(input_file);
bincode::encode_into_std_write(
&task.serialized_witness,
&mut input_writer,
bincode::config::standard(),
)?;

// stream-encode aggregated_proofs to agg_proofs.bin using bincode 2.0
let agg_file = std::fs::File::create("agg_proofs.bin")?;
let mut agg_writer = std::io::BufWriter::new(agg_file);
for proof in &task.aggregated_proofs {
let sz = bincode::serde::encode_into_std_write(
&proof.proofs,
&mut agg_writer,
bincode::config::standard(),
)?;
println!("written {sz} bytes for proof");
}
}

Ok(())
}
}

#[async_trait]
impl ProvingService for Dumper {
fn is_local(&self) -> bool {
true
}
async fn get_vks(&self, _: GetVkRequest) -> GetVkResponse {
// get vk has been deprecated in new prover with dynamic asset loading scheme
GetVkResponse {
vks: vec![],
error: None,
}
}
async fn prove(&mut self, req: ProveRequest) -> ProveResponse {
let error = if let Err(e) = self.dump(&req.input) {
Some(format!("failed to dump: {}", e))
} else {
None
};

ProveResponse {
status: TaskStatus::Failed,
error,
..Default::default()
}
}

async fn query_task(&mut self, req: QueryTaskRequest) -> QueryTaskResponse {
QueryTaskResponse {
task_id: req.task_id,
status: TaskStatus::Failed,
error: Some("dump file finished but need a fail return to exit".to_string()),
..Default::default()
}
}
}
46 changes: 45 additions & 1 deletion crates/prover-bin/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
mod dumper;
mod prover;
mod types;
mod zk_circuits_handler;

use clap::{ArgAction, Parser, Subcommand};
use clap::{ArgAction, Parser, Subcommand, ValueEnum};
use prover::{LocalProver, LocalProverConfig};
use scroll_proving_sdk::{
prover::{types::ProofType, ProverBuilder},
Expand Down Expand Up @@ -32,12 +33,35 @@ struct Args {
command: Option<Commands>,
}

#[derive(Clone, Debug, PartialEq, Eq, ValueEnum)]
enum TaskType {
Chunk,
Batch,
Bundle,
}

impl From<TaskType> for ProofType {
fn from(value: TaskType) -> Self {
match value {
TaskType::Chunk => ProofType::Chunk,
TaskType::Batch => ProofType::Batch,
TaskType::Bundle => ProofType::Bundle,
}
}
}

#[derive(Subcommand, Debug)]
enum Commands {
Handle {
/// path to save the verifier's asset
task_path: String,
},
Dump {
#[arg(long = "json", default_value = "false")]
json_mode: bool,
Comment thread
lispc marked this conversation as resolved.
task_type: TaskType,
task_id: String,
},
}

#[derive(Debug, serde::Deserialize)]
Expand All @@ -63,6 +87,26 @@ async fn main() -> eyre::Result<()> {
let local_prover = LocalProver::new(cfg.clone());

match args.command {
Some(Commands::Dump {
json_mode,
task_type,
task_id,
}) => {
let prover = ProverBuilder::new(
sdk_config,
dumper::Dumper {
json_mode,
..Default::default()
},
)
.build()
.await
.map_err(|e| eyre::eyre!("build prover fail: {e}"))?;

std::sync::Arc::new(prover)
.one_shot(&[task_id], task_type.into())
.await;
Comment thread
lispc marked this conversation as resolved.
}
Some(Commands::Handle { task_path }) => {
let file = File::open(Path::new(&task_path))?;
let reader = BufReader::new(file);
Expand Down
Loading