Skip to content

Test/patching #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: refactor/build-guest
Choose a base branch
from
Draft
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
510 changes: 336 additions & 174 deletions Cargo.lock

Large diffs are not rendered by default.

94 changes: 0 additions & 94 deletions Cargo.toml

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.toml
94 changes: 94 additions & 0 deletions Cargo.toml.cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[workspace]
members = [
"crates/circuits/chunk-circuit",
"crates/circuits/batch-circuit",
"crates/circuits/bundle-circuit",
"crates/circuits/types",
"crates/prover",
"crates/verifier",
"crates/integration",
"crates/build-guest",
]
resolver = "2"

[workspace.package]
authors = ["Scroll developers"]
edition = "2021"
homepage = "https://github.com/scroll-tech/zkvm-prover"
readme = "README.md"
repository = "https://github.com/scroll-tech/zkvm-prover"
version = "0.2.0"

[workspace.dependencies]
openvm = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-algebra-complex-macros = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-algebra-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-bigint-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-build = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-circuit = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-custom-insn = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-continuations = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-ecc-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-instructions ={ git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-keccak256-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-native-circuit = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-native-compiler = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-native-recursion = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-native-transpiler = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-pairing-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-rv32im-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false, features = ["parallel", "bench-metrics"] }
openvm-sha256-guest = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }
openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", rev = "3c35e9f", default-features = false }

openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", rev = "b051e8978da9c829a76b262abf4a9736c8d1681e" }

sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = ["scroll"] }
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = ["scroll"] }
sbv-kv = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade" }
sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade" }

alloy-primitives = { version = "0.8", default-features = false }
alloy-serde = { version = "0.8", default-features = false }
bitcode = { version = "0.6.5", default-features = false, features = ["serde", "derive"] }
bincode_v1 = { version = "1.3", package = "bincode"}
derivative = "2.2.0"
eyre = "0.6"
halo2curves-axiom = { version = "0.5.3" }
itertools = "0.14"
hex-literal = { version = "0.4.1", default-features = false }
metrics = "0.23.0"
metrics-util = "0.17"
metrics-tracing-context = "0.16.0"
p3-field = { git = "https://github.com/Plonky3/Plonky3.git", rev = "88d7f05" }
rayon = "1.10"
rkyv = "0.8"
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = { version = "1.0" }
serde_with = "3.11.0"
snark-verifier-sdk = { version = "0.2.0", default-features = false, features = [
"loader_halo2",
"halo2-axiom",
"display",
] }
tiny-keccak = "2.0"
tracing = "0.1"
vm-zstd = { git = "https://github.com/scroll-tech/rust-zstd-decompressor.git", tag = "v0.1.1" }
toml = "0.8.14"
tracing-subscriber = "0.3"

scroll-zkvm-circuit-input-types = { path = "crates/circuits/types" }
scroll-zkvm-integration = { path = "crates/integration" }
scroll-zkvm-prover = { path = "crates/prover" }
scroll-zkvm-verifier = { path = "crates/verifier" }

[patch.crates-io]
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.18-euclid-upgrade" }
ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }
tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-euclid-upgrade" }

[profile.maxperf]
inherits = "release"
lto = "fat"
codegen-units = 1
94 changes: 94 additions & 0 deletions Cargo.toml.gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[workspace]
members = [
"crates/circuits/chunk-circuit",
"crates/circuits/batch-circuit",
"crates/circuits/bundle-circuit",
"crates/circuits/types",
"crates/prover",
"crates/verifier",
"crates/integration",
"crates/build-guest",
]
resolver = "2"

[workspace.package]
authors = ["Scroll developers"]
edition = "2021"
homepage = "https://github.com/scroll-tech/zkvm-prover"
readme = "README.md"
repository = "https://github.com/scroll-tech/zkvm-prover"
version = "0.3.0"

[workspace.dependencies]
openvm = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-algebra-complex-macros = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-algebra-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-bigint-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-build = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-custom-insn = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-continuations = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-ecc-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-instructions ={ git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-keccak256-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-native-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-native-compiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-native-recursion = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-native-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-pairing-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-rv32im-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-rv32im-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-sdk = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false, features = ["parallel", "bench-metrics"] }
openvm-sha256-guest = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }
openvm-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", rev = "81004fb", default-features = false }

openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", tag = "v1.0.0" }

sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = ["scroll"] }
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade", features = ["scroll"] }
sbv-kv = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade" }
sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "zkvm/euclid-upgrade" }

