Skip to content

Commit

Permalink
patch: roll back removed assertion checks
Browse files Browse the repository at this point in the history
  • Loading branch information
guorong009 committed Jun 12, 2024
1 parent 612e2a1 commit 0cdbda8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 1 addition & 3 deletions halo2_frontend/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,7 @@ mod tests {
}

#[test]
#[should_panic(
expected = "pair of selector/fixed queries(querying the tag columns) should be included, otherwise we have soundness error"
)]
#[should_panic(expected = "all table expressions need selector/fixed query for tagging")]
fn bad_lookup_any_no_fixed_col_or_selector() {
const K: u32 = 4;

Expand Down
14 changes: 14 additions & 0 deletions halo2_frontend/src/plonk/circuit/constraint_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ impl<F: Field> ConstraintSystem<F> {
let mut cells = VirtualCells::new(self);

let mut is_all_table_expr_fixed_or_selector = true;
let mut is_all_input_expr_contains_fixed_or_selector = true;
let mut is_all_table_expr_contains_fixed_or_selector = true;
let mut is_tagging_cols_pair_exists = false;

let table_map = table_map(&mut cells)
Expand All @@ -416,6 +418,12 @@ impl<F: Field> ConstraintSystem<F> {

is_all_table_expr_fixed_or_selector &=
table.degree() == 1 && table.contains_fixed_col_or_selector();

is_all_input_expr_contains_fixed_or_selector &=
input.contains_fixed_col_or_selector();
is_all_table_expr_contains_fixed_or_selector &=
table.contains_fixed_col_or_selector();

is_tagging_cols_pair_exists |= (input.contains_fixed_col_or_selector()
&& input.degree() == 1)
&& (table.contains_fixed_col_or_selector() && table.degree() == 1);
Expand All @@ -429,6 +437,12 @@ impl<F: Field> ConstraintSystem<F> {
if is_all_table_expr_fixed_or_selector {
panic!("all table expressions contain only fixed query, should use `lookup` api instead of `lookup_any`");
}
if !is_all_input_expr_contains_fixed_or_selector {
panic!("all input expressions need selector/fixed query for tagging");
}
if !is_all_table_expr_contains_fixed_or_selector {
panic!("all table expressions need selector/fixed query for tagging");
}
if !is_tagging_cols_pair_exists {
panic!("pair of selector/fixed queries(querying the tag columns) should be included, otherwise we have soundness error");
}
Expand Down

0 comments on commit 0cdbda8

Please sign in to comment.