Skip to content

Commit c979f50

Browse files
critesjoshclaude
andcommitted
Update Aztec to v4.0.0-devnet.2-patch.1
- Bump aztec-nr tag in Nargo.toml - Bump all @aztec/* packages in package.json - Replace @aztec/test-wallet (removed) with @aztec/wallets + @aztec/wallet-sdk - Add @aztec/constants and @aztec/entrypoints dependencies - Migrate TestWallet → EmbeddedWallet across all TS files - Fix registerSender() calls (now requires alias argument) - Fix Noir debug_log import: oracle::debug_log → oracle::logging - Update config JSON files, Dockerfile, CI workflow, and README - Simplify multiple_wallet.ts (EmbeddedWallet handles PXE stores internally) - Update AGENTS.md with accurate testing and setup instructions - Fix README: install instructions, env var names, test descriptions All tests pass: 16 Noir TXE + 16 TypeScript E2E. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f7413f4 commit c979f50

17 files changed

Lines changed: 323 additions & 354 deletions

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL ["/bin/bash", "-c"]
33

44
ENV NVM_DIR=/root/.nvm
55
ENV NODE_VERSION=22.15.0
6-
ARG AZTEC_VERSION=4.0.0-devnet.1-patch.0
6+
ARG AZTEC_VERSION=4.0.0-devnet.2-patch.1
77
ENV AZTEC_VERSION=$AZTEC_VERSION
88
ENV NON_INTERACTIVE=1
99
ENV BIN_PATH=/usr/local/bin

.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-nightly.20260211
20+
AZTEC_VERSION: 4.0.0-devnet.2-patch.1
2121

2222
steps:
2323
- name: Checkout repository

AGENTS.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
# Repository guidelines for Codex agents
22

3-
This repository contains TypeScript scripts and Noir contracts for the Aztec local network.
3+
This repository contains TypeScript scripts and Noir contracts for the Aztec network.
44
Follow these guidelines when contributing:
55

66
## Setup
77
- Use **Node.js v22** with Yarn.
88
- Install dependencies with `yarn install`.
9-
- Start the Aztec local network using `aztec start --local-network` before running tests or scripts.
9+
- The Aztec CLI (`aztec`) must be installed at the version matching `Nargo.toml` and `package.json`.
10+
- Start the Aztec local network with `aztec start --local-network` before running E2E tests or scripts. This is **not** needed for compilation or Noir unit tests.
11+
- After restarting the local network, always run `rm -rf ./store` to clear stale PXE data.
1012

1113
## Development
14+
- This is an ESM project (`"type": "module"` in `package.json`).
1215
- Compile contracts with `yarn compile` and generate TypeScript artifacts with `yarn codegen`.
1316
- Use four spaces for indentation in TypeScript and scripts.
1417
- Do not commit generated artifacts (`src/artifacts`, `target`, or `store` folders).
18+
- Never edit `src/artifacts/PodRacing.ts` directly; it is generated by `yarn codegen`.
19+
- To target devnet instead of local network, set `AZTEC_ENV=devnet` (e.g. `AZTEC_ENV=devnet yarn deploy`).
1520

1621
## Testing
17-
- Run `yarn test` and ensure it passes before committing. This runs both the TypeScript tests and Noir tests.
22+
There are two independent test systems:
23+
- **Noir TXE tests** (`yarn test:nr`): Run in the TXE simulator, no network required.
24+
- **TypeScript E2E tests** (`yarn test:js`): Require a running local network.
25+
- `yarn test` runs both. Ensure tests pass before committing.
1826

1927
## Pull Requests
2028
- Use clear commit messages and provide a concise description in the PR body about the change.
2129
- Mention which tests were executed.
22-

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.1-patch.0", directory = "aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.0.0-devnet.2-patch.1", directory = "aztec" }

README.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,11 @@ Use **Node.js version 22.15.0**.
3838

3939
[Start your codespace from the codespace dropdown](https://docs.github.com/en/codespaces/getting-started/quickstart).
4040

41-
Get the **local network, aztec-cli, and other tooling** with this command:
41+
Install the **Aztec toolkit** (local network, CLI, and other tooling) at the correct version:
4242

4343
```bash
44-
bash -i <(curl -s https://install.aztec.network)
45-
```
46-
47-
Install the correct version of the toolkit with:
48-
49-
```bash
50-
export VERSION=4.0.0-devnet.1-patch.0
51-
aztec-up && docker pull aztecprotocol/aztec:$VERSION && docker tag aztecprotocol/aztec:$VERSION aztecprotocol/aztec:latest
44+
export VERSION=4.0.0-devnet.2-patch.1
45+
curl -fsSL "https://install.aztec.network/${VERSION}" | VERSION="${VERSION}" bash -s
5246
```
5347

5448
### Environment Configuration
@@ -58,7 +52,7 @@ This project uses JSON configuration files to manage environment-specific settin
5852
- `config/local-network.json` - Configuration for local network development
5953
- `config/devnet.json` - Configuration for devnet deployment
6054

61-
The system automatically loads the appropriate configuration file based on the `ENV` environment variable. If `ENV` is not set, it defaults to `local-network`.
55+
The system automatically loads the appropriate configuration file based on the `AZTEC_ENV` environment variable. If `AZTEC_ENV` is not set, it defaults to `local-network`.
6256

6357
The configuration files contain network URLs, timeouts, and environment-specific settings. You can modify these files to customize your development environment.
6458

@@ -89,7 +83,7 @@ yarn deploy-account::devnet # Deploy account to devnet
8983
yarn interaction-existing-contract::devnet # Interact with devnet contracts
9084
```
9185

92-
The `::devnet` suffix automatically sets `ENV=devnet`, loading configuration from `config/devnet.json`.
86+
The `::devnet` suffix automatically sets `AZTEC_ENV=devnet`, loading configuration from `config/devnet.json`.
9387

9488
---
9589

@@ -163,9 +157,9 @@ Then test with:
163157
yarn test
164158
```
165159

166-
Testing will run the **TypeScript tests** defined in `index.test.ts` inside `./src/test/e2e`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/developers/guides/smart_contracts/testing) tests defined in [`first.nr`](./src/test/first.nr) (imported in the contract file with `mod test;`).
160+
Testing will run the **TypeScript E2E tests** defined in `./src/test/e2e/`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/developers/guides/smart_contracts/testing) tests defined in [`./src/test/`](./src/test/) (imported in the contract file with `mod test;`).
167161

168-
Note: The Typescript tests spawn an instance of the local network to test against, and close it once the TS tests are complete.
162+
Note: The TypeScript tests require a running local network. The Noir TXE tests (`yarn test:nr`) run without a network.
169163

170164
---
171165

@@ -186,7 +180,7 @@ You can find a handful of scripts in the `./scripts` folder.
186180
The `./src/utils/` folder contains utility functions:
187181

188182
- `./src/utils/create_account_from_env.ts` provides functions to create Schnorr accounts from environment variables (SECRET, SIGNING_KEY, and SALT), useful for account management across different environments.
189-
- `./src/utils/setup_wallet.ts` provides a function to set up and configure the TestWallet with proper configuration based on the environment.
183+
- `./src/utils/setup_wallet.ts` provides a function to set up and configure the EmbeddedWallet with proper configuration based on the environment.
190184
- `./src/utils/deploy_account.ts` provides a function to deploy Schnorr accounts to the network with sponsored fee payment, including key generation and deployment verification.
191185
- `./src/utils/sponsored_fpc.ts` provides functions to deploy and manage the SponsoredFPC (Fee Payment Contract) for handling sponsored transaction fees.
192186
- `./config/config.ts` provides environment-aware configuration loading, automatically selecting the correct JSON config file based on the `ENV` variable.
@@ -195,24 +189,13 @@ The `./src/utils/` folder contains utility functions:
195189

196190
:warning: Tests and scripts set up and run the Private Execution Environment (PXE) and store PXE data in the `./store` directory. If you restart the local network, you will need to delete the `./store` directory to avoid errors.
197191

198-
### 🔄 **Update Node.js and Noir Dependencies**
199-
200-
```bash
201-
yarn update
202-
```
203-
204-
### 🔄 **Update Contract**
205-
206-
Get the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo.
207-
208-
```bash
209-
yarn update
210-
```
192+
### 🔄 **Update Contract from Monorepo**
211193

212-
You may need to update permissions with:
194+
Get the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo:
213195

214196
```bash
215197
chmod +x .github/scripts/update_contract.sh
198+
.github/scripts/update_contract.sh <version-tag>
216199
```
217200

218201
## AI Agent Contributor Guide

config/devnet.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"name": "devnet",
33
"environment": "devnet",
44
"network": {
5-
"nodeUrl": "https://v4-devnet-1.aztec-labs.com",
5+
"nodeUrl": "https://v4-devnet-2.aztec-labs.com",
66
"l1RpcUrl": "https://ethereum-sepolia-rpc.publicnode.com",
77
"l1ChainId": 11155111
88
},
99
"settings": {
1010
"skipLocalNetwork": true,
11-
"version": "4.0.0-devnet.1-patch.0"
11+
"version": "4.0.0-devnet.2-patch.1"
1212
},
1313
"timeouts": {
1414
"deployTimeout": 1200000,

config/local-network.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"settings": {
1010
"skipLocalNetwork": false,
11-
"version": "4.0.0-devnet.1-patch.0"
11+
"version": "4.0.0-devnet.2-patch.1"
1212
},
1313
"timeouts": {
1414
"deployTimeout": 120000,

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@
3333
"update-readme-version": "node ./.github/scripts/update-readme-version.js"
3434
},
3535
"dependencies": {
36-
"@aztec/accounts": "4.0.0-devnet.1-patch.0",
37-
"@aztec/aztec.js": "4.0.0-devnet.1-patch.0",
38-
"@aztec/noir-contracts.js": "4.0.0-devnet.1-patch.0",
39-
"@aztec/protocol-contracts": "4.0.0-devnet.1-patch.0",
40-
"@aztec/pxe": "4.0.0-devnet.1-patch.0",
41-
"@aztec/stdlib": "4.0.0-devnet.1-patch.0",
42-
"@aztec/test-wallet": "4.0.0-devnet.1-patch.0",
36+
"@aztec/accounts": "4.0.0-devnet.2-patch.1",
37+
"@aztec/aztec.js": "4.0.0-devnet.2-patch.1",
38+
"@aztec/constants": "4.0.0-devnet.2-patch.1",
39+
"@aztec/entrypoints": "4.0.0-devnet.2-patch.1",
40+
"@aztec/noir-contracts.js": "4.0.0-devnet.2-patch.1",
41+
"@aztec/protocol-contracts": "4.0.0-devnet.2-patch.1",
42+
"@aztec/pxe": "4.0.0-devnet.2-patch.1",
43+
"@aztec/stdlib": "4.0.0-devnet.2-patch.1",
44+
"@aztec/wallet-sdk": "4.0.0-devnet.2-patch.1",
45+
"@aztec/wallets": "4.0.0-devnet.2-patch.1",
4346
"dotenv": "^17.2.2"
4447
},
4548
"devDependencies": {

scripts/multiple_wallet.ts

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,11 @@ import { createAztecNodeClient } from "@aztec/aztec.js/node";
77
import { TokenContract } from "@aztec/noir-contracts.js/Token"
88
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
99
import { SponsoredFPCContractArtifact } from "@aztec/noir-contracts.js/SponsoredFPC";
10-
import { getPXEConfig } from "@aztec/pxe/config";
11-
import { createStore } from "@aztec/kv-store/lmdb"
12-
import { getEnv, getAztecNodeUrl, getTimeouts } from "../config/config.js";
13-
import { TestWallet } from "@aztec/test-wallet/server";
10+
import { getAztecNodeUrl, getTimeouts } from "../config/config.js";
11+
import { EmbeddedWallet } from "@aztec/wallets/embedded";
1412

1513
const nodeUrl = getAztecNodeUrl();
16-
const node = createAztecNodeClient(nodeUrl)
17-
const l1Contracts = await node.getL1ContractAddresses();
18-
const config = getPXEConfig()
19-
const fullConfig = { ...config, l1Contracts }
20-
fullConfig.proverEnabled = getEnv() !== 'local-network';
21-
22-
const store1 = await createStore('pxe1', {
23-
dataDirectory: 'store',
24-
dataStoreMapSizeKb: 1e6,
25-
});
26-
27-
const store2 = await createStore('pxe2', {
28-
dataDirectory: 'store',
29-
dataStoreMapSizeKb: 1e6,
30-
});
31-
32-
const setupWallet1 = async () => {
33-
return await TestWallet.create(node, fullConfig, { store: store1 });
34-
};
35-
36-
const setupWallet2 = async () => {
37-
return await TestWallet.create(node, fullConfig, { store: store2 });
38-
};
14+
const node = createAztecNodeClient(nodeUrl);
3915

4016
const L2_TOKEN_CONTRACT_SALT = Fr.random();
4117

@@ -57,8 +33,8 @@ export async function getL2TokenContractInstance(deployerAddress: any, ownerAzte
5733

5834
async function main() {
5935

60-
const wallet1 = await setupWallet1();
61-
const wallet2 = await setupWallet2();
36+
const wallet1 = await EmbeddedWallet.create(node, { ephemeral: true });
37+
const wallet2 = await EmbeddedWallet.create(node, { ephemeral: true });
6238
const sponsoredFPC = await getSponsoredFPCInstance();
6339
await wallet1.registerContract(sponsoredFPC, SponsoredFPCContractArtifact);
6440
await wallet2.registerContract(sponsoredFPC, SponsoredFPCContractArtifact);
@@ -83,7 +59,7 @@ async function main() {
8359

8460
// setup account on 2nd pxe
8561

86-
await wallet2.registerSender(ownerAddress)
62+
await wallet2.registerSender(ownerAddress, '')
8763

8864
let secretKey2 = Fr.random();
8965
let signingKey2 = GrumpkinScalar.random();
@@ -94,7 +70,7 @@ async function main() {
9470
const deployMethod2 = await schnorrAccount2.getDeployMethod();
9571
await deployMethod2.send({ from: AztecAddress.ZERO, fee: { paymentMethod }, wait: { timeout: timeouts.deployTimeout } });
9672
let wallet2Address = schnorrAccount2.address;
97-
await wallet2.registerSender(ownerAddress)
73+
await wallet2.registerSender(ownerAddress, '')
9874

9975
// mint to account on 2nd pxe
10076

src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub contract PodRacing {
2626
macros::{functions::{external, initializer, only_self}, storage::storage},
2727
messages::message_delivery::MessageDelivery,
2828
note::note_getter_options::NoteGetterOptions,
29-
oracle::debug_log::debug_log_format,
29+
oracle::logging::debug_log_format,
3030
};
3131
use ::aztec::protocol::{address::AztecAddress, traits::ToField};
3232
use ::aztec::state_vars::{Map, Owned, PrivateSet, PublicMutable};

0 commit comments

Comments
 (0)