fix getCutPoint lower bound - #630
Conversation
Adds a fixture circuit (circom --O0) that alternates multiplicative rows with purely-linear ones (l <== a + b). Linear constraints compile to the 0*0 = C form, and section 4 of the zkey holds records only for A-side/B-side terms -- so those rows have no coefficient records at all, leaving gaps in the sorted c-sequence: c-values: 0,0,2,2,4,4,6,6,8,8,10,10,12,12,14,14,17,18 Pre-fix, a chunk boundary landing on a missing row made getCutPoint return a cut point one coefficient too low; the dropped coefficient corrupted the QAP evaluations and the proof failed to verify. The test covers default prove options plus explicit nChunks=4/32 (a cut point at every row), and includes a tamper-check to guard against a degenerate ptau masking failures (a no-contribution tau=1 accumulator accepts even corrupted proofs). Verified: all three tests fail against the pre-fix bisection and pass with it.
|
I reviewed this fix, confirmed the bug is real and reachable with default prove options, and pushed a regression test to this branch ( The trigger condition: section 4 of the zkey only holds coefficient records for A-side ( Rows 1,3,…,15,16 are missing. A chunk boundary landing on any of them made the old bisection return a cut point one coefficient short; I diffed the QAP buffers built with old-vs-new cut points and confirmed the dropped coefficient corrupts Two notes for anyone reproducing this:
Verified on this branch: the new test fails all three cases against the pre-fix bisection and passes with the fix; the full existing suite (52 tests) also passes. Leaving formal approval to a maintainer since I've now contributed to the branch. |
src/groth16_prove.js merged cleanly (the lower_bound fix and the base's buildABC option validation touch different lines). The conflicted build/ bundles are derived artifacts: resolved by rebuilding all five outputs from the merged source rather than hand-merging. Full suite (66 tests, including the new gap-circuit regression tests) passes on the merged tree.
c0f7622
into
iden3:feature/memory-scoping
No description provided.