diff --git a/Cargo.lock b/Cargo.lock index c0001d177..9cc3b7f1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,6 +260,7 @@ dependencies = [ "dotenv", "env_logger 0.10.0", "ethers-providers 1.0.2", + "halo2_proofs", "integration", "itertools", "log", diff --git a/bin/Cargo.toml b/bin/Cargo.toml index 24dce2b80..6f3922714 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -12,6 +12,7 @@ dotenv = "0.15.0" env_logger = "0.10.0" ethers-providers = "1.0" itertools = "0.10.5" +halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop"} log = "0.4" log4rs = { version = "1.2.0", default_features = false, features = ["console_appender", "file_appender"] } rand = "0.8" diff --git a/bin/src/re_rand_srs.rs b/bin/src/re_rand_srs.rs index 90f51e146..e20e1d055 100644 --- a/bin/src/re_rand_srs.rs +++ b/bin/src/re_rand_srs.rs @@ -1,5 +1,8 @@ +use std::{fs::File, io::BufWriter}; + use anyhow::Result; use clap::Parser; +use halo2_proofs::poly::commitment::Params; use prover::utils::{load_params, re_randomize_srs}; use tiny_keccak::{Hasher, Keccak}; @@ -26,15 +29,18 @@ fn main() -> Result<()> { log::info!("Re-randomize SRS in file: {}", args.input_param); log::info!("Degree of SRS: {}", args.degree); - log::info!("Using seed: {}", args.seed); - log::info!("Output new SRS to: {}", args.output_param); - let mut old_param = load_params(&args.input_param, args.degree as u32, None)?; + let mut param = load_params(&args.input_param, args.degree as u32, None)?; + + log::info!("Using seed: {}", args.seed); let mut hasher = Keccak::v256(); hasher.update(args.seed.as_bytes()); let mut seed = [0u8; 32]; hasher.finalize(&mut seed); - re_randomize_srs(&mut old_param, &seed); + re_randomize_srs(&mut param, &seed); + + log::info!("Output new SRS to: {}", args.output_param); + param.write(&mut BufWriter::new(File::create(args.output_param)?))?; log::info!("SRS re-randomization finished"); Ok(())