Update all examples to Aztec v5.0.0-rc.1#38
Merged
Conversation
Bump every example from v4.3.0 to v5.0.0-rc.1 and migrate code to the v5
APIs, following the aztec-kit (release/v5.0.0-rc.1) conventions where relevant.
Version bumps:
- Nargo.toml git deps: tag v4.3.0 -> v5.0.0-rc.1 (aztec-nr, uint-note,
balance-set, bb_proof_verification)
- package.json @aztec/* deps: 4.3.0 -> 5.0.0-rc.1; reconciled package names
to actual imports (added @aztec/constants, @aztec/entrypoints where used)
- docs/CI: aztec-up 5.0.0-rc.1, bundled nargo 1.0.0-beta.21 -> 1.0.0-beta.22
Noir (Aztec.nr) migration:
- MessageDelivery.X -> MessageDelivery::x(); messages::message_delivery ->
messages::delivery
- context.push_nullifier -> push_nullifier_unsafe
- uint-note local copy ported to v5 (npk_m_hash, compute_note_hash/nullifier
helpers, DOM_SEP__PARTIAL_NOTE_COMMITMENT)
TypeScript (Aztec.js) migration:
- prefunded test accounts are now initializerless:
createSchnorrAccount -> createSchnorrInitializerlessAccount
- DeployMethod address opts moved to construction-time options bag;
.send() returns { contract, receipt, instance }
- gas: estimatedGas result -> gasUsed with { includeMetadata: true }
- account-contract: AccountContract/Account interface overhaul
(getAccount, getImmutablesHash, wrapExecutionPayload, chainInfo)
- recursive_verification: regenerated data.json (proof 500 -> 458 fields)
Verified: every Noir contract/circuit compiles under the installed
v5.0.0-rc.1 toolchain; all TypeScript typechecks/builds. Live-network
integration tests (require aztec start --local-network) are exercised by CI.
- root README.md + CLAUDE.md: drop removed starter-token; document all current examples; fix project structure, CI list, dependency snippet, and stale proof field count (508 -> 458) - replace dead `aztec start --sandbox` with `aztec start --local-network` (the flag was removed in v5) across READMEs and run-tests.sh scripts - standardize on yarn: convert prediction-market CI/scripts from bun to yarn (add --experimental-vm-modules flag jest needs, matching note-send-proof); fix bun/npm drift in recursive_verification and note-send-proof docs/scripts; refresh stale recursive_verification/debug.sh
Running the example end-to-end surfaced two real (pre-existing) bugs that compile/typecheck could not catch — and that no CI covers for this example: 1. The script registered an AccountManager with a fresh random secret/salt, so the "registered" account never matched the deployed contract. 2. The account cannot self-deploy: its entrypoint authorizes a tx by reading the `hashed_password` PublicImmutable, which is only written by its own constructor's enqueued public call — unavailable on its first tx. The prior NO_FROM / DeployMethod path also failed (`Expected a single call, got 4`). Deploy the account as a regular contract (Contract.deploy with publicKeys + universalDeploy) from a prefunded local-network test account that pays the fee, mirroring the working prediction-market deploy. Verified end-to-end against a local v5 network: the contract deploys and the registered account address matches the deployed instance. Also re-add @aztec/accounts (needed for getInitialTestAccountsData) and drop @aztec/constants / @aztec/noir-contracts.js (no longer used).
These two examples had no CI, which is exactly why the account-contract runtime breakage went unnoticed (it compiled + typechecked but never ran). - account-contract-tests.yml: install Aztec, start a local network, compile the contract, and run the deploy script (`yarn deploy`) as a smoke test. - custom-note-tests.yml: contract-only, so it just compiles (no network). Also add `ccc`/`deploy` scripts to account-contract/package.json and list the two new workflows in CLAUDE.md.
Address codex review of the new account-contract CI: - deploy script now throws (non-zero exit) if the deployed address does not match the AccountManager-registered address, instead of just logging it — so the smoke test actually fails CI when the invariant breaks. - workflow fails fast if the local network never becomes ready. - use `yarn install --frozen-lockfile` (verified in sync) to catch lock drift.
offchain-account-ownership/ and streaming-payments/ contained only a .gitignore (no example content). Remove them and their references in the root README.md and CLAUDE.md project structure. Also gitignore the .playwright-mcp/ tool-artifact directory so it stays out of the repo.
57320f4 to
78b1577
Compare
A custom account contract can't be transacted through with the current tooling: the standard EmbeddedWallet resolves a tx's `from` to a built-in schnorr/ecdsa account by type and has no hook to register a custom account, so the example could only ever deploy — never actually be used. Rather than ship a deploy-only example that misleads (or maintain fragile low-level PXE plumbing), remove it along with its CI workflow and doc references. The repo now covers 5 working examples, all green in CI.
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.
Updates every example in the repo from Aztec v4.3.0 to v5.0.0-rc.1, migrating both Noir and TypeScript to the v5 APIs and following the aztec-kit conventions where relevant. All five examples build/run on v5 and are covered by CI.
Scope
custom-notenote-send-proofprediction-marketrecursive_verificationdata.jsonregeneratedtest-wallet-webappvite buildVersion bumps
Nargo.tomlgit deps:tag = "v4.3.0"→v5.0.0-rc.1(aztec-nr, uint-note, balance-set,bb_proof_verification)package.json@aztec/*:4.3.0→5.0.0-rc.1; package names reconciled to actual imports (e.g.@aztec/constants,@aztec/entrypointsadded where used)aztec-up 5.0.0-rc.1; bundled nargo1.0.0-beta.21→1.0.0-beta.22; CIAZTEC_VERSION: 5.0.0-rc.1Key API migrations
Noir (Aztec.nr)
MessageDelivery.X→MessageDelivery::x();messages::message_delivery→messages::deliverycontext.push_nullifier→push_nullifier_unsafeuint-notelocal copy ported to v5 (npk_m_hash,compute_note_hash/compute_note_nullifier,DOM_SEP__PARTIAL_NOTE_COMMITMENT)TypeScript (Aztec.js)
createSchnorrAccount→createSchnorrInitializerlessAccountDeployMethodaddress-affecting options moved to construction-time bag;.send()returns{ contract, receipt, instance }estimatedGasresult →gasUsedvia{ includeMetadata: true }recursive_verification:data.jsonregenerated (UltraHonk proof500→458fields)Removed: account-contract example
The repo previously had a custom password-based account contract example. While migrating it I found it can't be exercised on v5 with the standard tooling: the
EmbeddedWalletresolves a tx'sfromto a built-in schnorr/ecdsa account by type and offers no hook to register a custom account, so the example could only ever deploy — never actually authorize/send a tx through its entrypoint. (This isn't specific to the password design — it applies to any custom account type, and the aztec-kit reference only ever sends from schnorr/ecdsa accounts.) Rather than ship a deploy-only example that misleads — or maintain fragile low-level PXE plumbing — the example was removed along with its CI workflow and doc references.CI coverage
Added
custom-note-tests.yml(contract-only compile) so the one remaining example that lacked CI is now covered. All five examples are in CI.Docs / tooling cleanup
README.md+CLAUDE.md: removed the stalestarter-tokenreferences; documented all current examples; corrected the project structure, CI list, and dependency snippet.aztec start --sandboxwithaztec start --local-network(the--sandboxflag no longer exists in v5) across READMEs and helper scripts.bun-basedprediction-marketCI/scripts to yarn (adding the--experimental-vm-modulesflag its jest setup requires, matchingnote-send-proof); fixedbun/npmdrift inrecursive_verification/note-send-proofdocs and scripts; refreshed the stalerecursive_verification/debug.sh.offchain-account-ownership/andstreaming-payments/(each held only a.gitignore) and gitignored the.playwright-mcp/tool-artifact dir.Verification
Every Noir contract/circuit compiles under the installed
5.0.0-rc.1toolchain and all TypeScript typechecks/builds. The integration-test workflows run against a live local network. All five CI workflows are green on the latest commit.