Skip to content
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

feat: integrate Sirius folding #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 5 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
13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -25,11 +25,18 @@ serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
tokio = { version = "1.32", features = ["full"] }
rayon = "1"

halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" }
prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.11.4", default-features = false, features = ["parallel_syn", "scroll"] }
integration = { path = "integration" }

[patch."https://github.com/scroll-tech/zkevm-circuits.git"]
prover = { git = "https://github.com/snarkify/zkevm-circuits", branch = "step-circuit" }
#prover = { path = "/Users/chao/opensource/scroll/zkevm-circuits/prover" }
[patch."https://github.com/scroll-tech/halo2.git"]
halo2_proofs = { git = "https://github.com/snarkify/halo2", branch = "snarkify/dev.scroll.alpha.2" }

[patch.crates-io]
halo2curves = { git = "https://github.com/scroll-tech/halo2curves", branch = "v0.1.0" }
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
@@ -38,12 +45,16 @@ ethers-signers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch
#ethers-etherscan = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
#ethers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
[patch."https://github.com/privacy-scaling-explorations/halo2.git"]
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" }
halo2_proofs = { git = "https://github.com/snarkify/halo2", branch = "snarkify/dev.scroll.alpha.2" }
[patch."https://github.com/privacy-scaling-explorations/poseidon.git"]
poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "main" }
[patch."https://github.com/privacy-scaling-explorations/bls12_381"]
bls12_381 = { git = "https://github.com/scroll-tech/bls12_381", branch = "feat/impl_scalar_field" }

[patch."https://github.com/scroll-tech/poseidon-circuit.git"]
poseidon-base = { package = "poseidon-base", git = "https://github.com/snarkify/scroll-poseidon-circuit", branch = "main" }
hash-circuit = { package = "poseidon-circuit", git = "https://github.com/snarkify/scroll-poseidon-circuit", branch = "main" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if remove above two patches and the code still run, then we don't need to add them


[profile.test]
opt-level = 3
debug-assertions = true
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -41,6 +41,9 @@ test-inner-prove:
test-chunk-prove:
@cargo test --release -p integration --test chunk_tests test_chunk_prove_verify -- --exact --nocapture

test-fold-prove:
@cargo test --release -p integration --test fold_tests test_fold_prove -- --exact --nocapture

test-batch-prove:
@SCROLL_PROVER_DUMP_YUL=true cargo test --release -p integration --test batch_tests test_batch_prove_verify -- --exact --nocapture

23 changes: 23 additions & 0 deletions integration/tests/fold_tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use integration::test_util::load_chunk_for_test;
use prover::{
fold::Prover,
utils::init_env_and_log,
zkevm::circuit::SuperCircuit,
};

#[cfg(feature = "prove_verify")]
#[test]
fn test_fold_prove() {
let test_name = "fold_tests";
let output_dir = init_env_and_log(test_name);
log::info!("Initialized ENV and created output-dir {output_dir}");

let chunk_trace = load_chunk_for_test().1;
log::info!("Loaded chunk trace");

//let mut prover = Prover::<SuperCircuit>::from_params_dir(PARAMS_DIR);
let mut prover = Prover::<SuperCircuit>::default();

prover.fold("fold", chunk_trace).unwrap();
log::info!("finish folding");
}
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-12-03
nightly-2024-07-30
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NBD: we can still use the old-version to be compatible with scroll's branch