Skip to content

Commit 8c58b6b

Browse files
authored
Merge pull request #3 from AztecProtocol/gj/nigthly_update
devnet 2 update
2 parents f4d1407 + 5817741 commit 8c58b6b

File tree

18 files changed

+2141
-1179
lines changed

18 files changed

+2141
-1179
lines changed

.githooks/pre-commit

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
# Pre-commit hook to strip local aztec-packages resolutions from package.json
4+
# and clean up vite.config.ts fs.allow paths
5+
# This prevents accidentally committing local development paths
6+
7+
REPO_ROOT=$(git rev-parse --show-toplevel)
8+
9+
MODIFIED=0
10+
11+
# Check package.json
12+
PACKAGE_FILE="package.json"
13+
FULL_PATH="$REPO_ROOT/$PACKAGE_FILE"
14+
15+
if [ -f "$FULL_PATH" ] && git diff --cached --name-only | grep -q "^$PACKAGE_FILE$"; then
16+
# Check if resolutions field exists with link: entries
17+
if grep -q '"resolutions"' "$FULL_PATH" && grep -q '"link:' "$FULL_PATH"; then
18+
echo "Stripping local resolutions from $PACKAGE_FILE..."
19+
20+
# Use node to remove the resolutions field
21+
node -e "
22+
const fs = require('fs');
23+
const pkg = JSON.parse(fs.readFileSync('$FULL_PATH', 'utf-8'));
24+
if (pkg.resolutions) {
25+
delete pkg.resolutions;
26+
fs.writeFileSync('$FULL_PATH', JSON.stringify(pkg, null, 2) + '\n');
27+
}
28+
"
29+
30+
# Re-stage the file
31+
git add "$FULL_PATH"
32+
MODIFIED=1
33+
fi
34+
fi
35+
36+
# Check vite.config.ts for absolute aztec-packages paths
37+
VITE_CONFIG="vite.config.ts"
38+
VITE_PATH="$REPO_ROOT/$VITE_CONFIG"
39+
40+
if [ -f "$VITE_PATH" ] && git diff --cached --name-only | grep -q "^$VITE_CONFIG$"; then
41+
# Check if fs.allow contains absolute paths to aztec-packages
42+
if grep -q "allow:" "$VITE_PATH" && grep -E "'/.*aztec-packages/" "$VITE_PATH" > /dev/null 2>&1; then
43+
echo "Cleaning up vite.config.ts fs.allow paths..."
44+
45+
# Use node to clean up the vite config
46+
node -e "
47+
const fs = require('fs');
48+
let content = fs.readFileSync('$VITE_PATH', 'utf-8');
49+
50+
// Replace fs.allow block with minimal version
51+
const fsBlockRegex = /fs:\s*\{[\s\S]*?allow:\s*\[[\s\S]*?\],[\s\S]*?\},/;
52+
const minimalFsAllowBlock = \`fs: {
53+
allow: [searchForWorkspaceRoot(process.cwd())],
54+
},\`;
55+
56+
if (fsBlockRegex.test(content)) {
57+
content = content.replace(fsBlockRegex, minimalFsAllowBlock);
58+
fs.writeFileSync('$VITE_PATH', content);
59+
}
60+
"
61+
62+
# Re-stage the file
63+
git add "$VITE_PATH"
64+
MODIFIED=1
65+
fi
66+
fi
67+
68+
if [ $MODIFIED -eq 1 ]; then
69+
echo ""
70+
echo "Local development paths have been stripped."
71+
echo "The commit will proceed with the cleaned files."
72+
echo ""
73+
fi
74+
75+
exit 0

.github/workflows/deploy.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
env:
1313
PASSWORD: ${{ secrets.PASSWORD }}
1414

15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
1519
jobs:
1620
build-and-deploy:
1721
runs-on: ubuntu-latest
@@ -42,8 +46,6 @@ jobs:
4246
- name: Set Aztec version
4347
run: |
4448
aztec-up ${{ vars.VERSION }}
45-
docker pull aztecprotocol/aztec:${{ vars.VERSION }}
46-
docker tag aztecprotocol/aztec:${{ vars.VERSION }} aztecprotocol/aztec:latest
4749
4850
- name: Compile contracts
4951
run: yarn compile:contracts
@@ -55,9 +57,10 @@ jobs:
5557
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
5658

5759
- name: Deploy to Vercel
58-
run: |
59-
vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz --yes
6060
id: deploy
61+
run: |
62+
DEPLOY_URL=$(vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz --yes)
63+
echo "url=$DEPLOY_URL" >> $GITHUB_OUTPUT
6164
6265
- name: Comment deployment URL on PR
6366
if: github.event_name == 'pull_request'
@@ -68,5 +71,5 @@ jobs:
6871
issue_number: context.issue.number,
6972
owner: context.repo.owner,
7073
repo: context.repo.repo,
71-
body: '🚀 Deployed to Vercel!\n\nContracts deployed to devnet and website published.'
74+
body: '🚀 Deployed to Vercel!\n\n**Preview URL:** ${{ steps.deploy.outputs.url }}'
7275
})

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ contracts/target
3737
src/config/networks/local.json
3838
contracts/codegenCache.json
3939
.vercel
40+
.local-aztec-path

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ curl -s https://install.aztec.network | bash
3333

3434
### 3. Set Aztec Version
3535

36-
The project uses Aztec version `v3.0.0-nightly.20251120`. Set it using:
36+
The project uses Aztec version `v3.0.0-devnet.6-patch.1`. Set it using:
3737

3838
```bash
39-
aztec-up 3.0.0-nightly.20251120
40-
docker tag aztecprotocol/aztec:3.0.0-nightly.20251120 aztecprotocol/aztec:latest # Temporary workaround for aztec-nargo issues
39+
aztec-up 3.0.0-devnet.6-patch.1
4140
```
4241

4342
## Development Setup
@@ -49,7 +48,7 @@ docker tag aztecprotocol/aztec:3.0.0-nightly.20251120 aztecprotocol/aztec:latest
4948
In a separate terminal, start the local Aztec sandbox:
5049

5150
```bash
52-
aztec start --sandbox
51+
aztec start --local-network
5352
```
5453

5554
This will start a local Aztec node on `http://localhost:8080`.

