Skip to content

Commit

Permalink
Remove erroneous assertion on colliding runtime and fixed table IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
volhovm committed Dec 8, 2023
1 parent 6da69f2 commit 779d4f6
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions kimchi/src/circuits/lookup/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,8 @@ impl<F: PrimeField + SquareRootField> LookupConstraintSystem<F> {
let runtime_tables_ids: Vec<i32> =
runtime_tables.iter().map(|rt| rt.id).collect();
check_id_duplicates(runtime_tables_ids.iter(), "runtime table duplicates")?;
check_id_duplicates(
runtime_tables_ids
.iter()
.chain(fixed_lookup_tables_ids.iter()),
"duplicates between runtime and fixed tables",
)?;
// Runtime table IDs may collide with lookup
// table IDs, so we intentionally do not perform another potential check.

// save the offset of the end of the table
let mut runtime_table_offset = 0;
Expand Down Expand Up @@ -479,7 +475,7 @@ mod tests {
use mina_curves::pasta::Fp;

#[test]
fn colliding_table_ids() {
fn test_colliding_table_ids() {
let (_, gates) = CircuitGate::<Fp>::create_multi_range_check(0);
let collision_id: i32 = 5;

Expand Down Expand Up @@ -559,13 +555,8 @@ mod tests {
.build();

assert!(
matches!(
cs,
Err(SetupError::LookupCreation(
LookupError::LookupTableIdCollision { .. }
))
),
"LookupConstraintSystem::create(...) must fail, collision between runtime and lookup ids"
cs.is_ok(),
"LookupConstraintSystem::create(...) must not fail when there is a collision between runtime and lookup ids"
);
}
}

0 comments on commit 779d4f6

Please sign in to comment.