Skip to content

feat: enforce accumulator_not_empty = 0 at ECCVM lagrange_first row#22461

Merged
notnotraju merged 1 commit intomerge-train/barretenbergfrom
rk/eccvm-accumulator-not-empty-init
Apr 10, 2026
Merged

feat: enforce accumulator_not_empty = 0 at ECCVM lagrange_first row#22461
notnotraju merged 1 commit intomerge-train/barretenbergfrom
rk/eccvm-accumulator-not-empty-init

Conversation

@notnotraju
Copy link
Copy Markdown
Contributor

Summary

Add lagrange_first * transcript_accumulator_not_empty = 0 subrelation to ECCVMTranscriptRelation.

This is a prerequisite for #22334 (masking at top of ECCVM circuit). The audit in #22442 identified that when lagrange_first moves to row k (away from the PCS-enforced zero row), transcript_accumulator_not_empty is the only shiftable column where a malicious prover can potentially set a non-zero value at the lagrange_first row without any existing relation catching it. Setting it to 1 disables INFINITY_ACC_X/Y, allowing arbitrary accumulator coordinates to be injected.

Changes

  • New subrelation ACCUMULATOR_NOT_EMPTY_INIT in ecc_transcript_relation.hpp (degree 2)
  • Gate count updates (+174 gates from the new subrelation):
    • ECCVM_RECURSIVE_VERIFIER_GATE_COUNT: 224336 → 224510
    • CHONK_RECURSION_GATES: 1491593 → 1491767

Test plan

  • eccvm_tests — all 44 tests pass
  • stdlib_eccvm_verifier_testsSingleRecursiveVerification passes with updated gate count
  • dsl_testsGateCountChonkRecursion passes with updated gate count

…ipt relation

In preparation for masking at the top of the ECCVM circuit (where lagrange_first
moves to row k = NUM_DISABLED_ROWS_IN_SUMCHECK and shiftable column values at
row k are no longer PCS-enforced to be zero), add ACCUMULATOR_NOT_EMPTY_INIT
subrelation to ECCVMTranscriptRelation. Without this constraint, a malicious
prover could set accumulator_not_empty = 1 at the lagrange_first row, disabling
INFINITY_ACC_X/Y and injecting arbitrary accumulator coordinates undetected.

Update recursive verifier gate counts (+174 gates from the new subrelation):
- ECCVM_RECURSIVE_VERIFIER_GATE_COUNT: 224336 → 224510
- CHONK_RECURSION_GATES: 1491593 → 1491767
@notnotraju notnotraju added the ci-barretenberg Run all barretenberg/cpp checks. label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@iakovenkos iakovenkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing, thanks for identifying this

@notnotraju notnotraju merged commit a91a851 into merge-train/barretenberg Apr 10, 2026
21 of 25 checks passed
@notnotraju notnotraju deleted the rk/eccvm-accumulator-not-empty-init branch April 10, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-barretenberg Run all barretenberg/cpp checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants