Migrate to latest version of halo2

This brings in:
- Fixes and improvements to `MockProver`.
- Support for annotating constraints within gates.
- Removal of Selector rotations.
This commit is contained in:
Jack Grigg 2021-06-05 23:39:00 +01:00
parent 2be13bfa80
commit 94e730ad4c
4 changed files with 10 additions and 9 deletions

View File

@ -37,7 +37,7 @@ plotters = { version = "0.3.0", optional = true }
[dependencies.halo2]
git = "https://github.com/zcash/halo2.git"
rev = "32cdcfa66fbc4ca3103115518d374f4cfe6c3b7a"
rev = "d8e4f24df44da94ab5cacbc531517e2b63fe45ee"
[dependencies.reddsa]
git = "https://github.com/str4d/redjubjub.git"

View File

@ -109,7 +109,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
let rc_1 = meta.query_fixed(rc_a[1], Rotation::cur());
let rc_2 = meta.query_fixed(rc_a[2], Rotation::cur());
let s_full = meta.query_selector(s_full, Rotation::cur());
let s_full = meta.query_selector(s_full);
let full_round = |next_idx: usize| {
s_full.clone()
@ -138,7 +138,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
let rc_b1 = meta.query_fixed(rc_b[1], Rotation::cur());
let rc_b2 = meta.query_fixed(rc_b[2], Rotation::cur());
let s_partial = meta.query_selector(s_partial, Rotation::cur());
let s_partial = meta.query_selector(s_partial);
let partial_round_linear = |idx: usize, rc_b: Expression<F>| {
s_partial.clone()
@ -177,7 +177,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
let output_state_1 = meta.query_advice(state[1], Rotation::next());
let output_state_2 = meta.query_advice(state[2], Rotation::next());
let s_pad_and_add = meta.query_selector(s_pad_and_add, Rotation::cur());
let s_pad_and_add = meta.query_selector(s_pad_and_add);
let pad_and_add = |initial_state, input, output_state| {
// We pad the input by storing the required padding in fixed columns and

View File

@ -155,7 +155,7 @@ impl<F: FieldExt> CondSwapChip<F> {
// TODO: optimise shape of gate for Merkle path validation
meta.create_gate("a' = b ⋅ swap + a ⋅ (1-swap)", |meta| {
let q_swap = meta.query_selector(q_swap, Rotation::cur());
let q_swap = meta.query_selector(q_swap);
let a = meta.query_advice(config.a, Rotation::cur());
let b = meta.query_advice(config.b, Rotation::cur());
@ -180,8 +180,7 @@ impl<F: FieldExt> CondSwapChip<F> {
let bool_check = swap.clone() * (one - swap);
array::IntoIter::new([a_check, b_check, bool_check])
.map(|poly| q_swap.clone() * poly)
.collect()
.map(move |poly| q_swap.clone() * poly)
});
config

View File

@ -108,7 +108,7 @@ impl<F: FieldExt> EnableFlagChip<F> {
};
meta.create_gate("Enable flag", |meta| {
let q_enable = meta.query_selector(config.q_enable, Rotation::cur());
let q_enable = meta.query_selector(config.q_enable);
let value = meta.query_advice(config.value, Rotation::cur());
let enable_flag = meta.query_advice(config.enable_flag, Rotation::cur());
@ -218,9 +218,11 @@ mod tests {
let prover = MockProver::<Base>::run(1, &circuit, vec![]).unwrap();
assert_eq!(
prover.verify(),
Err(vec![VerifyFailure::Gate {
Err(vec![VerifyFailure::Constraint {
gate_index: 0,
gate_name: "Enable flag",
constraint_index: 0,
constraint_name: "",
row: 1,
}])
);