Repository navigation
chore: pin v6.0.0 protocol circuit and protocol contract artifacts on v6 - #25904
Merged
Merged
Conversation
TomAFrench
marked this pull request as ready for review
November 25, 2026 13:31
TomAFrench
requested review from
IlyasRidhuan,
LeilaWang,
iAmMichaelConnor and
iakovenkos
as code owners
November 25, 2026 13:31
TomAFrench
pushed a commit
that referenced
this pull request
Nov 25, 2026
…tstrap (#25905) ## What `noir-projects/fnd/noir-contracts/bootstrap.sh` gets the same pinned-build support that `noir-protocol-circuits/bootstrap.sh` already has. A release branch can commit `pinned-build.tar.gz` holding its deployed protocol contract artifacts, and its builds then use those artifacts instead of compiling. A later Noir, transpiler or bb change on that branch can't then move a protocol contract class id. This is the script half of #25904 (v6), so it's in place when the v7 branch is cut. No archive is committed here, so `next` keeps compiling every contract from source. ## How - `build`, with no arguments and with `pinned-build.tar.gz` present: - unpacks the archive into `target/` and stamps `aztec_version = "dev"`, as a compiled build does; - runs `check_pinned_vks` on each pinned artifact. It re-derives every private function's VK with `bb aztec_process --force` and fails if any differs from the pinned one, since a bb proof-system change can move a VK without any bytecode change; - compiles every workspace contract whose artifact isn't in the archive, so only the pinned protocol contracts skip compilation. - `build` without the archive is unchanged, and so is `compile <contract>`, which always builds from source. - `pin-build` compiles from source and archives only the contracts listed in `protocol_contracts.json`. - `artifact_name` is a new helper that computes the `<package>-<contract>` artifact name, used by both `compile` and the pinned build. ## Testing - On `next` this changes nothing: no archive exists, so `build` takes the existing compile path. Full coverage is left to CI. - The same script change passed CI on v6 in #25904, which runs the pinned path: [contracts log](http://ci.aztec-labs.com/289e238645f83280), where all 3 protocol contracts were unpacked, their VK checks passed and nothing was compiled. - Locally on v6, with FeeJuice removed from the archive, only `protocol/fee_juice_contract` was sent to `nargo compile`. With one pinned VK altered, `check_pinned_vks` failed. --- *Created by [claudebox](https://claudebox.work/v2/sessions/f8abc49b616c2670/jobs/10) · group: `slackbot` · requested by Tom (@TomAFrench) · [Slack thread](https://aztecfoundation.slack.com/archives/C0BGWV0P23F/p1795611795058329?thread_ts=1795611795.058329&cid=C0BGWV0P23F)*
TomAFrench
approved these changes
Nov 26, 2026
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.
What
v6 builds the protocol circuits and protocol contracts with the artifacts that
v6.0.0shipped, instead of compiling them from source. A compiler change (for example the Noir v1.0.0 bump in #25893) can then land on v6 without moving any circuit VK or protocol contract class id. Every other contract still compiles from source.noir-projects/fnd/noir-protocol-circuits/pinned-build.tar.gz@aztec-foundation/protocol-circuits-artifacts@6.0.0(52 with VKs, 29 simulated)noir-projects/fnd/noir-contracts/pinned-build.tar.gz@aztec-foundation/protocol-contracts-artifacts@6.0.0(ContractClassRegistry, ContractInstanceRegistry, FeeJuice)Both archives hold the published npm files byte-for-byte, so anyone can check them against the registry tarballs.
How
noir-protocol-circuits/bootstrap.shbuildalready unpackspinned-build.tar.gzwhen it exists instead of compiling. It recomputes every pinned VK with the current bb and fails on a mismatch (check_pinned_vk), and it has apin-buildcommand. Only the archive was missing on v6.noir-contracts/bootstrap.shbuildunpackspinned-build.tar.gzintotarget/and stampsaztec_version = "dev", as a compiled build does. It then runscheck_pinned_vks, which re-derives each private function's VK withbb aztec_process --forceand fails if any differs from the pinned one. It then compiles every workspace contract whose artifact is not in the archive, so only the contracts in the pin skip compilation.compile <contract>still compiles from source.pin-buildcompiles from source and archives only the contracts listed inprotocol_contracts.json.noir-contractsworkspace holds only the 3 protocol contracts plusaztec_sublib. Account, app, standard and test contracts are inlabs/noir-projects/noir-contracts, which has its own bootstrap and isn't touched here.fnd/bootstrap.sh hashcovers^noir-projects/fnd/, so the archives are part of it.Downstream staging (
stage_packages) and the labs build readtarget/as before.Provenance
The npm
6.0.0artifacts match the hashes in #25890 exactly: all 52 circuit VK hashes invk_hashes.txtand all 3 contract hashes incontract_hashes.txt. #25890 records those hashes as identical for av6.0.0build and a currentv6build.Trade-off
With the pins in place, a change to the Noir source of a protocol circuit or protocol contract on v6 has no effect on what's built until someone runs
pin-build. On a frozen release branch that's the point: re-pinning is a protocol upgrade.Noir tests (
nargo test,nargo execute) still run against source.Testing
All runs used the
bbbinary shipped in@aztec-foundation/bb.js@6.0.0. The build cache wasn't reachable from here, so v6's own bb and nargo haven't been run locally.noir-contracts/bootstrap.sh: unpacks the 3 contracts, stampsdev, passes all 3 VK checks and compiles nothing.protocol/fee_juice_contractgoes tonargo compile.check_pinned_vksfails.check_pinned_vkpasses oninbox_parity_4andprivate_kernel_innerfrom the circuit archive.The full build and suite are left to CI.
Relation to #25890: that PR fails CI when the built artifacts move, which also blocks compiler bumps whose output differs. With this PR the protocol artifacts come from the pin rather than the compiler, so the circuit and contract hash checks there become unnecessary. The L1 bytecode check there is independent of this PR.
Created by claudebox · group:
slackbot· requested by Tom (@TomAFrench) · Slack thread