Skip to content

Commit e1f46cc

Browse files
authored
Merge pull request #37 from AztecProtocol/update-examples-to-v4.3.0
Update examples to Aztec v4.3.0
2 parents f894a51 + 89ccb7d commit e1f46cc

37 files changed

Lines changed: 1874 additions & 1859 deletions

‎.github/workflows/note-send-proof-tests.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.2.0
21+
AZTEC_VERSION: 4.3.0
2222

2323
steps:
2424
- name: Checkout repository
@@ -44,6 +44,7 @@ jobs:
4444
- name: Update path
4545
run: |
4646
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
47+
echo "$HOME/.aztec/current/internal-bin" >> $GITHUB_PATH
4748
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
4849
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
4950

‎.github/workflows/prediction-market-tests.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.2.0
21+
AZTEC_VERSION: 4.3.0
2222

2323
steps:
2424
- name: Checkout repository
@@ -46,6 +46,7 @@ jobs:
4646
- name: Update path
4747
run: |
4848
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
49+
echo "$HOME/.aztec/current/internal-bin" >> $GITHUB_PATH
4950
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
5051
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
5152

‎.github/workflows/recursive-verification-tests.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.2.0
21+
AZTEC_VERSION: 4.3.0
2222

2323
steps:
2424
- name: Checkout repository
@@ -43,6 +43,7 @@ jobs:
4343
- name: Update path
4444
run: |
4545
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
46+
echo "$HOME/.aztec/current/internal-bin" >> $GITHUB_PATH
4647
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
4748
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
4849
@@ -52,7 +53,7 @@ jobs:
5253

5354
- name: Compile Noir circuit
5455
working-directory: recursive_verification/circuit
55-
run: nargo compile
56+
run: aztec-nargo compile
5657

5758
- name: Change ownership for nargo files
5859
run: sudo chown -R $(whoami) ~/nargo || true

‎.github/workflows/test-wallet-webapp-tests.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Test Wallet Webapp Tests
1818
runs-on: ubuntu-latest
1919
env:
20-
AZTEC_VERSION: 4.2.0
20+
AZTEC_VERSION: 4.3.0
2121

2222
steps:
2323
- name: Checkout repository
@@ -43,6 +43,7 @@ jobs:
4343
- name: Update path
4444
run: |
4545
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
46+
echo "$HOME/.aztec/current/internal-bin" >> $GITHUB_PATH
4647
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
4748
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
4849

