Skip to content

feat: merge-train/barretenberg#22667

Merged
AztecBot merged 3 commits into
nextfrom
merge-train/barretenberg
Apr 20, 2026
Merged

feat: merge-train/barretenberg#22667
AztecBot merged 3 commits into
nextfrom
merge-train/barretenberg

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
chore: genericize databus (#22648)
chore(ts): drop dead Plonk VK scaffolding and port #22655 TS cleanup (#22657)
END_COMMIT_OVERRIDE

Make the databus mechanism generic on number of bus columns to
facilitate extension
AztecBot and others added 2 commits April 20, 2026 17:59
…22657)

## Context

Follow-up to #22655
(`feat!: poseidon2 with compressed internal rounds and aux wires`) and
the scope audit that started from it.

The original PR surfaced a recurring pain: every time the MegaHonk
flavor changes, TypeScript has to be hand-edited because several
downstream call sites duplicate derived VK sizes or freeze entire VKs as
inline blobs. While auditing for similar bad patterns, it became clear
that a chunk of the stdlib VK module is **Plonk-era scaffolding** \u2014
pre-Honk types whose only remaining callers are themselves test-only or
dead. Those classes are why the flavor-change struggle exists in TS in
the first place: `VerificationKeyData.makeFakeHonk` was synthesising
fake `keyAsBytes` by serializing a fake Plonk `VerificationKey`,
dragging Plonk types into the Honk path.

## What this PR does (3 commits)

### 1. `chore(stdlib): remove dead mocked_keys.ts hex blob`
Deletes `yarn-project/stdlib/src/abi/mocked_keys.ts`, a ~2 KB orphan
Plonk VK hex blob. Grepping the monorepo: 1 declaration, 0 references.
`stdlib/src/abi/index.ts` does not re-export it.

### 2. `chore(ts): use MEGA_VK_LENGTH_IN_FIELDS instead of hardcoded
4064`
Ports the TS-only cleanup from #22655 so it lands independently of
whether the Poseidon2 flavor change merges:
- 4 call sites of `Buffer.alloc(4064)` in
`aztec.js/src/contract/{contract,deploy_method}.test.ts` \u2192
`Buffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES)`.
- `VerificationKey.makeFakeMegaHonk()` dropped its ~4 KB base64 blob in
favor of `Buffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES)`.

Intentionally NOT ported: the `MEGA_VK_LENGTH_IN_FIELDS 127\u2192135`
bump in `constants.gen.ts`, which tracks the C++ flavor change that's
not in `merge-train/barretenberg`. The ported code is layout-agnostic.

### 3. `chore(stdlib): drop Plonk
VerificationKey/CommitmentMap/G1AffineElement`
Deletes the entire Plonk-era VK scaffold. Nothing reads it off the wire
and nothing in Honk needs it:

- **`VerificationKey`** (Plonk class with `CommitmentMap` of `{Q_1,
SIGMA_1, ...}`, `containsRecursiveProof`,
`recursiveProofPublicInputIndices`): zero non-test callers. Every caller
was itself dead (`makeVerificationKey` factory, a one-off round-trip
test, or the Honk `VerificationKeyData` fake helpers that were using it
as a source of placeholder bytes).
- **`CommitmentMap`** and **`G1AffineElement`**: only referenced by
`VerificationKey`. Gone.
- **`CircuitType` enum** (`STANDARD`/`ULTRA`) in
`stdlib/src/types/shared.ts`: only existed to type-tag Plonk VKs. Gone.
- **`makeVerificationKey`** in `stdlib/src/tests/factories.ts`: exported
but not imported anywhere.
- **`'can deserialize vk built by noir'` test**: round-tripped an inline
~2 KB Plonk VK hex; cannot parse any current protocol VK.
- **`VerificationKeyData.makeFakeHonk` / `makeFakeRollupHonk`**: now
synthesize `keyAsBytes` from `VerificationKeyAsFields.toBuffer()` (the
real Honk serialization) instead of from a fake Plonk VK.
`makeFake(len)` had zero callers and was removed.
- **`VerificationKey.makeFakeMegaHonk()`**: its one remaining caller
(`pxe/.../private_kernel_execution_prover.test.ts`) now inlines
`Buffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES)`.

Net: \u2212209 lines from `stdlib/src/vks/verification_key.ts` plus the
shared / factories / pxe updates.

## Scope audit (gist)

https://gist.github.com/AztecBot/67c6cc69458f63c296d0557b2e598632
(updated)

## Verification

`grep` across `yarn-project/` confirms **zero** remaining references to
`VerificationKey.makeFake`, `VerificationKey.makeFakeMegaHonk`,
`VerificationKey.fromBuffer`, `new VerificationKey(`, `CommitmentMap`,
`G1AffineElement`, `CircuitType`, or `makeVerificationKey`. Remaining
hits for the string `VerificationKey` are unrelated
(`VerificationKeyAsFields`, `VerificationKeyData`,
`PrivateVerificationKeyHints`, `VerificationKeyNoir` type binding,
`computeVerificationKeyHash`, `makeProofAndVerificationKey`).

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot AztecBot added this pull request to the merge queue Apr 20, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot

Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/c7f0159d25b4f068�c7f0159d25b4f0688;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/reqresp/reqresp.test.ts (228s) (code: 0) group:e2e-p2p-epoch-flakes

Merged via the queue into next with commit 14d7014 Apr 20, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants