chore(ts): drop dead Plonk VK scaffolding and port #22655 TS cleanup#22657
Merged
iakovenkos merged 4 commits intoApr 20, 2026
Merged
Conversation
Ported from #22655 so the TS-side cleanup lands independently of the flavor change: removes the 4064 byte-size literal from the contract tests and the ~4 KB base64 VK blob from VerificationKey.makeFakeMegaHonk(). Buffer size is now derived from MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES so future Mega flavor changes only need to touch the generated constants file.
These classes only served the pre-Honk Plonk verifier path and had no
remaining non-test callers:
- Plonk VerificationKey (with CommitmentMap of {Q_1, SIGMA_1, ...} and
a containsRecursiveProof flag) was only constructed by dead factory
functions and its own test. Deleted.
- CommitmentMap and G1AffineElement were only used by the Plonk class.
Deleted.
- CircuitType enum (STANDARD/ULTRA) only existed to type-tag Plonk VKs.
Deleted.
- makeVerificationKey factory in tests/factories.ts — exported but not
imported anywhere. Deleted.
- The 'can deserialize vk built by noir' test was a round-trip of an
inline ~2 KB Plonk VK hex; it cannot parse any current protocol VK.
Deleted.
- VerificationKeyData.makeFakeHonk / makeFakeRollupHonk now synthesize
keyAsBytes from the already-fake VerificationKeyAsFields instead of
serializing a fake Plonk VK. makeFake(len) had zero callers and was
also removed.
- VerificationKey.makeFakeMegaHonk() had one test-only caller in
private_kernel_execution_prover.test.ts, inlined there as a
Buffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES).
Net: -198 lines.
dipkakwani
pushed a commit
to dipkakwani/aztec-packages
that referenced
this pull request
Apr 22, 2026
BEGIN_COMMIT_OVERRIDE chore: genericize databus (AztecProtocol#22648) chore(ts): drop dead Plonk VK scaffolding and port AztecProtocol#22655 TS cleanup (AztecProtocol#22657) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.makeFakeHonkwas synthesising fakekeyAsBytesby serializing a fake PlonkVerificationKey, dragging Plonk types into the Honk path.What this PR does (3 commits)
1.
chore(stdlib): remove dead mocked_keys.ts hex blobDeletes
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.tsdoes not re-export it.2.
chore(ts): use MEGA_VK_LENGTH_IN_FIELDS instead of hardcoded 4064Ports the TS-only cleanup from #22655 so it lands independently of whether the Poseidon2 flavor change merges:
Buffer.alloc(4064)inaztec.js/src/contract/{contract,deploy_method}.test.ts\u2192Buffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES).VerificationKey.makeFakeMegaHonk()dropped its ~4 KB base64 blob in favor ofBuffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES).Intentionally NOT ported: the
MEGA_VK_LENGTH_IN_FIELDS 127\u2192135bump inconstants.gen.ts, which tracks the C++ flavor change that's not inmerge-train/barretenberg. The ported code is layout-agnostic.3.
chore(stdlib): drop Plonk VerificationKey/CommitmentMap/G1AffineElementDeletes the entire Plonk-era VK scaffold. Nothing reads it off the wire and nothing in Honk needs it:
VerificationKey(Plonk class withCommitmentMapof{Q_1, SIGMA_1, ...},containsRecursiveProof,recursiveProofPublicInputIndices): zero non-test callers. Every caller was itself dead (makeVerificationKeyfactory, a one-off round-trip test, or the HonkVerificationKeyDatafake helpers that were using it as a source of placeholder bytes).CommitmentMapandG1AffineElement: only referenced byVerificationKey. Gone.CircuitTypeenum (STANDARD/ULTRA) instdlib/src/types/shared.ts: only existed to type-tag Plonk VKs. Gone.makeVerificationKeyinstdlib/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 synthesizekeyAsBytesfromVerificationKeyAsFields.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 inlinesBuffer.alloc(MEGA_VK_LENGTH_IN_FIELDS * Fr.SIZE_IN_BYTES).Net: \u2212209 lines from
stdlib/src/vks/verification_key.tsplus the shared / factories / pxe updates.Scope audit (gist)
https://gist.github.com/AztecBot/67c6cc69458f63c296d0557b2e598632 (updated)
Verification
grepacrossyarn-project/confirms zero remaining references toVerificationKey.makeFake,VerificationKey.makeFakeMegaHonk,VerificationKey.fromBuffer,new VerificationKey(,CommitmentMap,G1AffineElement,CircuitType, ormakeVerificationKey. Remaining hits for the stringVerificationKeyare unrelated (VerificationKeyAsFields,VerificationKeyData,PrivateVerificationKeyHints,VerificationKeyNoirtype binding,computeVerificationKeyHash,makeProofAndVerificationKey).