Skip to content

chore: pin v6.0.0 protocol circuit and protocol contract artifacts on v6 - #25904

Merged
TomAFrench merged 2 commits into
v6from
cb/v6-pinned-protocol-artifacts
Nov 26, 2026
Merged

TomAFrench merged 2 commits into
v6from
cb/v6-pinned-protocol-artifacts

Conversation

@AztecBot

@AztecBot AztecBot commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

v6 builds the protocol circuits and protocol contracts with the artifacts that v6.0.0 shipped, 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.

File Contents
noir-projects/fnd/noir-protocol-circuits/pinned-build.tar.gz the 81 artifacts in @aztec-foundation/protocol-circuits-artifacts@6.0.0 (52 with VKs, 29 simulated)
noir-projects/fnd/noir-contracts/pinned-build.tar.gz the 3 artifacts in @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

  • Circuits: no script change. noir-protocol-circuits/bootstrap.sh build already unpacks pinned-build.tar.gz when 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 a pin-build command. Only the archive was missing on v6.
  • Contracts: noir-contracts/bootstrap.sh build unpacks pinned-build.tar.gz into target/ and stamps aztec_version = "dev", as a compiled build does. It then runs check_pinned_vks, which re-derives each private function's VK with bb aztec_process --force and 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-build compiles from source and archives only the contracts listed in protocol_contracts.json.
  • Non-protocol contracts: the fnd noir-contracts workspace holds only the 3 protocol contracts plus aztec_sublib. Account, app, standard and test contracts are in labs/noir-projects/noir-contracts, which has its own bootstrap and isn't touched here.
  • Cache key: fnd/bootstrap.sh hash covers ^noir-projects/fnd/, so the archives are part of it.

Downstream staging (stage_packages) and the labs build read target/ as before.

Provenance

The npm 6.0.0 artifacts match the hashes in #25890 exactly: all 52 circuit VK hashes in vk_hashes.txt and all 3 contract hashes in contract_hashes.txt. #25890 records those hashes as identical for a v6.0.0 build and a current v6 build.

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 bb binary 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, stamps dev, passes all 3 VK checks and compiles nothing.
  • With FeeJuice left out of the archive: the other 2 come from the pin and only protocol/fee_juice_contract goes to nargo compile.
  • Red: with one FeeJuice VK altered, check_pinned_vks fails.
  • check_pinned_vk passes on inbox_parity_4 and private_kernel_inner from 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

@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. labels Nov 25, 2026
@TomAFrench
TomAFrench marked this pull request as ready for review 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
TomAFrench merged commit d7b99ce into v6 Nov 26, 2026
11 of 13 checks passed
@TomAFrench
TomAFrench deleted the cb/v6-pinned-protocol-artifacts branch November 26, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants