From 72580b83c55adc9f5df5715ca2fca60c6e565493 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:10:03 -0500 Subject: [PATCH] fix: remove setup on first row constraint --- crates/circuits/mod-builder/src/builder.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/circuits/mod-builder/src/builder.rs b/crates/circuits/mod-builder/src/builder.rs index 712dc9e96c..609410cd2d 100644 --- a/crates/circuits/mod-builder/src/builder.rs +++ b/crates/circuits/mod-builder/src/builder.rs @@ -289,7 +289,12 @@ impl SubAir 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()