diff --git a/Cargo.lock b/Cargo.lock index 14b3b828..3a31a45c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -670,11 +670,11 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "halo2-base" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#b7c53bb7456063936f4ca6df8fa8e751d9c17d85" +source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#40ba7e3bbf013b55c59283534c9489701f9212d0" dependencies = [ "ff 0.13.0", "halo2_proofs 0.2.0 (git+https://github.com/axiom-crypto/halo2.git?tag=v2023_01_17)", - "halo2_proofs 0.2.0 (git+https://github.com/scroll-tech/halo2.git?branch=v1.0)", + "halo2_proofs 0.2.0 (git+https://github.com/scroll-tech/halo2.git?branch=v1.1)", "itertools 0.10.5", "num-bigint", "num-integer", @@ -686,7 +686,7 @@ dependencies = [ [[package]] name = "halo2-ecc" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#b7c53bb7456063936f4ca6df8fa8e751d9c17d85" +source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#40ba7e3bbf013b55c59283534c9489701f9212d0" dependencies = [ "ff 0.13.0", "group 0.13.0", @@ -720,7 +720,7 @@ dependencies = [ [[package]] name = "halo2_proofs" version = "0.2.0" -source = "git+https://github.com/scroll-tech/halo2.git?branch=v1.0#8deec9924f598c85eb5ec1044199c78ef455c866" +source = "git+https://github.com/scroll-tech/halo2.git?branch=v1.1#84003a202d6b9185c952ec91ea793dbbd6c5b200" dependencies = [ "ark-std", "blake2b_simd", diff --git a/Cargo.toml b/Cargo.toml index 46c8e3fd..88fd46e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ debug = true # patch until PR https://github.com/privacy-scaling-explorations/halo2/pull/111 is merged [patch."https://github.com/privacy-scaling-explorations/halo2.git"] -halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.0" } +halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" } [patch."https://github.com/privacy-scaling-explorations/poseidon.git"] poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "main" } diff --git a/snark-verifier/src/system/halo2.rs b/snark-verifier/src/system/halo2.rs index b5e85cbb..70800bb4 100644 --- a/snark-verifier/src/system/halo2.rs +++ b/snark-verifier/src/system/halo2.rs @@ -91,9 +91,9 @@ pub fn compile<'a, C: CurveAffine, P: Params<'a, C>>( params: &P, vk: &VerifyingKey, config: Config, -) -> Protocol +) -> Protocol where - C::ScalarExt: FromUniformBytes<64> + C::ScalarExt: FromUniformBytes<64>, { assert_eq!(vk.get_domain().k(), params.k()); @@ -622,7 +622,16 @@ impl<'a, F: PrimeField> Polynomials<'a, F> { }) .collect_vec(); - let compress = |expressions: &'a [plonk::Expression]| { + let compress_input = |expressions: &[Vec>]| { + Expression::DistributePowers( + expressions + .iter() + .flat_map(|exprs| exprs.iter().map(|expr| self.convert(expr, t))) + .collect(), + self.theta().into(), + ) + }; + let compress_table = |expressions: &[plonk::Expression]| { Expression::DistributePowers( expressions.iter().map(|expression| self.convert(expression, t)).collect(), self.theta().into(), @@ -638,8 +647,8 @@ impl<'a, F: PrimeField> Polynomials<'a, F> { lookup, (z, z_omega, permuted_input, permuted_input_omega_inv, permuted_table), )| { - let input = compress(lookup.input_expressions()); - let table = compress(lookup.table_expressions()); + let input = compress_input(lookup.input_expressions()); + let table = compress_table(lookup.table_expressions()); iter::empty() .chain(Some(l_0 * (one - z))) .chain(self.zk.then(|| l_last * (z * z - z))) @@ -726,8 +735,9 @@ impl Transcript for MockTranscript } } -fn transcript_initial_state(vk: &VerifyingKey) -> C::Scalar -where C::ScalarExt: FromUniformBytes<64>, +fn transcript_initial_state(vk: &VerifyingKey) -> C::Scalar +where + C::ScalarExt: FromUniformBytes<64>, { let mut transcript = MockTranscript::default(); vk.hash_into(&mut transcript).unwrap();