alloy-primitives = { version = "0.8", default-features = false }
alloy-serde = { version = "0.8", default-features = false }
bitcode = { version = "0.6.5", default-features = false, features = ["serde", "derive"] }
bincode_v1 = { version = "1.3", package = "bincode"}
derivative = "2.2.0"
eyre = "0.6"
halo2curves-axiom = { version = "0.5.3" }
itertools = "0.14"
hex-literal = { version = "0.4.1", default-features = false }
metrics = "0.23.0"
metrics-util = "0.17"
metrics-tracing-context = "0.16.0"
p3-field = { git = "https://github.com/Plonky3/Plonky3.git", rev = "1ba4e5c" }
rayon = "1.10"
rkyv = "0.8"
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = { version = "1.0" }
serde_with = "3.11.0"
snark-verifier-sdk = { version = "0.2.0", default-features = false, features = [
"loader_halo2",
"halo2-axiom",
"display",
] }
tiny-keccak = "2.0"
tracing = "0.1"
vm-zstd = { git = "https://github.com/scroll-tech/rust-zstd-decompressor.git", tag = "v0.1.1" }
toml = "0.8.14"
tracing-subscriber = "0.3"

scroll-zkvm-circuit-input-types = { path = "crates/circuits/types" }
scroll-zkvm-integration = { path = "crates/integration" }
scroll-zkvm-prover = { path = "crates/prover" }
scroll-zkvm-verifier = { path = "crates/verifier" }

[patch.crates-io]
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.18-euclid-upgrade" }
ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" }
tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-euclid-upgrade" }

[profile.maxperf]
inherits = "release"
lto = "fat"
codegen-units = 1
1 change: 1 addition & 0 deletions crates/build-guest/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_STAGES=stage2,stage3
6 changes: 3 additions & 3 deletions crates/build-guest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ fn run_stage3_exe_commits(project_names: &[&str], workspace_dir: &Path) -> Resul
}

pub fn main() -> Result<()> {
// Load .env file if present
dotenv().ok();

// Set current directory to the crate's root
let manifest_dir = env::var("CARGO_MANIFEST_DIR")?;
env::set_current_dir(&manifest_dir)?;
println!("{LOG_PREFIX} Running in directory: {}", manifest_dir);

// Load .env file if present
dotenv().ok();

// Determine workspace root
let metadata = cargo_metadata::MetadataCommand::new().exec()?;
let workspace_dir = metadata.workspace_root.into_std_path_buf();
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] = [340896804, 602821680, 1157331017, 1209391802, 387959812, 1598560358, 1043289328, 1323232354];
pub const COMMIT: [u32; 8] = [1779797808, 457220833, 1374747154, 113088568, 666647812, 1628780772, 1629342581, 1507076788];
2 changes: 1 addition & 1 deletion crates/circuits/batch-circuit/batch_leaf_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] = [12988142, 1056974730, 1268625384, 1258697214, 1638476404, 617136570, 486525037, 565660780];
pub const COMMIT: [u32; 8] = [1583597683, 1891396505, 1658359221, 937358707, 1082503370, 1627277738, 322886937, 1126664665];
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] = [680857057, 82855189, 1900791356, 1462562861, 836632426, 1110053314, 451565233, 894149163];
pub const COMMIT: [u32; 8] = [1648257678, 503801083, 1720591825, 472769095, 1516590194, 217783476, 1990661980, 1238345277];
2 changes: 1 addition & 1 deletion crates/circuits/bundle-circuit/bundle_leaf_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] = [767961627, 1863676756, 1816887039, 1021890519, 303786683, 1279626877, 1177909236, 742426219];
pub const COMMIT: [u32; 8] = [1227657215, 852763880, 97050317, 868662534, 861316317, 1072133630, 767460211, 493765067];
Binary file modified crates/circuits/bundle-circuit/digest_1
Binary file not shown.
Binary file modified crates/circuits/bundle-circuit/digest_1_euclidv1
Binary file not shown.
Binary file modified crates/circuits/bundle-circuit/digest_2
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/circuits/chunk-circuit/chunk_leaf_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] = [388965117, 634149964, 1301101304, 136264277, 316201108, 365084570, 1135330922, 195059385];
pub const COMMIT: [u32; 8] = [1443243841, 1004366406, 2003092941, 1325139171, 1093586017, 1842955945, 1478923252, 128760176];
3 changes: 3 additions & 0 deletions scripts/locate-crate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crate=`cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "'$1'") | select(.manifest_path ) | .manifest_path' | sort | head -n 1`
workspace=$(echo $crate | sed 's#crates.*#Cargo.toml#')
dirname $workspace
7 changes: 7 additions & 0 deletions scripts/patch-crate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -xe
patch=`realpath $2`
pushd `bash $(dirname $0)/locate-crate.sh $1`
git apply $patch
git diff | cat
popd
cargo clean -p $1
11 changes: 4 additions & 7 deletions scripts/reset-crate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
crate=`cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "'$1'") | select(.manifest_path ) | .manifest_path' | sort | head -n 1`
workspace=$(echo $crate | sed 's#crates.*#Cargo.toml#')
echo `dirname $workspace`
exit 0
cd `dirname $workspace`
set -xe
pushd `bash $(dirname $0)/locate-crate.sh $1`
git diff | cat
git checkout .
cargo clean -p $1
#echo $crate
popd
cargo clean -p $1