From d24871338ade7dd56362de517b718ba14f3e7b90 Mon Sep 17 00:00:00 2001 From: zhenfei Date: Thu, 30 Mar 2023 04:32:23 -0400 Subject: [PATCH] [chore] update dependencies to halo2/scroll-dev-02220 --- .gitignore | 3 +++ Cargo.toml | 2 +- halo2-base/Cargo.toml | 2 +- halo2-base/src/gates/flex_gate.rs | 4 ++-- halo2-base/src/gates/mod.rs | 8 ++++---- halo2-base/src/gates/range.rs | 2 +- halo2-ecc/Cargo.toml | 2 +- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 65983083..711f98d2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ Cargo.lock /halo2_ecc/src/bn254/data/ /halo2_ecc/src/secp256k1/data/ + +*.csv +*.srs \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 4f01110c..71d77e2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = [ "halo2-base", "halo2-ecc", - "hashes/zkevm-keccak", + # "hashes/zkevm-keccak", ] [profile.dev] diff --git a/halo2-base/Cargo.toml b/halo2-base/Cargo.toml index 0046f2e0..c85222f3 100644 --- a/halo2-base/Cargo.toml +++ b/halo2-base/Cargo.toml @@ -35,7 +35,7 @@ jemallocator = { version = "0.5", optional = true } mimalloc = { version = "0.1", default-features = false, optional = true } [features] -default = ["halo2-axiom", "display"] +default = ["halo2-pse", "display"] dev-graph = ["halo2_proofs?/dev-graph", "halo2_proofs_axiom?/dev-graph", "plotters"] halo2-pse = ["halo2_proofs"] halo2-axiom = ["halo2_proofs_axiom"] diff --git a/halo2-base/src/gates/flex_gate.rs b/halo2-base/src/gates/flex_gate.rs index fdbd8652..2879937a 100644 --- a/halo2-base/src/gates/flex_gate.rs +++ b/halo2-base/src/gates/flex_gate.rs @@ -750,7 +750,7 @@ impl GateInstructions for FlexGateConfig { ], vec![(0, Some([F::zero(), F::one(), -F::one()])), (3, None)], ); - ctx.region.constrain_equal(assignments[2].cell(), assignments[5].cell()); + ctx.region.constrain_equal(assignments[2].cell(), assignments[5].cell()).unwrap(); assignments.pop().unwrap() } } @@ -815,7 +815,7 @@ impl GateInstructions for FlexGateConfig { self.pow_of_two[..range_bits].iter().map(|c| Constant(*c)), &mut bit_cells, ); - ctx.region.constrain_equal(a.cell(), acc.cell()); + ctx.region.constrain_equal(a.cell(), acc.cell()).unwrap(); for bit_cell in &bit_cells { self.assign_region( diff --git a/halo2-base/src/gates/mod.rs b/halo2-base/src/gates/mod.rs index 52706772..b376c806 100644 --- a/halo2-base/src/gates/mod.rs +++ b/halo2-base/src/gates/mod.rs @@ -78,10 +78,10 @@ pub trait GateInstructions { let assignments = self.assign_region(ctx, inputs, gate_offsets.into_iter().map(|i| (i as isize, None))); for (offset1, offset2) in equality_offsets.into_iter() { - ctx.region.constrain_equal(assignments[offset1].cell(), assignments[offset2].cell()); + ctx.region.constrain_equal(assignments[offset1].cell(), assignments[offset2].cell()).unwrap(); } for (assigned, eq_offset) in external_equality.into_iter() { - ctx.region.constrain_equal(assigned.cell(), assignments[eq_offset].cell()); + ctx.region.constrain_equal(assigned.cell(), assignments[eq_offset].cell()).unwrap(); } assignments } @@ -198,7 +198,7 @@ pub trait GateInstructions { let out_val = a.value().zip(b.value()).map(|(a, b)| (F::one() - a) * b); let assignments = self.assign_region(ctx, vec![Witness(out_val), a, b.clone(), b], vec![(0, None)]); - ctx.region.constrain_equal(assignments[2].cell(), assignments[3].cell()); + ctx.region.constrain_equal(assignments[2].cell(), assignments[3].cell()).unwrap(); assignments.into_iter().next().unwrap() } @@ -227,7 +227,7 @@ pub trait GateInstructions { fn assert_equal(&self, ctx: &mut Context<'_, F>, a: QuantumCell, b: QuantumCell) { if let (Existing(a), Existing(b)) = (&a, &b) { - ctx.region.constrain_equal(a.cell(), b.cell()); + ctx.region.constrain_equal(a.cell(), b.cell()).unwrap(); } else { self.assign_region_smart( ctx, diff --git a/halo2-base/src/gates/range.rs b/halo2-base/src/gates/range.rs index 07033ee7..d104bce1 100644 --- a/halo2-base/src/gates/range.rs +++ b/halo2-base/src/gates/range.rs @@ -220,7 +220,7 @@ impl RangeConfig { ), }; // the inner product above must equal `a` - ctx.region.constrain_equal(a.cell(), acc.cell()); + ctx.region.constrain_equal(a.cell(), acc.cell()).unwrap(); }; assert_eq!(limbs_assigned.len(), k); diff --git a/halo2-ecc/Cargo.toml b/halo2-ecc/Cargo.toml index a142200d..39784efb 100644 --- a/halo2-ecc/Cargo.toml +++ b/halo2-ecc/Cargo.toml @@ -27,7 +27,7 @@ criterion = "0.4" criterion-macro = "0.4" [features] -default = ["jemallocator", "halo2-axiom", "display"] +default = ["jemallocator", "halo2-pse", "display"] dev-graph = ["halo2-base/dev-graph"] display = ["halo2-base/display"] halo2-pse = ["halo2-base/halo2-pse"]