‎CLAUDE.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ aztec-examples/
5252
bash -i <(curl -s https://install.aztec.network)
5353

5454
# Set specific version (examples may require different versions)
55-
aztec-up 4.2.0 # For recursive_verification
55+
aztec-up 4.3.0 # For recursive_verification
5656
```
5757

5858
### Building Contracts
@@ -69,14 +69,14 @@ yarn ccc # Compiles contract and generates TypeScript bindings
6969

7070
### Building Vanilla Noir Circuits
7171

72-
The compatible `nargo` (version 1.0.0-beta.18) is bundled with the Aztec CLI at `~/.aztec/current/bin/nargo`. Ensure `~/.aztec/current/bin` is on your `PATH` (the Aztec installer adds this automatically).
72+
The compatible `nargo` (version 1.0.0-beta.21) is bundled with the Aztec CLI at `~/.aztec/current/bin/aztec-nargo`. As of Aztec v4.3.0, bundled binaries are exposed only under their `aztec-` prefixed names — invoke `aztec-nargo` (a drop-in for `nargo`) rather than the bare name, which is no longer on `PATH`. Ensure `~/.aztec/current/bin` is on your `PATH` (the Aztec installer adds this automatically).
7373

7474
```bash
7575
# Verify nargo is available
76-
~/.aztec/current/bin/nargo --version
76+
aztec-nargo --version
7777

7878
# Compile a vanilla Noir circuit
79-
nargo compile
79+
aztec-nargo compile
8080
```
8181

8282
### Running Local Development Environment
@@ -103,7 +103,7 @@ aztec test
103103
aztec start --txe --port=8081
104104

105105
# Terminal 2: Run tests with output
106-
nargo test --oracle-resolver http://127.0.0.1:8081 --show-output
106+
aztec-nargo test --oracle-resolver http://127.0.0.1:8081 --show-output
107107

108108
# Run integration tests (recursive_verification)
109109
cd recursive_verification
@@ -151,10 +151,10 @@ cd recursive_verification
151151
yarn install
152152

153153
# 2. Verify nargo is available (bundled with Aztec CLI)
154-
~/.aztec/current/bin/nargo --version
154+
aztec-nargo --version
155155

156156
# 3. Compile the Noir circuit
157-
cd circuit && nargo compile && cd ..
157+
cd circuit && aztec-nargo compile && cd ..
158158

159159
# 4. Compile the Aztec contract
160160
yarn ccc # Runs: aztec compile && aztec codegen
@@ -172,7 +172,7 @@ yarn recursion # Deploys ValueNotEqual contract and verifies proof
172172
yarn test
173173

174174
# Optional: Run circuit tests
175-
cd circuit && nargo test
175+
cd circuit && aztec-nargo test
176176
```
177177

178178
### Starter Token Example
@@ -260,7 +260,7 @@ easy_private_state = { git = "https://github.com/AztecProtocol/aztec-packages/",
260260

261261
**Version Compatibility**: All examples use the same Aztec version:
262262

263-
- All examples: v4.2.0
263+
- All examples: v4.3.0
264264

265265
### JavaScript/TypeScript Dependencies
266266

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can find additional examples in the Aztec monorepo [docs examples folder](ht
1616

1717
### 1. [Recursive Verification](./recursive_verification)
1818

19-
**Aztec Version**: 4.2.0
19+
**Aztec Version**: 4.3.0
2020

2121
Demonstrates how to verify Noir circuit proofs within Aztec smart contracts using the UltraHonk proving system. This example showcases:
2222

@@ -43,7 +43,7 @@ Demonstrates how to verify Noir circuit proofs within Aztec smart contracts usin
4343
bash -i <(curl -s https://install.aztec.network)
4444

4545
# Set specific Aztec version (if needed)
46-
aztec-up 4.2.0
46+
aztec-up 4.3.0
4747
```
4848

4949
## Development Workflow

‎account-contract/Nargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ compiler_version = ">=1.0.0"
55
type = "contract"
66

77
[dependencies]
8-
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.2.0", directory = "aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v4.3.0", directory = "aztec" }

‎account-contract/README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,25 @@ When implementing custom account contracts in Aztec, be aware of these critical
172172

173173
## Aztec Version Compatibility
174174

175-
This example is compatible with **Aztec v4.2.0**.
175+
This example is compatible with **Aztec v4.3.0**.
176176

177177
To set this version:
178178

179179
```bash
180-
aztec-up 4.2.0
180+
aztec-up 4.3.0
181181
```
182182

183183
## Dependencies
184184

185185
### Noir Dependencies
186186

187-
- **aztec**: v4.2.0
187+
- **aztec**: v4.3.0
188188

189189
### TypeScript Dependencies
190190

191-
- **@aztec/aztec.js**: 4.2.0
192-
- **@aztec/accounts**: 4.2.0
193-
- **@aztec/stdlib**: 4.2.0
191+
- **@aztec/aztec.js**: 4.3.0
192+
- **@aztec/accounts**: 4.3.0
193+
- **@aztec/stdlib**: 4.3.0
194194
- **@aztec/entrypoints**: Included in aztec.js
195195

196196
## Project Structure

‎account-contract/package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"typescript": "^5.0.0"
1313
},
1414
"dependencies": {
15-
"@aztec/accounts": "4.2.0",
16-
"@aztec/aztec.js": "4.2.0",
17-
"@aztec/foundation": "4.2.0",
18-
"@aztec/noir-contracts.js": "4.2.0",
19-
"@aztec/stdlib": "4.2.0",
20-
"@aztec/wallets": "4.2.0",
15+
"@aztec/accounts": "4.3.0",
16+
"@aztec/aztec.js": "4.3.0",
17+
"@aztec/foundation": "4.3.0",
18+
"@aztec/noir-contracts.js": "4.3.0",
19+
"@aztec/stdlib": "4.3.0",
20+
"@aztec/wallets": "4.3.0",
2121
"tsx": "^4.20.6"
2222
}
2323
}

‎account-contract/src/main.nr‎

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ pub contract PasswordAccount {
1212
context::PrivateContext,
1313
hash::compute_siloed_nullifier,
1414
macros::{functions::{external, initializer, only_self, noinitcheck, view}, storage::storage},
15-
oracle::{
16-
get_nullifier_membership_witness::get_low_nullifier_membership_witness,
17-
notes::{get_sender_for_tags, set_sender_for_tags},
18-
},
15+
oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness,
1916
protocol::{address::AztecAddress, hash::poseidon2_hash},
2017
state_vars::PublicImmutable,
2118
};
@@ -33,23 +30,6 @@ pub contract PasswordAccount {
3330
fn constructor(password: Field) {
3431
let hashed_password = poseidon2_hash([password]);
3532
self.enqueue_self.set_hashed_password(hashed_password);
36-
37-
// Safety: The sender for tags is only used to compute unconstrained shared secrets for emitting logs.
38-
// Since this value is only used for unconstrained tagging and not for any constrained logic,
39-
// it is safe to load from an unconstrained context.
40-
// TODO(#15752): Improve the sender_for_tags handling here when the original sender is undefined.
41-
let original_sender = unsafe { get_sender_for_tags().unwrap_or(self.address) };
42-
43-
// We set the sender for tags to this contract because we don't want to force the user corresponding to this
44-
// account to add the account deployer as a sender to their PXE. By setting it to this contract, user's PXE
45-
// will manage to find the note even if the account deployer is not registered as a sender (i.e
46-
// `pxe.registerSender(accountDeployer)` was not called)
47-
48-
// Safety: Comment from above applies here as well.
49-
unsafe { set_sender_for_tags(self.address) };
50-
51-
// Safety: Comment from above applies here as well.
52-
unsafe { set_sender_for_tags(original_sender) };
5333
}
5434

5535
#[external("public")]
@@ -63,11 +43,6 @@ pub contract PasswordAccount {
6343
#[external("private")]
6444
#[noinitcheck]
6545
fn entrypoint(app_payload: AppPayload, fee_payment_method: u8, cancellable: bool, password: Field) {
66-
// Safety: The sender for tags is only used to compute unconstrained shared secrets for emitting logs.
67-
// Since this value is only used for unconstrained tagging and not for any constrained logic,
68-
// it is safe to set from a constrained context.
69-
unsafe { set_sender_for_tags(self.address) };
70-
7146
let actions = AccountActions::init(self.context, is_valid_impl);
7247
actions.entrypoint(app_payload, fee_payment_method, cancellable, password);
7348
}
@@ -110,9 +85,9 @@ pub contract PasswordAccount {
11085
// it is not as part of execution of the contract, so we are good.
11186
let nullifier = compute_authwit_nullifier(self.address, inner_hash);
11287
let siloed_nullifier = compute_siloed_nullifier(consumer, nullifier);
113-
let lower_wit =
88+
let (leaf_preimage, _witness) =
11489
get_low_nullifier_membership_witness(self.context.block_header(), siloed_nullifier);
115-
let is_spent = lower_wit.leaf_preimage.nullifier == siloed_nullifier;
90+
let is_spent = leaf_preimage.nullifier == siloed_nullifier;
11691

11792
!is_spent & valid_in_private
11893
}

0 commit comments

Comments
 (0)