Skip to content

Commit 55820b4

Browse files
committed
fix: add is_dummy and is_last_layer constraints
1 parent 7706030 commit 55820b4

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

crates/recursion/src/gkr/layer/air.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ where
138138
let is_transition = LoopSubAir::local_is_transition(next.is_enabled, next.is_first);
139139
let is_last = LoopSubAir::local_is_last(local.is_enabled, next.is_enabled, next.is_first);
140140

141+
// A proof can't contribute both dummy and non-dummy rows
142+
builder
143+
.when(is_transition.clone())
144+
.assert_eq(next.is_dummy, local.is_dummy);
145+
141146
// Layer index starts from 0
142147
builder.when(local.is_first).assert_zero(local.layer_idx);
143148
// Layer index increments by 1

crates/recursion/src/gkr/sumcheck/air.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,19 @@ where
151151
LoopSubAir::local_is_transition(next.is_enabled, next.is_first_round);
152152
let is_last_round =
153153
LoopSubAir::local_is_last(local.is_enabled, next.is_enabled, next.is_first_round);
154+
let is_transition_proof = next.is_enabled - next.is_proof_start;
155+
156+
// A proof can't contribute both dummy and non-dummy rows
157+
builder
158+
.when(is_transition_proof)
159+
.assert_eq(next.is_dummy, local.is_dummy);
154160

155161
// Sumcheck round flag starts at 0
156162
builder.when(local.is_first_round).assert_zero(local.round);
163+
// Layer metadata must remain same
164+
builder
165+
.when(is_transition_round.clone())
166+
.assert_eq(next.is_last_layer, local.is_last_layer);
157167
// Sumcheck round flag increments by 1
158168
builder
159169
.when(is_transition_round.clone())

crates/recursion/src/gkr/xi_sampler/air.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ where
103103
let is_last_challenge =
104104
LoopSubAir::local_is_last(local.is_enabled, next.is_enabled, next.is_first_challenge);
105105

106+
// A proof can't contribute both dummy and non-dummy rows
107+
builder
108+
.when(is_transition_challenge.clone())
109+
.assert_eq(next.is_dummy, local.is_dummy);
110+
106111
// Challenge index increments by 1
107112
builder
108113
.when(is_transition_challenge.clone())

0 commit comments

Comments
 (0)