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 56c9985
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 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 @@ -545,27 +541,5 @@ mod tests {
),
"LookupConstraintSystem::create(...) must fail, collision in runtime ids"
);

let cs = ConstraintSystem::<Fp>::create(gates.clone())
.lookup(vec![LookupTable::create(
collision_id,
vec![vec![From::from(0); 16]],
)
.unwrap()])
.runtime(Some(vec![RuntimeTableCfg {
id: collision_id,
first_column: vec![From::from(1); 16],
}]))
.build();

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

0 comments on commit 56c9985

Please sign in to comment.