contracts/proof_of_password/Nargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type = "contract"
44
authors = [""]
55

66
[dependencies]
7-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/aztec-nr/aztec" }
8-
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
7+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.6-patch.1", directory = "noir-projects/aztec-nr/aztec" }
8+
token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.6-patch.1", directory = "noir-projects/noir-contracts/contracts/app/token_contract" }
99
poseidon = { tag = "v0.1.1", git = "https://github.com/noir-lang/poseidon" }
10-
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-nightly.20251120", directory = "noir-projects/aztec-nr/compressed-string" }
10+
compressed_string = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.6-patch.1", directory = "noir-projects/aztec-nr/compressed-string" }

contracts/proof_of_password/src/main.nr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ pub contract ProofOfPassword {
4848
);
4949

5050
// Safety: PXE will enforce a sender for the tags of the notes created
51-
// in the Token.mint function, but this one intented to be called by anyone
52-
// that knows the passord, not necessarily the recipient. Chances are this fn
51+
// in the Token.mint function, but this particular function is intended to be called by anyone
52+
// that knows the password, not necessarily the recipient. In particular, chances are this fn
5353
// will be invoked by the MultiCallEntrypoint protocol contract,
5454
// which does not set a sender for tags.
5555
// We intend the "to" of this function to claim the notes, so we're just calling
56-
// the oracle for its sideeffects, making it safe to call
56+
// the oracle for its side effects, therefore making it safe to call
5757
unsafe {
5858
set_sender_for_tags(to);
5959
}
6060

6161
let address = self.storage.grego_coin_address.read();
6262
self.call(Token::at(address).mint_to_private(to, 1000));
6363

64-
// Derive nullifier from sender and password. This is still a privacy leak, since
64+
// Derive nullifier from sender and password. This is a privacy leak, since
6565
// knowing the password and an address is sufficient to know if someone has used this
6666
// contract or not. But at least, they need the password
6767
let nullifier = poseidon2_hash([to.to_field(), field_compressed_str.serialize()[0]]);

contracts/proof_of_password/src/test/mod.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ unconstrained fn fails_on_incorrect_password() {
6666
);
6767
}
6868

