From 6567e9f5fc2f2a4cfaceefb3f65912258a784164 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 21 May 2026 10:19:41 +0000 Subject: [PATCH 1/2] fix(release-image): stamp aztec_version in published contract artifacts The v4.3.0 release shipped contract artifact JSONs with aztec_version: "dev" baked in, because release-image/Dockerfile copies pre-built artifacts from an earlier stage where REF_NAME isn't set (so stamp_aztec_version in noir-projects/noir-contracts/bootstrap.sh falls back to "dev"). Mirror the stdlib/package.json stamp pattern (75fd494a43) to re-stamp aztec_version in every artifact under accounts/, noir-contracts.js/, and noir-test-contracts.js/ at image-build time. Also bypass the compat e2e assertContractArtifactsVersion() check narrowly for expected === "4.3.0" && aztecVersion === "dev" so the compat job stops failing against the already-published broken 4.3.0 artifacts. Other versions still fail loudly if they ever report "dev". Co-Authored-By: Claude Opus 4.7 (1M context) --- release-image/Dockerfile | 13 +++++++++++++ yarn-project/end-to-end/src/fixtures/setup.ts | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/release-image/Dockerfile b/release-image/Dockerfile index 4cd9d90a4407..d1369a8c5c1e 100644 --- a/release-image/Dockerfile +++ b/release-image/Dockerfile @@ -22,4 +22,17 @@ RUN echo '{".": "'$VERSION'"}' > /usr/src/.release-please-manifest.json RUN jq --arg v "$VERSION" '.version = $v' /usr/src/yarn-project/stdlib/package.json > /tmp/p.json \ && mv /tmp/p.json /usr/src/yarn-project/stdlib/package.json +# Re-stamp aztec_version in published contract artifacts. Mirrors stamp_aztec_version() in +# noir-projects/noir-contracts/bootstrap.sh and stampAztecVersion() in +# yarn-project/aztec/src/cli/cmds/compile.ts. Needed because artifacts are compiled in an earlier +# build stage where REF_NAME isn't set, leaving them with aztec_version: "dev". +RUN for dir in \ + /usr/src/yarn-project/accounts/artifacts \ + /usr/src/yarn-project/noir-contracts.js/artifacts \ + /usr/src/yarn-project/noir-test-contracts.js/artifacts; do \ + for f in "$dir"/*.json; do \ + jq --arg v "$VERSION" '.aztec_version = $v' "$f" > /tmp/a.json && mv /tmp/a.json "$f"; \ + done; \ + done + ENTRYPOINT ["node", "--no-warnings", "/usr/src/yarn-project/aztec/dest/bin/index.js"] diff --git a/yarn-project/end-to-end/src/fixtures/setup.ts b/yarn-project/end-to-end/src/fixtures/setup.ts index 3b785184226c..68e785a2c961 100644 --- a/yarn-project/end-to-end/src/fixtures/setup.ts +++ b/yarn-project/end-to-end/src/fixtures/setup.ts @@ -54,6 +54,7 @@ import { type ContractInstanceWithAddress, getContractInstanceFromInstantiationP import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client'; import { tryStop } from '@aztec/stdlib/interfaces/server'; import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees'; +import { DEV_VERSION } from '@aztec/stdlib/update-checker'; import { type TelemetryClient, type TelemetryClientConfig, @@ -283,6 +284,15 @@ function assertContractArtifactsVersion() { ); return; } + // TODO(F-557): Remove once v4.3.0 drops off the compat matrix. The v4.3.0 release shipped with + // aztec_version: "dev" baked into the published artifact JSONs because release-image/Dockerfile + // did not re-stamp them. Fixed for future releases by the artifact restamp step in that Dockerfile. + if (expected === '4.3.0' && aztecVersion === DEV_VERSION) { + createLogger('e2e:setup').warn( + `Skipping artifact version check: v4.3.0 artifacts shipped with aztec_version="dev"`, + ); + return; + } if (aztecVersion !== expected) { throw new Error( `Artifact version mismatch: expected ${expected} but got ${aztecVersion}. ` + From d18ec88b5a69c726d0575c22d30de150b07b622a Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 21 May 2026 13:06:37 +0000 Subject: [PATCH 2/2] fixes --- ci3/release_prep_package_json | 10 +++++++++ noir-projects/noir-contracts/bootstrap.sh | 21 ++++++++----------- release-image/Dockerfile | 7 +++---- yarn-project/end-to-end/src/fixtures/setup.ts | 5 ++--- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/ci3/release_prep_package_json b/ci3/release_prep_package_json index ee6aa8bb7839..f135df7b44a5 100755 --- a/ci3/release_prep_package_json +++ b/ci3/release_prep_package_json @@ -22,3 +22,13 @@ for deps in dependencies devDependencies peerDependencies; do mv tmp.json package.json done done + +# Stamp aztec_version into any published noir contract artifacts in artifacts/*.json. The build-time stamp in +# noir-projects/noir-contracts/bootstrap.sh writes "dev"; $version here is the authoritative release version about to +# be written to package.json. We cannot stamp real version in bootstrap because there we don't have access to it. +if [ -d artifacts ]; then + for f in artifacts/*.json; do + [ -e "$f" ] || continue + jq --arg v "$version" '.aztec_version = $v' "$f" >$tmp && mv $tmp "$f" + done +fi diff --git a/noir-projects/noir-contracts/bootstrap.sh b/noir-projects/noir-contracts/bootstrap.sh index 3e8f14e1abb1..4e4566f4d7a9 100755 --- a/noir-projects/noir-contracts/bootstrap.sh +++ b/noir-projects/noir-contracts/bootstrap.sh @@ -93,19 +93,16 @@ function get_contract_path { } 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`. -# On release builds (REF_NAME is valid semver) the tag without the leading "v" is used; otherwise "dev". -function stamp_aztec_version { +# Stamps "dev" (DEV_VERSION) as the artifact's aztec_version - that is the expected version of a locally checked out +# monorepo. The real release version is applied at publish time by whichever path owns it: +# ci3/release_prep_package_json for npm packages, release-image/Dockerfile for the docker image. +function stamp_dev_aztec_version { local json_path=$1 - # "dev" here corresponds to DEV_VERSION in yarn-project/stdlib/src/update-checker/dev_version.ts. - local version="dev" - semver check "$REF_NAME" 2>/dev/null && version="${REF_NAME#v}" local tmp=$(mktemp) - jq --arg v "$version" '.aztec_version = $v' "$json_path" > "$tmp" + jq '.aztec_version = "dev"' "$json_path" > "$tmp" mv "$tmp" "$json_path" } -export -f stamp_aztec_version +export -f stamp_dev_aztec_version # This compiles a noir contract, transpiles public functions, strips internal prefixes, # and generates verification keys for private functions via 'bb aztec_process'. @@ -127,9 +124,9 @@ function compile { $BB aztec_process -i $json_path cache_upload contract-$contract_hash.tar.gz $json_path fi - # Stamp the current version after the cache block so the field always matches the build's version, whether - # the artifact came from a fresh compile or a cache hit. - stamp_aztec_version "$json_path" + # Stamp the version after the cache block so the field is always present, whether the artifact came from a fresh + # compile or a cache hit. + stamp_dev_aztec_version "$json_path" } export -f compile diff --git a/release-image/Dockerfile b/release-image/Dockerfile index d1369a8c5c1e..19f135002afc 100644 --- a/release-image/Dockerfile +++ b/release-image/Dockerfile @@ -22,10 +22,9 @@ RUN echo '{".": "'$VERSION'"}' > /usr/src/.release-please-manifest.json RUN jq --arg v "$VERSION" '.version = $v' /usr/src/yarn-project/stdlib/package.json > /tmp/p.json \ && mv /tmp/p.json /usr/src/yarn-project/stdlib/package.json -# Re-stamp aztec_version in published contract artifacts. Mirrors stamp_aztec_version() in -# noir-projects/noir-contracts/bootstrap.sh and stampAztecVersion() in -# yarn-project/aztec/src/cli/cmds/compile.ts. Needed because artifacts are compiled in an earlier -# build stage where REF_NAME isn't set, leaving them with aztec_version: "dev". +# Stamp aztec_version into the shipped contract artifacts. The build-time stamp in +# noir-projects/noir-contracts/bootstrap.sh writes "dev" unconditionally; $VERSION here is the authoritative release +# version for this image. RUN for dir in \ /usr/src/yarn-project/accounts/artifacts \ /usr/src/yarn-project/noir-contracts.js/artifacts \ diff --git a/yarn-project/end-to-end/src/fixtures/setup.ts b/yarn-project/end-to-end/src/fixtures/setup.ts index 68e785a2c961..0bf8c911c982 100644 --- a/yarn-project/end-to-end/src/fixtures/setup.ts +++ b/yarn-project/end-to-end/src/fixtures/setup.ts @@ -284,9 +284,8 @@ function assertContractArtifactsVersion() { ); return; } - // TODO(F-557): Remove once v4.3.0 drops off the compat matrix. The v4.3.0 release shipped with - // aztec_version: "dev" baked into the published artifact JSONs because release-image/Dockerfile - // did not re-stamp them. Fixed for future releases by the artifact restamp step in that Dockerfile. + // TODO(F-557): Remove once v4.3.0 drops off the compat matrix. The v4.3.0 npm release shipped with + // aztec_version: "dev" baked into the artifact JSONs because of a bug. if (expected === '4.3.0' && aztecVersion === DEV_VERSION) { createLogger('e2e:setup').warn( `Skipping artifact version check: v4.3.0 artifacts shipped with aztec_version="dev"`,