Skip to content

chore: rm dummy values from mega wires#22453

Merged
iakovenkos merged 75 commits into
merge-train/barretenbergfrom
si/no-dummy-values-in-mega
Apr 28, 2026
Merged

chore: rm dummy values from mega wires#22453
iakovenkos merged 75 commits into
merge-train/barretenbergfrom
si/no-dummy-values-in-mega

Conversation

@iakovenkos
Copy link
Copy Markdown
Contributor

.

iakovenkos and others added 30 commits April 6, 2026 09:10
…ay from RDP

With top-of-trace masking, the row-disabling polynomial 1 - ∏_{i≥2}(1-u_i)
is circuit-size independent. The verifier evaluates it over ALL D challenges
without needing log_circuit_size or padding_indicator_array.

Prover: ZK virtual rounds now use compute_virtual_contribution * (1-L) + libra
instead of sending zero univariates. Libra univariates cover all D rounds.

Verifier: apply_zk_corrections evaluates RDP from challenge vector size.
compute_padding_indicator_array returns all-1s (unified path).
@iakovenkos iakovenkos removed the ci-full Run all master checks. label Apr 15, 2026
Copy link
Copy Markdown
Contributor

@ledwards2225 ledwards2225 left a comment

Choose a reason for hiding this comment

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

LGTM - is there a reason not to do it for Ultra?

* @brief Verify that an empty circuit can be finalized and passes circuit checks
* @details Finalization should add required gates to ensure all polynomials are non-zero
* @note This is a "completeness" test; unlikely to be a use-case.
* @details Mega finalization no longer adds dummy non-zero gates — the disabled head region and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit - I try to avoid the comments that referenece an historical pattern

const size_t num_rows =
std::max({ point_table_rows.size(), msm_rows.size(), transcript_rows.size() }) + TRACE_OFFSET;
vinfo("Num rows in the ECCVM: ", num_rows);
info("Num rows in the ECCVM: ", num_rows);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

intentional?

// Most polynomials are handled via the conventional Ultra method
UltraCircuitBuilder_<MegaExecutionTraceBlocks>::add_gates_to_ensure_all_polys_are_non_zero();
add_mega_gates_to_ensure_all_polys_are_non_zero();
UltraCircuitBuilder_<MegaExecutionTraceBlocks>::finalize_circuit(ENSURE_NONZERO);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whats the reason for not doing the same for Ultra?

Base automatically changed from si/eccvm-lagrange-last-integer to merge-train/barretenberg April 21, 2026 09:55
@iakovenkos iakovenkos added the ci-full Run all master checks. label Apr 28, 2026
@iakovenkos iakovenkos added the claudebox Owned by claudebox. it can push to this PR. label Apr 28, 2026
The optimized verifier's loadVk substitutes raw verification_key->q_*.x / .y
hex into the Yul mstore'd memory. For BN254 affine, an infinity point stores
the field modulus in x as a sentinel (not (0,0)), so circuits with unused
selectors (assert_statement, vectors, a_1_mul) emit Q_*_X_LOC = q_modulus.
ecMul then reverts on an out-of-range x, surfacing as require(false) at
verifier.verify().

Route the substitutions through U256Codec::serialize_to_fields, the same
codec used by verification_key->hash() and by print_g1 for the non-optimized
template. Identity commitments now collapse to the EIP-196 canonical (0, 0)
on the optimized side too.
@iakovenkos iakovenkos merged commit 6fd6515 into merge-train/barretenberg Apr 28, 2026
12 checks passed
@iakovenkos iakovenkos deleted the si/no-dummy-values-in-mega branch April 28, 2026 19:28
ElusAegis pushed a commit to ElusAegis/aztec-packages that referenced this pull request Apr 30, 2026
BEGIN_COMMIT_OVERRIDE
chore: poly audit response (AztecProtocol#22782)
fix: BN254 G2 msgpack serialization in barretenberg-rs (AztecProtocol#22360)
chore: rm dummy values from mega wires (AztecProtocol#22453)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants