Skip to content

Commit 959e424

Browse files
committed
refactor for workspace
1 parent e89934d commit 959e424

File tree

9 files changed

+9401
-111
lines changed

9 files changed

+9401
-111
lines changed

Cargo.lock

Lines changed: 9313 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[workspace]
2+
members = [
3+
"common/libzkp/impl",
4+
"zkvm-prover",
5+
]
6+
7+
resolver = "2"
8+
9+
[workspace.package]
10+
authors = ["Scroll developers"]
11+
edition = "2021"
12+
homepage = "https://scroll.io"
13+
readme = "README.md"
14+
repository = "https://github.com/scroll-tech/scroll"
15+
version = "4.5.8"
16+
17+
[workspace.dependencies]
18+
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", branch = "feat/sep_types", package = "scroll-zkvm-prover" }
19+
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", branch = "feat/sep_types", package = "scroll-zkvm-verifier" }
20+
21+
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = ["scroll"] }
22+
23+
metrics = "0.23.0"
24+
metrics-util = "0.17"
25+
metrics-tracing-context = "0.16.0"
26+
27+
anyhow = "1.0"
28+
alloy = { version = "0.11", default-features = false }
29+
alloy-primitives = { version = "0.8", default-features = false }
30+
# also use this to trigger "serde" feature for primitives
31+
alloy-serde = { version = "0.8", default-features = false }
32+
33+
rkyv = "0.8"
34+
serde = { version = "1", default-features = false, features = ["derive"] }
35+
serde_json = { version = "1.0" }
36+
serde_derive = "1.0"
37+
serde_with = "3.11.0"
38+
itertools = "0.14"
39+
tiny-keccak = "2.0"
40+
tracing = "0.1"
41+
eyre = "0.6"
42+
bincode_v1 = { version = "1.3", package = "bincode"}
43+
snark-verifier-sdk = { version = "0.2.0", default-features = false, features = [
44+
"loader_halo2",
45+
"halo2-axiom",
46+
"display",
47+
] }
48+
once_cell = "1.20"
49+
base64 = "0.22"
50+
51+
#TODO: upgrade
52+
vm-zstd = { git = "https://github.com/scroll-tech/rust-zstd-decompressor.git", tag = "v0.1.1" }
53+
54+
[patch.crates-io]
55+
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.18-euclid-upgrade" }
56+
ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }
57+
tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-euclid-upgrade" }
58+
59+
[profile.maxperf]
60+
inherits = "release"
61+
lto = "fat"
62+
codegen-units = 1

common/libzkp/impl/Cargo.toml

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,22 @@ edition = "2021"
77
[lib]
88
crate-type = ["cdylib"]
99

10-
[patch.crates-io]
11-
# patched add rkyv support & MSRV 1.77
12-
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.21" }
13-
ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }
14-
tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-openvm-v1.0.0-rc.1" }
15-
1610
[dependencies]
17-
euclid_prover = { git = "https://github.com/scroll-tech/zkvm-prover.git", tag = "v0.4.2", package = "scroll-zkvm-prover" }
18-
euclid_verifier = { git = "https://github.com/scroll-tech/zkvm-prover.git", tag = "v0.4.2", package = "scroll-zkvm-verifier" }
11+
scroll-zkvm-verifier-euclid.workspace = true
12+
13+
base64.workspace = true
14+
once_cell.workspace = true
15+
serde.workspace = true
16+
serde_derive.workspace = true
17+
serde_json.workspace = true
18+
anyhow.workspace = true
19+
tracing.workspace = true
1920

20-
base64 = "0.13.0"
21-
env_logger = "0.9.0"
2221
libc = "0.2"
23-
log = "0.4"
24-
once_cell = "1.19"
25-
serde = "1.0"
26-
serde_derive = "1.0"
27-
serde_json = "1.0.66"
28-
anyhow = "1.0.86"
2922

3023
[profile.test]
3124
opt-level = 3
3225

3326
[profile.release]
3427
opt-level = 3
3528

36-
[patch."https://github.com/openvm-org/stark-backend.git"]
37-
openvm-stark-backend = { git = "ssh://[email protected]/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] }
38-
openvm-stark-sdk = { git = "ssh://[email protected]/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] }
39-
40-
[patch."https://github.com/Plonky3/Plonky3.git"]
41-
p3-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
42-
p3-field = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
43-
p3-commit = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
44-
p3-matrix = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
45-
p3-baby-bear = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", features = [
46-
"nightly-features",
47-
], tag = "v0.2.0" }
48-
p3-koala-bear = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
49-
p3-util = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
50-
p3-challenger = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
51-
p3-dft = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
52-
p3-fri = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
53-
p3-goldilocks = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
54-
p3-keccak = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
55-
p3-keccak-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
56-
p3-blake3 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
57-
p3-mds = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
58-
p3-merkle-tree = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
59-
p3-monty-31 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
60-
p3-poseidon = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
61-
p3-poseidon2 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
62-
p3-poseidon2-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
63-
p3-symmetric = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
64-
p3-uni-stark = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
65-
p3-maybe-rayon = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" } # the "parallel" feature is NOT on by default to allow single-threaded benchmarking
66-
p3-bn254-fr = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }

common/libzkp/impl/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ fn verify_proof(proof: *const c_char, fork_name: *const c_char, task_type: TaskT
3030
let verifier = verifier::get_verifier(fork_name_str);
3131

3232
if let Err(e) = verifier {
33-
log::warn!("failed to get verifier, error: {:#}", e);
33+
tracing::warn!("failed to get verifier, error: {:#}", e);
3434
return 0 as c_char;
3535
}
3636
match verifier.unwrap().verify(task_type, proof) {
3737
Err(e) => {
38-
log::error!("{:?} verify failed, error: {:#}", task_type, e);
38+
tracing::error!("{:?} verify failed, error: {:#}", task_type, e);
3939
false as c_char
4040
}
4141
Ok(result) => result as c_char,

common/libzkp/impl/src/verifier/euclidv2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anyhow::Result;
44

55
use crate::utils::panic_catch;
66
use euclid_prover::{BatchProof, BundleProof, ChunkProof};
7-
use euclid_verifier::verifier::{BatchVerifier, BundleVerifierEuclidV2, ChunkVerifier};
7+
use scroll_zkvm_verifier_euclid::verifier::{BatchVerifier, BundleVerifierEuclidV2, ChunkVerifier};
88
use std::{fs::File, path::Path};
99

1010
pub struct EuclidV2Verifier {

rust-toolchain

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "nightly-2025-02-14"
3+
targets = ["riscv32im-unknown-none-elf", "x86_64-unknown-linux-gnu"]

zkvm-prover/Cargo.toml

Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,25 @@ edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

8-
[patch.crates-io]
9-
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.21" }
10-
ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }
11-
tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-openvm-v1.0.0-rc.1" }
12-
138
[dependencies]
14-
anyhow = "1.0"
15-
log = "0.4"
16-
env_logger = "0.11.3"
17-
serde = { version = "1.0.198", features = ["derive"] }
18-
serde_json = "1.0.116"
9+
scroll-zkvm-prover-euclid.workspace = true
10+
sbv-primitives.workspace = true
11+
scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", branch = "refactor/scroll" }
12+
serde.workspace = true
13+
serde_json.workspace = true
14+
once_cell.workspace =true
15+
base64.workspace = true
16+
tiny-keccak = { workspace = true, features = ["sha3", "keccak"] }
17+
anyhow.workspace = true
18+
1919
futures = "0.3.30"
2020

21-
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", tag = "v0.4.2", package = "scroll-zkvm-prover" }
22-
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
23-
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
24-
scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", branch = "main", features = [
25-
"openvm",
26-
] }
27-
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = [
28-
"scroll",
29-
] }
30-
base64 = "0.13.1"
3121
reqwest = { version = "0.12.4", features = ["gzip"] }
3222
reqwest-middleware = "0.3"
3323
reqwest-retry = "0.5"
34-
once_cell = "1.19.0"
3524
hex = "0.4.3"
36-
tiny-keccak = { version = "2.0.0", features = ["sha3", "keccak"] }
25+
3726
rand = "0.8.5"
38-
eth-keystore = "0.5.0"
39-
rlp = "0.5.2"
4027
tokio = "1.37.0"
4128
async-trait = "0.1"
4229
sled = "0.34.7"
@@ -45,35 +32,3 @@ clap = { version = "4.5", features = ["derive"] }
4532
ctor = "0.2.8"
4633
url = "2.5.4"
4734
serde_bytes = "0.11.15"
48-
49-
[patch."https://github.com/openvm-org/stark-backend.git"]
50-
openvm-stark-backend = { git = "ssh://[email protected]/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] }
51-
openvm-stark-sdk = { git = "ssh://[email protected]/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] }
52-
53-
[patch."https://github.com/Plonky3/Plonky3.git"]
54-
p3-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
55-
p3-field = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
56-
p3-commit = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
57-
p3-matrix = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
58-
p3-baby-bear = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", features = [
59-
"nightly-features",
60-
], tag = "v0.2.0" }
61-
p3-koala-bear = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
62-
p3-util = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
63-
p3-challenger = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
64-
p3-dft = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
65-
p3-fri = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
66-
p3-goldilocks = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
67-
p3-keccak = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
68-
p3-keccak-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
69-
p3-blake3 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
70-
p3-mds = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
71-
p3-merkle-tree = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
72-
p3-monty-31 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
73-
p3-poseidon = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
74-
p3-poseidon2 = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
75-
p3-poseidon2-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
76-
p3-symmetric = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
77-
p3-uni-stark = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }
78-
p3-maybe-rayon = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" } # the "parallel" feature is NOT on by default to allow single-threaded benchmarking
79-
p3-bn254-fr = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.0" }

zkvm-prover/rust-toolchain

Lines changed: 0 additions & 1 deletion
This file was deleted.

zkvm-prover/src/types.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use serde::{Deserialize, Deserializer, Serialize, Serializer};
22

3-
use scroll_proving_sdk::prover::types::CircuitType;
4-
53
#[derive(Serialize, Deserialize, Default)]
64
pub struct Task {
75
#[serde(rename = "type", default)]
8-
pub task_type: CircuitType,
96
pub task_data: String,
107
#[serde(default)]
118
pub hard_fork_name: String,
@@ -15,7 +12,6 @@ pub struct Task {
1512
pub struct ProofDetail {
1613
pub id: String,
1714
#[serde(rename = "type", default)]
18-
pub proof_type: CircuitType,
1915
pub proof_data: String,
2016
pub error: String,
2117
}

0 commit comments

Comments
 (0)