Skip to content

Commit 154758c

Browse files
authored
Merge pull request #204 from AztecProtocol/jc/devnet-update
update to use 3.0.0-devnet.2
2 parents d773ae3 + cb2a128 commit 154758c

25 files changed

+2133
-839
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ VOTING_CONTRACT_ADDRESS="0x2320c9938b3e87feb4e475413456d028572f3367e18d61e7d198d
22
SECRET="0x29aa7f43021f964fe46527ff4df0e9211de94274f54eff12ec81070ee3e16300"
33
SALT="0x23c46f2dd4450fb881f0b0e70c3974f84dfa9d199493001b3fe8eb136dc612cd"
44
AZTEC_ENV=sandbox
5+
VOTING_CONTRACT_ADDRESS="0x0407e827124a8ce742a4e63250f4f508a8b5043746dcedae8312bd32ea24154d"
6+
CONTRACT_SALT="0x2d7e8a973f9039f0e2c7771376e131f8ca1c18bd337ee8fa5c6d89db0198645e"
7+
CONTRACT_DEPLOYER="0x2e34557bae428d3c489f67e9aa326b41a09faf03f619969b883e413cbec7bc1c"
8+
CONTRACT_PK_NULLIFIER="0x01498945581e0eb9f8427ad6021184c700ef091d570892c437d12c7d90364bbd170ae506787c5c43d6ca9255d571c10fa9ffa9d141666e290c347c5c9ab7e344"
9+
CONTRACT_PK_INCOMING="0x00c044b05b6ca83b9c2dbae79cc1135155956a64e136819136e9947fe5e5866c1c1f0ca244c7cd46b682552bff8ae77dea40b966a71de076ec3b7678f2bdb151"
10+
CONTRACT_PK_OUTGOING="0x1b00316144359e9a3ec8e49c1cdb7eeb0cedd190dfd9dc90eea5115aa779e287080ffc74d7a8b0bccb88ac11f45874172f3847eb8b92654aaa58a3d2b8dc7833"
11+
CONTRACT_PK_TAGGING="0x019c111f36ad3fc1d9b7a7a14344314d2864b94f030594cd67f753ef774a1efb2039907fe37f08d10739255141bb066c506a12f7d1e8dfec21abc58494705b6f"
12+
CONTRACT_CONSTRUCTOR_ARGS='["0x2e34557bae428d3c489f67e9aa326b41a09faf03f619969b883e413cbec7bc1c"]'
Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Testnet Tests
1+
name: Devnet Tests
22

33
on:
44
schedule:
5-
- cron: '0 2 * * *'
5+
- cron: "0 2 * * *"
66
workflow_dispatch:
77
inputs:
88
skip_deployment:
@@ -12,11 +12,12 @@ on:
1212
default: false
1313

1414
jobs:
15-
testnet-tests:
16-
name: Testnet Tests
15+
devnet-tests:
16+
name: Devnet Tests
1717
runs-on: ubuntu-latest
1818
env:
19-
AZTEC_ENV: testnet
19+
AZTEC_ENV: devnet
20+
VERSION: 3.0.0-devnet.2
2021

2122
steps:
2223
- name: Checkout repository
@@ -36,32 +37,36 @@ jobs:
3637
- name: Update path
3738
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
3839

40+
- name: Set Aztec version
41+
run: |
42+
aztec-up ${{ env.VERSION }}
43+
3944
- name: Install project dependencies
4045
run: yarn
4146

4247
- name: Compile contracts
43-
run: script -e -c "${AZTEC_NARGO:-aztec-nargo} compile"
48+
run: script -e -c "${AZTEC_NARGO:-aztec-nargo} compile && aztec-postprocess-contract"
4449

4550
- name: Generate contract artifacts
46-
run: script -e -c "aztec codegen target --outdir src/artifacts && aztec-postprocess-contract"
51+
run: script -e -c "aztec codegen target --outdir src/artifacts"
4752

