Skip to content

Commit

Permalink
fix: remove setup on first row constraint (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang authored Jan 18, 2025
1 parent ee7129a commit be2d4e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/circuits/mod-builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ impl<AB: InteractionBuilder> SubAir<AB> for FieldExpr {
if self.builder.needs_setup() {
let is_setup = flags.iter().fold(is_valid.into(), |acc, &x| acc - x);
builder.assert_bool(is_setup.clone());
builder.when_first_row().assert_one(is_setup.clone());
// TODO[jpw]: currently we enforce at the program code level that:
// - a valid program must call the correct setup opcodes to be correct
// - it would be better if we can constraint this in the circuit,
// however this has the challenge that when the same chip is used
// across continuation segments,
// only the first segment will have setup called
for i in 0..inputs[0].len().max(self.builder.prime_limbs.len()) {
let lhs = if i < inputs[0].len() {
inputs[0][i].into()
Expand Down

0 comments on commit be2d4e4

Please sign in to comment.