feat: stamping aztec version into contract artifacts#22550
Merged
benesjan merged 14 commits intoMay 5, 2026
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5d6c31a to
b03cf2f
Compare
benesjan
commented
Apr 15, 2026
| * | ||
| * Does not include public bytecode, apart from the public_dispatch function. | ||
| * @param compiled - Noir build output. | ||
| * @returns Aztec contract build artifact. |
Contributor
Author
There was a problem hiding this comment.
Updated the docs here as they were misleading - on the input is not nargo output but the postr-processed nargo output (transpiled, aztec prefixes stripped from fn names etc.)
benesjan
commented
Apr 15, 2026
benesjan
commented
Apr 15, 2026
30b81d7 to
c050f2c
Compare
c050f2c to
af53a43
Compare
af53a43 to
0647f10
Compare
b413d74 to
4881317
Compare
benesjan
added a commit
that referenced
this pull request
Apr 17, 2026
…22590) When working on [another PR](#22550) of mine I realized that we are having a problem and that is that we have 2 paths by which contracts get compiled: 1. one is via aztec-packages bootstrap, 2. another is via `aztec compile` This started to become problematic as our contract compilation pipeline was getting more complicated: 1. nargo compile, 2. transpile, 3. strip prefixes, 4. and with that PR also inject aztec version This meant that the duplication started to have real cost. In this PR I clean this up a bit by moving the prefix stripping into the `bb aztec_process` command. This results that the compilation pipeline is simply: 1. `nargo compile`, 2. `bb aztec_process` Given that it's just 2 commands it is fine to have it be duplicated between `bootstrap.sh` and `aztec compile`. Once this is merged I will try to refactor #22550 such that the version is also injected only in `bb aztec_process`. ## AI Summary - Moved `__aztec_nr_internals__` prefix stripping into `bb aztec_process` (C++), which already handles transpilation and VK generation - Simplified the bootstrap `compile` function to just call `nargo compile` + `bb aztec_process`, removing ~50 lines of manual VK generation shell code - Removed the separate `stripInternalPrefixes()` TypeScript function from the CLI path - Deleted the now-unused `strip_aztec_nr_prefix.sh` script - Updated protocol-fuzzer scripts and docs to reflect the unified pipeline Both compilation paths (bootstrap and `aztec compile`) now go through `bb aztec_process` for all post-nargo processing, eliminating the duplication. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38fe387 to
3d9e599
Compare
benesjan
commented
May 5, 2026
| export -f get_contract_path | ||
|
|
||
| # Stamps the aztec version into a contract artifact JSON in place. Mirrors stampAztecVersion in | ||
| # yarn-project/aztec/src/cli/cmds/compile.ts so monorepo-built artifacts match those produced by `aztec compile`. |
Contributor
Author
There was a problem hiding this comment.
It's unfortunate that this is a duplicate of the typescript functionality but merging the 2 possible contract compilation paths (bootstrap.sh in monorepo and aztec compile) is not practical.
AztecBot
pushed a commit
that referenced
this pull request
May 5, 2026
Injects aztec stack version into Noir contract artifacts as it's a very useful info for debugging and other purposes (like verifying our backwards compatibility infra works). Closes [F-549](https://linear.app/aztec-labs/issue/F-549/include-aztecnr-and-stack-versions-in-contract-artifact) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
✅ Successfully backported to backport-to-v4-next-staging #22959. |
benesjan
pushed a commit
that referenced
this pull request
May 5, 2026
## Summary Fixes the merge-train/fairies CI failure introduced by #22550 (`feat: stamping aztec version into contract artifacts`). That PR added `aztecVersion` as a required field on `ContractArtifact` but missed updating the hand-rolled fixture in `pxe/src/storage/backwards_compatibility_tests/schema_tests.ts`, breaking the `yarn tsgo -b --emitDeclarationOnly` step: ``` pxe/src/storage/backwards_compatibility_tests/schema_tests.ts(658,3): error TS2741: Property 'aztecVersion' is missing in type '{...}' but required in type 'ContractArtifact'. ``` ## Fix - Add `aztecVersion: 'schema-fixture-version'` to `buildSchemaContractArtifact()` so the literal satisfies `ContractArtifact`. Uses a deterministic test-only string (rather than `DEV_VERSION`) to keep the snapshot stable across release version bumps. - Update `__snapshots__/ContractStore.json` to include the new field in the serialized hex bytes (insertion is between `name` and `functions`, matching declaration order in `ContractArtifactSchema`). ## Schema-version impact `ARTIFACT_VERSION_BEFORE_INJECTION` is the schema's default for missing `aztecVersion`, so this is **read-defaultable**, not breaking — `PXE_DATA_SCHEMA_VERSION` does not need bumping. CI log: http://ci.aztec-labs.com/1777999383723761 ClaudeBox log: https://claudebox.work/s/0e57df71aab3db0e?run=1
AztecBot
added a commit
that referenced
this pull request
May 6, 2026
rangozd
pushed a commit
to rangozd/aztec-packages
that referenced
this pull request
May 16, 2026
BEGIN_COMMIT_OVERRIDE refactor: `getPackageVersion` fn cleanup (AztecProtocol#22941) fix(ci): skip acceptance test for canary -commit. tags (AztecProtocol#22951) fix: closing db, correct stub side effects (AztecProtocol#22939) feat: wallet-sdk heartbeat (AztecProtocol#22948) chore: pxe db schema compatibility test (AztecProtocol#22872) feat: stamping aztec version into contract artifacts (AztecProtocol#22550) fix: add aztecVersion to PXE schema_tests fixture (AztecProtocol#22960) feat(pxe): deduplicate class ID verification per contract (AztecProtocol#22966) chore: add noirfmt.toml to noir-contracts and run nargo fmt (AztecProtocol#22971) feat(aztec-nr): Initial handshake registry contract with non interactive handshake function (AztecProtocol#22854) chore: merge next into merge-train/fairies (AztecProtocol#22991) fix(aztec-up): Aztec installer does not shadow user installed binaries on PATH (AztecProtocol#22902) test(ci): drop e2e_kernelless_simulation from backwards-compat e2e (AztecProtocol#23005) feat(ci): notify #team-fairies when backwards-compat e2e fails on nightly (AztecProtocol#23006) chore: merge next into merge-train/fairies (AztecProtocol#23021) fix: better DeployMethod (AztecProtocol#22985) refactor(pxe): batch RPC calls for note and event validation (AztecProtocol#22988) 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.

Injects aztec stack version into Noir contract artifacts as it's a very useful info for debugging and other purposes (like verifying our backwards compatibility infra works).
Closes F-549