Skip to content

Commit 04c9ce1

Browse files
authored
Merge pull request #256 from AztecProtocol/josh/update-version-4.2.0-aztecnr-rc.2
Update Aztec version to 4.2.0-aztecnr-rc.2 and remove devnet
2 parents b1a3d91 + 2218244 commit 04c9ce1

23 files changed

Lines changed: 401 additions & 555 deletions

.github/workflows/devnet.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/local-network.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
env:
1919
AZTEC_ENV: local-network
20-
AZTEC_VERSION: 4.0.0-devnet.2-patch.1
20+
AZTEC_VERSION: 4.2.0-aztecnr-rc.2
2121

2222
steps:
2323
- name: Checkout repository

CLAUDE.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
Aztec Starter — a Pod Racing game contract built with Noir on the Aztec network. Two players allocate points across 5 tracks over 3 rounds with private state; scores are revealed at the end (commit-reveal pattern). The player who wins more tracks (best of 5) wins.
88

9-
**Aztec version: `4.0.0-devnet.2-patch.1`** — pinned across `Nargo.toml`, `package.json`, `config/*.json`, and README. All must stay in sync when updating.
9+
**Aztec version: `4.2.0-aztecnr-rc.2`** — pinned across `Nargo.toml`, `package.json`, `config/*.json`, and README. All must stay in sync when updating.
1010

1111
## Build & Development Commands
1212

@@ -47,33 +47,31 @@ NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --
4747

4848
## Deployment & Scripts
4949

50-
All scripts support `::devnet` and `::testnet` suffixes for remote network targeting:
50+
All scripts support `::testnet` suffixes for remote network targeting:
5151

5252
```bash
5353
yarn deploy # Deploy contract to local network
54-
yarn deploy::devnet # Deploy contract to devnet
5554
yarn deploy::testnet # Deploy contract to testnet
5655
yarn deploy-account # Deploy a Schnorr account
5756
yarn multiple-wallet # Deploy from one wallet, interact from another
5857
yarn profile # Profile a transaction deployment
5958
yarn read-logs # Demo utility function for client-side debug logging
60-
yarn read-logs::devnet # Same on devnet
6159
yarn read-logs::testnet # Same on testnet
6260
```
6361

6462
## Environment Configuration
6563

66-
- `AZTEC_ENV` variable selects config: `local-network` (default), `devnet`, or `testnet`
67-
- Config files: `config/local-network.json`, `config/devnet.json`, `config/testnet.json`
64+
- `AZTEC_ENV` variable selects config: `local-network` (default) or `testnet`
65+
- Config files: `config/local-network.json`, `config/testnet.json`
6866
- `config/config.ts` — singleton `ConfigManager` loads the appropriate JSON based on `AZTEC_ENV`
6967
- `.env` stores secrets (SECRET, SIGNING_KEY, SALT, contract keys) — never commit
7068

7169
## Branch Model
7270

73-
- **`next` branch** — default branch; used for local network and devnet development
71+
- **`next` branch** — default branch; used for local network development
7472
- **`testnet` branch** — used for testnet development; may run a different Aztec version
7573

76-
Devnet PRs target `next`. Testnet PRs target `testnet`. Each branch pins its own Aztec version independently.
74+
PRs target `next`. Testnet PRs target `testnet`. Each branch pins its own Aztec version independently.
7775

7876
## Project Structure
7977

@@ -98,7 +96,7 @@ Devnet PRs target `next`. Testnet PRs target `testnet`. Each branch pins its own
9896

9997
**TypeScript utilities:**
10098

101-
- `src/utils/setup_wallet.ts` — creates `EmbeddedWallet` with environment-aware config (prover enabled on devnet)
99+
- `src/utils/setup_wallet.ts` — creates `EmbeddedWallet` with environment-aware config
102100
- `src/utils/create_account_from_env.ts` — Schnorr account from env vars
103101
- `src/utils/deploy_account.ts` — account deployment with sponsored fees
104102
- `src/utils/sponsored_fpc.ts` — SponsoredFPC (Fee Payment Contract) setup
@@ -113,7 +111,7 @@ Devnet PRs target `next`. Testnet PRs target `testnet`. Each branch pins its own
113111
- **ESM project**: `"type": "module"` in package.json. All TS scripts run via `node --loader ts-node/esm`.
114112
- **Private-public interaction**: `play_round` is private (creates `GameRoundNote` notes), then enqueues a public call (`validate_and_play_round`) to update round counters. `finish_game` reads private notes, sums them, and enqueues a public call to reveal totals.
115113
- **Fee payment**: All transactions use `SponsoredFeePaymentMethod` via the SponsoredFPC contract.
116-
- **Wallet setup**: `EmbeddedWallet.create()` with `ephemeral: true` for tests; prover is enabled only on devnet.
114+
- **Wallet setup**: `EmbeddedWallet.create()` with `ephemeral: true` for tests.
117115
- **PXE store**: Data persists in `./store`. Must delete after local network restart to avoid stale state errors.
118116