48-
- name: Setup testnet environment
53+
- name: Setup devnet environment
4954
run: |
50-
echo "📋 Using testnet configuration from config/testnet.json"
51-
cat config/testnet.json
55+
echo "📋 Using devnet configuration from config/devnet.json"
56+
cat config/devnet.json
5257
53-
- name: Test testnet connectivity
58+
- name: Test devnet connectivity
5459
run: |
55-
echo "Testing testnet connectivity..."
56-
curl -s https://aztec-testnet-fullnode.zkv.xyz/status || echo "Warning: Could not connect to testnet"
60+
echo "Testing devnet connectivity..."
61+
curl -s https://devnet.aztec-labs.com/status || echo "Warning: Could not connect to devnet"
5762
58-
- name: Deploy account to testnet
63+
- name: Deploy account to devnet
5964
if: ${{ !inputs.skip_deployment }}
6065
run: |
6166
TEMP_OUTPUT=$(mktemp)
6267
63-
if script -e -c "yarn deploy-account::testnet" > "$TEMP_OUTPUT" 2>&1; then
64-
echo "✅ Deploy account to testnet completed successfully"
68+
if script -e -c "yarn deploy-account::devnet" > "$TEMP_OUTPUT" 2>&1; then
69+
echo "✅ Deploy account to devnet completed successfully"
6570
else
6671
echo "❌ Deploy account script failed"
6772
cat "$TEMP_OUTPUT"
@@ -87,13 +92,13 @@ jobs:
8792
exit 1
8893
fi
8994
90-
- name: Deploy contract to testnet
95+
- name: Deploy contract to devnet
9196
if: ${{ !inputs.skip_deployment }}
9297
run: |
9398
TEMP_OUTPUT=$(mktemp)
9499
95-
if script -e -c "yarn deploy::testnet" > "$TEMP_OUTPUT" 2>&1; then
96-
echo "✅ Deploy contract to testnet completed successfully"
100+
if script -e -c "yarn deploy::devnet" > "$TEMP_OUTPUT" 2>&1; then
101+
echo "✅ Deploy contract to devnet completed successfully"
97102
else
98103
echo "❌ Deploy contract script failed"
99104
cat "$TEMP_OUTPUT"
@@ -114,24 +119,24 @@ jobs:
114119
echo "⚠️ Warning: Could not extract contract address"
115120
fi
116121
117-
- name: Run testnet scripts
122+
- name: Run devnet scripts
118123
run: |
119-
echo "Running testnet scripts..."
120-
script -e -c "yarn get-block::testnet"
121-
124+
echo "Running devnet scripts..."
125+
script -e -c "yarn get-block::devnet"
126+
122127
- name: Run interaction test with existing contract
123128
if: ${{ inputs.skip_deployment }}
124129
run: |
125-
echo "Running interaction with existing contract on testnet..."
126-
script -e -c "yarn interaction-existing-contract::testnet"
130+
echo "Running interaction with existing contract on devnet..."
131+
script -e -c "yarn interaction-existing-contract::devnet"
127132
128-
- name: Run JavaScript tests on testnet
133+
- name: Run JavaScript tests on devnet
129134
run: |
130-
echo "Running JavaScript tests against testnet..."
135+
echo "Running JavaScript tests against devnet..."
131136
script -e -c "rm -rf store/pxe"
132-
script -e -c "ENV=testnet NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json"
137+
script -e -c "ENV=devnet NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json"
133138
134-
- name: Profile deployment on testnet
139+
- name: Profile deployment on devnet
135140
if: ${{ !inputs.skip_deployment }}
136141
run: |
137-
script -e -c "yarn profile::testnet"
142+
script -e -c "yarn profile::devnet"

.github/workflows/sandbox.yaml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
env:
1919
AZTEC_ENV: sandbox
20+
VERSION: 3.0.0-devnet.2
2021

2122
steps:
2223
- name: Checkout repository
@@ -41,7 +42,7 @@ jobs:
4142

4243
- name: Set Aztec version and start sandbox
4344
run: |
44-
VERSION=2.0.2 aztec-up
45+
VERSION=${{ env.VERSION }} aztec-up
4546
aztec start --sandbox &
4647
4748
- name: Wait for sandbox to be ready
@@ -60,10 +61,10 @@ jobs:
6061
run: yarn
6162

6263
- name: Compile contracts
63-
run: script -e -c "${AZTEC_NARGO:-aztec-nargo} compile"
64+
run: script -e -c "${AZTEC_NARGO:-aztec-nargo} compile && aztec-postprocess-contract"
6465

6566
- name: Generate contract artifacts
66-
run: script -e -c "aztec codegen target --outdir src/artifacts && aztec-postprocess-contract"
67+
run: script -e -c "aztec codegen target --outdir src/artifacts"
6768