69-
#[test(should_fail_with = "Contract execution has reverted: Error encountered when inserting revertible nullifiers from private")]
69+
#[test(should_fail_with = "Contract execution has reverted: Attempted to emit duplicate siloed nullifier")]
7070
unconstrained fn fails_on_double_dip() {
7171
let (env, pop_contract_address, _, recipient) = setup();
7272

package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@
99
"serve": "vite",
1010
"build": "tsc -b && vite build",
1111
"lint": "eslint .",
12-
"copy:dependencies": "cd contracts && aztec check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-nightly.20251120/noir-projects/noir-contracts && aztec compile --package token_contract && mkdir -p $WORKDIR/target && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-nightly.20251120/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/target/token_contract-Token.json",
12+
"copy:dependencies": "cd contracts && aztec check && WORKDIR=$(pwd) && cd $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-devnet.6-patch.1/noir-projects/noir-contracts && aztec compile --package token_contract && mkdir -p $WORKDIR/target && cp $HOME/nargo/github.com/AztecProtocol/aztec-packages/v3.0.0-devnet.6-patch.1/noir-projects/noir-contracts/target/token_contract-Token.json $WORKDIR/target/token_contract-Token.json",
1313
"compile:contracts": "cd contracts && aztec compile --package proof_of_password && aztec codegen ./target/proof_of_password-ProofOfPassword.json",
1414
"test": "cd contracts && aztec test",
1515
"preview": "vite preview",
1616
"deploy:local": "node --experimental-transform-types scripts/deploy.ts --network local",
1717
"deploy:devnet": "node --experimental-transform-types scripts/deploy.ts --network devnet",
1818
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
19-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src"
19+
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
20+
"local-aztec:enable": "node scripts/toggle-local-aztec.js enable && corepack yarn install",
21+
"local-aztec:disable": "node scripts/toggle-local-aztec.js disable && corepack yarn install",
22+
"local-aztec:status": "node scripts/toggle-local-aztec.js status"
2023
},
2124
"dependencies": {
22-
"@aztec/accounts": "v3.0.0-nightly.20251120",
23-
"@aztec/aztec.js": "v3.0.0-nightly.20251120",
24-
"@aztec/constants": "v3.0.0-nightly.20251120",
25-
"@aztec/entrypoints": "v3.0.0-nightly.20251120",
26-
"@aztec/foundation": "v3.0.0-nightly.20251120",
27-
"@aztec/noir-contracts.js": "v3.0.0-nightly.20251120",
28-
"@aztec/pxe": "v3.0.0-nightly.20251120",
29-
"@aztec/stdlib": "v3.0.0-nightly.20251120",
25+
"@aztec/accounts": "v3.0.0-devnet.6-patch.1",
26+
"@aztec/aztec.js": "v3.0.0-devnet.6-patch.1",
27+
"@aztec/constants": "v3.0.0-devnet.6-patch.1",
28+
"@aztec/entrypoints": "v3.0.0-devnet.6-patch.1",
29+
"@aztec/foundation": "v3.0.0-devnet.6-patch.1",
30+
"@aztec/noir-contracts.js": "v3.0.0-devnet.6-patch.1",
31+
"@aztec/pxe": "v3.0.0-devnet.6-patch.1",
32+
"@aztec/stdlib": "v3.0.0-devnet.6-patch.1",
33+
"@aztec/wallet-sdk": "v3.0.0-devnet.6-patch.1",
3034
"@emotion/react": "^11.14.0",
3135
"@emotion/styled": "^11.14.0",
3236
"@mui/icons-material": "^6.3.1",
@@ -39,7 +43,7 @@
3943
"zod": "^3.23.8"
4044
},
4145
"devDependencies": {
42-
"@aztec/test-wallet": "v3.0.0-nightly.20251120",
46+
"@aztec/test-wallet": "v3.0.0-devnet.6-patch.1",
4347
"@eslint/js": "^9.18.0",
4448
"@playwright/test": "1.49.0",
4549
"@types/buffer-json": "^2",

scripts/deploy.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
1111
import { AztecAddress } from '@aztec/stdlib/aztec-address';
1212
import { createAztecNodeClient, type AztecNode } from '@aztec/aztec.js/node';
1313
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
14-
import { Fr } from '@aztec/foundation/fields';
14+
import { Fr } from '@aztec/foundation/curves/bn254';
1515
import type { DeployAccountOptions } from '@aztec/aztec.js/wallet';
1616
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
1717

1818
import { ProofOfPasswordContract } from '../contracts/target/ProofOfPassword.ts';
19+
import { createLogger } from '@aztec/foundation/log';
1920

2021
// Parse network from CLI args (--network <name>)
2122
function getNetworkFromArgs(): string {
@@ -38,7 +39,7 @@ const NETWORK = getNetworkFromArgs();
3839
// Network-specific node URLs (hardcoded, not configurable)
3940
const NETWORK_URLS: Record<string, string> = {
4041
local: 'http://localhost:8080',
41-
devnet: 'https://devnet.aztec-labs.com',
42+
devnet: 'https://next.devnet.aztec-labs.com',
4243
};
4344

4445
const AZTEC_NODE_URL = NETWORK_URLS[NETWORK];
@@ -61,7 +62,11 @@ async function setupWallet(aztecNode: AztecNode) {
6162
config.dataDirectory = PXE_STORE_DIR;
6263
config.proverEnabled = PROVER_ENABLED;
6364

64-
return await TestWallet.create(aztecNode, config);
65+
return await TestWallet.create(aztecNode, config, {
66+
proverOrOptions: {
67+
logger: createLogger('bb:native'),
68+
},
69+
});
6570
}
6671

6772
async function getSponsoredPFCContract() {

0 commit comments

Comments
 (0)