119117
## Simulate Before Send (IMPORTANT)
@@ -152,7 +150,7 @@ When updating the Aztec version, update all of these locations:
152150

153151
1. `Nargo.toml``aztec` dependency tag
154152
2. `package.json` — all `@aztec/*` dependency versions
155-
3. `config/local-network.json`, `config/devnet.json`, and/or `config/testnet.json``settings.version` (update the configs relevant to the branch you're on)
153+
3. `config/local-network.json` and/or `config/testnet.json``settings.version` (update the configs relevant to the branch you're on)
156154
4. `README.md` — install command version
157155

158156
> **Note:** The `next` and `testnet` branches may pin different Aztec versions. Only update the config files relevant to the branch.

Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = [ "" ]
55
compiler_version = ">=0.18.0"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.0.0-devnet.2-patch.1", directory = "aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.2.0-aztecnr-rc.2", directory = "aztec" }

ONBOARDING.md

Lines changed: 24 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Onboarding: From Ethereum to Aztec
22

3-
This guide takes you from "reading code in a browser" to "deploying on devnet" — progressively, with no install required until Phase 3.
3+
This guide takes you from "reading code in a browser" to "deploying contracts" — progressively, with no install required until Phase 3.
44

55
**What you'll learn:** How Aztec contracts work by studying a Pod Racing game — a two-player competitive game that uses private state to implement commit-reveal in a single transaction.
66

@@ -9,7 +9,7 @@ This guide takes you from "reading code in a browser" to "deploying on devnet"
99
* **Phases 1-2** need only a browser (read code, compile in a Codespace)
1010
* **Phases 3-6** need local tools (deploy, interact, extend, advanced topics)
1111

12-
**Aztec version pinned in this repo:** `4.0.0-devnet.2-patch.1` (check `Nargo.toml` and `package.json` for source of truth)
12+
**Aztec version pinned in this repo:** `4.2.0-aztecnr-rc.2` (check `Nargo.toml` and `package.json` for source of truth)
1313

1414
**Links:**
1515

@@ -164,7 +164,7 @@ fn create_game(game_id: Field) {
164164
// Ensure this game_id hasn't been used yet (player1 must be zero address)
165165
assert(self.storage.races.at(game_id).read().player1.eq(AztecAddress::zero()));
166166

167-
let player1 = self.context.maybe_msg_sender().unwrap();
167+
let player1 = self.msg_sender();
168168
debug_log_format(
169169
"Creating game {0} by player {1}",
170170
[game_id, player1.to_field()],
@@ -193,7 +193,7 @@ Creates a new game. Checks the game ID isn't taken (player1 must be zero address
193193
fn join_game(game_id: Field) {
194194
let maybe_existing_game = self.storage.races.at(game_id).read();
195195

196-
let player2 = self.context.maybe_msg_sender().unwrap();
196+
let player2 = self.msg_sender();
197197
debug_log_format("Player {0} joining game {1}", [player2.to_field(), game_id]);
198198

199199
// Add the caller as player2 (validates that player1 exists and player2 is empty)
@@ -236,7 +236,7 @@ fn finalize_game(game_id: Field) {
236236
}
237237
```
238238

239-
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L269-L296" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lfinalize-game</a></sub></sup>
239+
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L265-L292" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lfinalize-game</a></sub></sup>
240240

241241
After both players have revealed, this compares track scores, determines the winner, and updates the leaderboard.
242242

@@ -314,7 +314,7 @@ fn play_round(
314314
// Validate that total points don't exceed 9 (you can't max out all tracks)
315315
assert(track1 + track2 + track3 + track4 + track5 < 10);
316316

317-
let player = self.context.maybe_msg_sender().unwrap();
317+
let player = self.msg_sender();
318318
debug_log_format(
319319
"Player {0} playing round {1} in game {2}",
320320
[player.to_field(), round as Field, game_id],
@@ -336,15 +336,11 @@ fn play_round(
336336

337337
// Enqueue a public function call to update the round counter
338338
// This reveals that a round was played, but not the point allocation
339-
self.enqueue(PodRacing::at(self.context.this_address()).validate_and_play_round(
340-
player,
341-
game_id,
342-
round,
343-
));
339+
self.enqueue_self.validate_and_play_round(player, game_id, round);
344340
}
345341
```
346342

347-
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L111-L160" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lplay-round</a></sub></sup>
343+
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L111-L156" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lplay-round</a></sub></sup>
348344

349345
Three things happen here that have no direct Ethereum equivalent:
350346

@@ -361,7 +357,7 @@ Three things happen here that have no direct Ethereum equivalent:
361357
// This is the "reveal" phase where private choices become public
362358
#[external("private")]
363359
fn finish_game(game_id: Field) {
364-
let player = self.context.maybe_msg_sender().unwrap();
360+
let player = self.msg_sender();
365361
debug_log_format(
366362
"Player {0} finishing game {1}",
367363
[player.to_field(), game_id],
@@ -394,19 +390,19 @@ fn finish_game(game_id: Field) {
394390

395391
// Enqueue public function to store the revealed totals on-chain
396392
// Now the revealing player's track totals will be publicly visible
397-
self.enqueue(PodRacing::at(self.context.this_address()).validate_finish_game_and_reveal(
393+
self.enqueue_self.validate_finish_game_and_reveal(
398394
player,
399395
game_id,
400396
total_track1,
401397
total_track2,
402398
total_track3,
403399
total_track4,
404400
total_track5,
405-
));
401+
);
406402
}
407403
```
408404

409-
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L179-L230" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lfinish-game</a></sub></sup>
405+
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/src/main.nr#L175-L226" target="_blank" rel="noopener noreferrer">Source code: /src/main.nr#Lfinish-game</a></sub></sup>
410406

411407
This is the "reveal" phase:
412408

@@ -526,7 +522,7 @@ The `.devcontainer/` configures:
526522

527523
* **Base image:** Ubuntu 24.04 with Node.js v22.15.0
528524
* **Docker-in-Docker** for running the Aztec local network
529-
* **Aztec CLI** installed via `curl -fsSL "https://install.aztec.network/4.0.0-devnet.2-patch.1" | VERSION="4.0.0-devnet.2-patch.1" bash -s`
525+
* **Aztec CLI** installed via `curl -fsSL "https://install.aztec.network/4.2.0-aztecnr-rc.2" | VERSION="4.2.0-aztecnr-rc.2" bash -s`
530526
* **VS Code extension:** `noir-lang.vscode-noir` for Noir syntax highlighting
531527
* **Dependencies:** `yarn install` runs automatically
532528

@@ -737,7 +733,7 @@ pub unconstrained fn setup() -> (TestEnvironment, AztecAddress, AztecAddress) {
737733
**Aztec toolkit:**
738734

739735
```bash
740-
export VERSION=4.0.0-devnet.2-patch.1
736+
export VERSION=4.2.0-aztecnr-rc.2
741737
curl -fsSL "https://install.aztec.network/${VERSION}" | VERSION="${VERSION}" bash -s
742738
```
743739

@@ -801,25 +797,11 @@ private constructor() {
801797
}
802798
```
803799

804-
**`config/devnet.json`:**
805-
806-
```json
807-
{
808-
"name": "devnet",
809-
"environment": "devnet",
810-
"network": {
811-
"nodeUrl": "https://next.devnet.aztec-labs.com",
812-
"l1RpcUrl": "https://ethereum-sepolia-rpc.publicnode.com",
813-
"l1ChainId": 11155111
814-
}
815-
}
816-
```
817-
818800
Key exports from `config/config.ts`:
819801

820802
* `getAztecNodeUrl()` — returns the node URL for the current environment
821-
* `getTimeouts()` — returns environment-specific timeout values (local: 60s tx, devnet: 180s tx)
822-
* `getEnv()` — returns the environment name (`"local-network"` or `"devnet"`)
803+
* `getTimeouts()` — returns environment-specific timeout values
804+
* `getEnv()` — returns the environment name (e.g. `"local-network"`)
823805

824806
***
825807

@@ -880,14 +862,15 @@ const deployRequest = PodRacingContract.deploy(wallet, address);
880862
await deployRequest.simulate({
881863
from: address,
882864
});
883-
const { contract: podRacingContract, instance } = await deployRequest.send({
865+
const { contract: podRacingContract, receipt: deployReceipt } = await deployRequest.send({
884866
from: address,
885867
fee: { paymentMethod: sponsoredPaymentMethod },
886-
wait: { timeout: timeouts.deployTimeout, returnReceipt: true }
868+
wait: { timeout: timeouts.deployTimeout }
887869
});
870+
const instance = deployReceipt.instance;
888871
```
889872

890-
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/scripts/deploy_contract.ts#L44-L54" target="_blank" rel="noopener noreferrer">Source code: /scripts/deploy_contract.ts#Ldeploy-contract</a></sub></sup>
873+
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/scripts/deploy_contract.ts#L44-L55" target="_blank" rel="noopener noreferrer">Source code: /scripts/deploy_contract.ts#Ldeploy-contract</a></sub></sup>
891874

892875
> **Important:** Always call `.simulate()` before `.send()`. Simulation runs the transaction locally and surfaces revert reasons immediately. Without it, a failing transaction hangs until timeout with an opaque error.
893876
@@ -1017,7 +1000,7 @@ yarn test:js
10171000

10181001
## Phase 6: Advanced Topics
10191002

1020-
**Goal:** Explore multi-wallet patterns, fee strategies, devnet, and profiling.
1003+
**Goal:** Explore multi-wallet patterns, fee strategies, and profiling.
10211004

10221005
### 6.1 — Multiple Wallets / Multiple PXEs
10231006

@@ -1032,7 +1015,7 @@ const wallet1 = await EmbeddedWallet.create(node, walletOpts);
10321015
const wallet2 = await EmbeddedWallet.create(node, walletOpts);
10331016
```
10341017

1035-
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/scripts/multiple_wallet.ts#L39-L42" target="_blank" rel="noopener noreferrer">Source code: /scripts/multiple_wallet.ts#Lmultiple-wallets</a></sub></sup>
1018+
<sup><sub><a href="https://github.com/AztecProtocol/aztec-starter/blob/main/scripts/multiple_wallet.ts#L40-L43" target="_blank" rel="noopener noreferrer">Source code: /scripts/multiple_wallet.ts#Lmultiple-wallets</a></sub></sup>
10361019

10371020
It then deploys a Token contract from wallet1, creates an account on wallet2, mints tokens to wallet2's account, registers the token contract on wallet2, and reads balances.
10381021

@@ -1058,20 +1041,7 @@ yarn multiple-wallet
10581041
yarn fees
10591042
```
10601043

1061-
### 6.3 — Deploying to Devnet
1062-
1063-
All scripts support a `::devnet` suffix:
1064-
1065-
```bash
1066-
yarn deploy::devnet
1067-
yarn deploy-account::devnet
1068-
yarn interaction-existing-contract::devnet
1069-
yarn test::devnet
1070-
```
1071-
1072-
Devnet uses real provers and connects to the Aztec devnet at `https://next.devnet.aztec-labs.com` with Sepolia as the L1. Timeouts are longer (deploy: 20 min, tx: 3 min) to account for real proving time.
1073-
1074-
### 6.4 — Transaction Profiling
1044+
### 6.3 — Transaction Profiling
10751045

10761046
**`scripts/profile_deploy.ts`** shows how to profile a transaction:
10771047

@@ -1088,7 +1058,7 @@ The `.profile()` method runs the transaction through the prover and returns deta
10881058
yarn profile
10891059
```
10901060

1091-
### 6.5 — Querying Blocks
1061+
### 6.4 — Querying Blocks
10921062

10931063
**`scripts/get_block.ts`** shows how to query the Aztec node directly:
10941064

@@ -1137,7 +1107,6 @@ yarn get-block
11371107
| `scripts/get_block.ts` | Block querying |
11381108
| `config/config.ts` | Config manager (loads JSON by env) |
11391109
| `config/local-network.json` | Local network configuration |
1140-
| `config/devnet.json` | Devnet configuration |
11411110
| `Nargo.toml` | Noir project manifest |
11421111
| `.devcontainer/devcontainer.json` | GitHub Codespace configuration |
11431112
| `.devcontainer/Dockerfile` | Codespace Docker image |
@@ -1162,16 +1131,13 @@ yarn get-block
11621131
| `yarn get-block` | Query block data |
11631132
| `yarn clean` | Delete `./src/artifacts` and `./target` |
11641133
| `yarn clear-store` | Delete `./store` (PXE data) |
1165-
| `yarn deploy::devnet` | Deploy to devnet |
1166-
| `yarn test::devnet` | Run E2E tests on devnet |
11671134

11681135
### C. Troubleshooting
11691136

11701137
| Problem | Solution |
11711138
| -------------------------------------------------------- | ------------------------------------------------------------------------ |
11721139
| "Store" or PXE errors after restarting the local network | Delete `./store`: `rm -rf ./store` |
11731140
| Compilation errors after updating dependencies | Run `yarn compile` again |
1174-
| Timeout errors on devnet | Check timeout values in `config/devnet.json` (deploy: 20 min, tx: 3 min) |
11751141
| "Contract not registered" error | Call `wallet.registerContract(instance, artifact)` before interacting |
11761142
| Account not found | Ensure `.env` has correct `SECRET`, `SIGNING_KEY`, and `SALT` values |
11771143
| Local network not starting | Ensure Docker is running and the correct Aztec version is installed |

0 commit comments

Comments
 (0)