6869
- name: Change ownership for nargo files
6970
run: sudo chown -R $(whoami) ~/nargo && sudo chown -R $(whoami) ~/nargo/github.com
@@ -92,9 +93,9 @@ jobs:
9293
9394
cat "$TEMP_OUTPUT"
9495
95-
SECRET_KEY=$(grep -o "🔑 Secret key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🔑 Secret key generated: //' || echo "")
96-
SIGNING_KEY=$(grep -o "🖊️ Signing key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🖊️ Signing key generated: //' || echo "")
97-
SALT_VALUE=$(grep -o "🧂 Salt generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🧂 Salt generated: //' || echo "")
96+
SECRET_KEY=$(grep -o "Secret key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Secret key generated: //' || echo "")
97+
SIGNING_KEY=$(grep -o "Signing key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Signing key generated: //' || echo "")
98+
SALT_VALUE=$(grep -o "Salt generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Salt generated: //' || echo "")
9899
99100
rm "$TEMP_OUTPUT"
100101
@@ -122,21 +123,66 @@ jobs:
122123
123124
cat "$TEMP_OUTPUT"
124125
125-
VOTING_CONTRACT_ADDRESS=""
126-
if [ -z "$VOTING_CONTRACT_ADDRESS" ]; then
127-
VOTING_CONTRACT_ADDRESS=$(grep -o "Contract address: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Contract address: //' || echo "")
128-
fi
126+
# Extract contract address
127+
VOTING_CONTRACT_ADDRESS=$(grep -o "Contract address: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Contract address: //' || echo "")
128+
129+
# Extract salt
130+
CONTRACT_SALT=$(grep -o "Salt: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Salt: //' || echo "")
131+
132+
# Extract deployer
133+
CONTRACT_DEPLOYER=$(grep -o "Deployer: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Deployer: //' || echo "")
134+
135+
# Extract public keys
136+
PK_NULLIFIER=$(grep -o "Master Nullifier: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Nullifier: //' || echo "")
137+
PK_INCOMING=$(grep -o "Master Incoming Viewing: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Incoming Viewing: //' || echo "")
138+
PK_OUTGOING=$(grep -o "Master Outgoing Viewing: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Outgoing Viewing: //' || echo "")
139+
PK_TAGGING=$(grep -o "Master Tagging: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Master Tagging: //' || echo "")
140+
141+
# Extract constructor args (JSON array), strip ANSI codes, and trim whitespace
142+
CONSTRUCTOR_ARGS=$(grep "Constructor args:" "$TEMP_OUTPUT" | sed 's/.*Constructor args: //' | sed 's/\x1b\[[0-9;]*m//g' | tr -d '\n\r' | sed 's/[[:space:]]*$//' || echo "")
129143
130144
rm "$TEMP_OUTPUT"
131145
146+
# Save all data to .env
132147
if [ -n "$VOTING_CONTRACT_ADDRESS" ]; then
133148
echo "VOTING_CONTRACT_ADDRESS=\"$VOTING_CONTRACT_ADDRESS\"" >> .env
134149
echo "📋 Saved contract address to .env file"
135150
fi
136151
152+
if [ -n "$CONTRACT_SALT" ]; then
153+
echo "CONTRACT_SALT=\"$CONTRACT_SALT\"" >> .env
154+
echo "📋 Saved contract salt to .env file"
155+
fi
156+
157+
if [ -n "$CONTRACT_DEPLOYER" ]; then
158+
echo "CONTRACT_DEPLOYER=\"$CONTRACT_DEPLOYER\"" >> .env
159+
echo "📋 Saved contract deployer to .env file"
160+
fi
161+
162+
if [ -n "$PK_NULLIFIER" ]; then
163+
echo "CONTRACT_PK_NULLIFIER=\"$PK_NULLIFIER\"" >> .env
164+
fi
165+
166+
if [ -n "$PK_INCOMING" ]; then
167+
echo "CONTRACT_PK_INCOMING=\"$PK_INCOMING\"" >> .env
168+
fi
169+
170+
if [ -n "$PK_OUTGOING" ]; then
171+
echo "CONTRACT_PK_OUTGOING=\"$PK_OUTGOING\"" >> .env
172+
fi
173+
174+
if [ -n "$PK_TAGGING" ]; then
175+
echo "CONTRACT_PK_TAGGING=\"$PK_TAGGING\"" >> .env
176+
fi
177+
178+
if [ -n "$CONSTRUCTOR_ARGS" ]; then
179+
echo "CONTRACT_CONSTRUCTOR_ARGS=\"$CONSTRUCTOR_ARGS\"" >> .env
180+
echo "📋 Saved constructor args to .env file"
181+
fi
182+
137183
- name: Run sandbox scripts
138184
run: |
139185
script -e -c "yarn fees"
140-
script -e -c "yarn multiple-pxe"
186+
script -e -c "yarn multiple-wallet"
141187
script -e -c "yarn profile"
142-
script -e -c "yarn interaction-existing-contract"
188+
script -e -c "yarn interaction-existing-contract"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ log/
66
.DS_Store
77
codegenCache.json
88
store/
9-
.tsbuildinfo
9+
.tsbuildinfo
10+
.env

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-packages/", tag = "v2.0.2", directory = "noir-projects/aztec-nr/aztec" }
8+
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.0-devnet.2", directory = "noir-projects/aztec-nr/aztec" }

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ This repo is meant to be a starting point for learning to write Aztec contracts
1212

1313
You can find the **Easy Private Voting contract** in `./src/main.nr`. A simple integration test is in `./src/test/e2e/index.test.ts`.
1414

15-
## Testnet
15+
## Devnet
1616

17-
This repo connects to a locally running Aztec Sandbox by default, but can be configured to connect to the testnet by specifying `AZTEC_ENV=testnet` in a `.env` file or by prefixing a command e.g. `AZTEC_ENV=testnet yarn deploy`.
17+
This repo connects to a locally running Aztec Sandbox by default, but can be configured to connect to the devnet by specifying `AZTEC_ENV=devnet` in a `.env` file or by prefixing a command e.g. `AZTEC_ENV=devnet yarn deploy`.
1818

1919
<div align="center">
2020

@@ -45,15 +45,15 @@ bash -i <(curl -s https://install.aztec.network)
4545
Install the correct version of the toolkit with:
4646

4747
```bash
48-
aztec-up 2.0.2
48+
aztec-up 3.0.0-devnet.2
4949
```
5050

5151
### Environment Configuration
5252

5353
This project uses JSON configuration files to manage environment-specific settings:
5454

5555
- `config/sandbox.json` - Configuration for local sandbox development
56-
- `config/testnet.json` - Configuration for testnet deployment
56+
- `config/devnet.json` - Configuration for devnet deployment
5757

5858
The system automatically loads the appropriate configuration file based on the `ENV` environment variable. If `ENV` is not set, it defaults to `sandbox`.
5959

@@ -74,18 +74,18 @@ yarn deploy # Deploy to sandbox
7474
yarn test # Run tests on sandbox
7575
```
7676

77-
### Running on Testnet
77+
### Running on Devnet
7878

79-
All scripts support a `::testnet` suffix to automatically use testnet configuration:
79+
All scripts support a `::devnet` suffix to automatically use devnet configuration:
8080

8181
```bash
82-
yarn deploy::testnet # Deploy to testnet
83-
yarn test::testnet # Run tests on testnet
84-
yarn deploy-account::testnet # Deploy account to testnet
85-
yarn interaction-existing-contract::testnet # Interact with testnet contracts
82+
yarn deploy::devnet # Deploy to devnet
83+
yarn test::devnet # Run tests on devnet
84+
yarn deploy-account::devnet # Deploy account to devnet
85+
yarn interaction-existing-contract::devnet # Interact with devnet contracts
8686
```
8787

88-
The `::testnet` suffix automatically sets `ENV=testnet`, loading configuration from `config/testnet.json`.
88+
The `::devnet` suffix automatically sets `ENV=devnet`, loading configuration from `config/devnet.json`.
8989

9090
---
9191

config/config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface TimeoutConfig {
1919

2020
export interface EnvironmentConfig {
2121
name: string;
22-
environment: 'local' | 'testnet' | 'mainnet';
22+
environment: 'local' | 'testnet' | 'devnet' | 'mainnet';
2323
network: NetworkConfig;
2424
settings: {
2525
skipSandbox: boolean;
@@ -65,8 +65,8 @@ export class ConfigManager {
6565
return this.config.network;
6666
}
6767

68-
public isTestnet(): boolean {
69-
return this.config.environment === 'testnet';
68+
public isDevnet(): boolean {
69+
return this.config.environment === 'devnet';
7070
}
7171

7272
public isSandbox(): boolean {
@@ -89,16 +89,16 @@ export class ConfigManager {
8989
if (this.config.timeouts) {
9090
return this.config.timeouts;
9191
}
92-
92+
9393
// Otherwise, use defaults based on environment
94-
if (this.isTestnet()) {
94+
if (this.isDevnet()) {
9595
return {
9696
deployTimeout: 1200000, // 20 minutes
9797
txTimeout: 180000, // 3 minutes
9898
waitTimeout: 60000 // 1 minute
9999
};
100100
}
101-
101+
102102
return {
103103
deployTimeout: 120000, // 2 minutes
104104
txTimeout: 60000, // 1 minute
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"name": "testnet",
3-
"environment": "testnet",
2+
"name": "devnet",
3+
"environment": "devnet",
44
"network": {
5-
"nodeUrl": "https://aztec-testnet-fullnode.zkv.xyz",
5+
"nodeUrl": "https://devnet.aztec-labs.com/",
66
"l1RpcUrl": "https://ethereum-sepolia-rpc.publicnode.com",
77
"l1ChainId": 11155111
88
},
99
"settings": {
1010
"skipSandbox": true,
11-
"version": "2.0.2"
11+
"version": "3.0.0-devnet.2"
1212
},
1313
"timeouts": {
1414
"deployTimeout": 1200000,
1515
"txTimeout": 180000,
1616
"waitTimeout": 60000
1717
}
18-
}
18+
}

0 commit comments

Comments
 (0)