Skip to content

Commit 31ccc8d

Browse files
author
sklppy88
committed
init
1 parent 5b80383 commit 31ccc8d

File tree

8 files changed

+33
-15
lines changed

8 files changed

+33
-15
lines changed

.github/workflows/devnet-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
# wait for port-forwards to establish
151151
sleep 5
152152
153-
docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \
153+
docker run --rm --network host $AZTEC_DOCKER_IMAGE node ./aztec/dest/bin/index.js bootstrap-network \
154154
--rpc-url http://127.0.0.1:$PXE_PORT \
155155
--l1-rpc-urls http://127.0.0.1:$ETHEREUM_PORT \
156156
--l1-chain-id "$L1_CHAIN_ID" \

spartan/aztec-network/files/config/deploy-l1-contracts.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ for attempt in $(seq 1 $MAX_RETRIES); do
7171
base_cmd="$base_cmd --validators $VALIDATOR_ADDRESSES"
7272
fi
7373

74+
if [ "${ENABLE_SPONSORED_FPC:-false}" = "true" ]; then
75+
base_cmd="$base_cmd --sponsored-fpc"
76+
fi
77+
7478
output=$(eval $base_cmd --l1-chain-id $CHAIN_ID --salt $SALT) && break
7579

7680
echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..."

spartan/aztec-network/templates/boot-node.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ spec:
113113
value: "{{ .Values.ethereum.l1FixedPriorityFeePerGas }}"
114114
- name: AZTEC_MANA_TARGET
115115
value: "{{ .Values.aztec.manaTarget }}"
116+
- name: ENABLE_SPONSORED_FPC
117+
value: "{{ .Values.aztec.enableSponsoredFpc }}"
116118
- name: K8S_POD_UID
117119
valueFrom:
118120
fieldRef:

spartan/aztec-network/templates/setup-l2-contracts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
done
6666
echo "PXE service is ready!"
6767
set -e
68-
LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait
68+
LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait {{ if .Values.aztec.enableSponsoredFpc }} --sponsoredFPC{{ end }}
6969
echo "L2 contracts initialized"
7070
env:
7171
- name: K8S_POD_UID

spartan/aztec-network/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ aztec:
5959

6060
l1Salt: "" # leave empty for random salt
6161
testAccounts: true
62+
enableSponsoredFpc: false
6263
l1DeploymentMnemonic: "test test test test test test test test test test test junk" # the mnemonic used when deploying contracts
6364
manaTarget: "" # use default value
6465

spartan/aztec-network/values/release-devnet.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ aztec:
3232
realProofs: false
3333
extraAccounts: 9
3434
extraAccountsStartIndex: 69
35+
enableSponsoredFpc: true
3536

3637
jobs:
3738
deployL1Verifier:

yarn-project/accounts/src/testing/index.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @packageDocumentation
77
*/
8-
import type { PXE } from '@aztec/aztec.js';
8+
import { AccountManager, type PXE } from '@aztec/aztec.js';
99
import type { AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
1010

1111
import {
@@ -47,22 +47,27 @@ export function getInitialTestAccounts(): Promise<InitialAccountData[]> {
4747
);
4848
}
4949

50+
/**
51+
* Gets a collection of account managers for the Aztec accounts that are initially stored in the test environment.
52+
* @param pxe - PXE instance.
53+
* @returns A set of AccountManager implementations for each of the initial accounts.
54+
*/
55+
export function getInitialTestAccountsManagers(pxe: PXE): Promise<AccountManager[]> {
56+
return Promise.all(
57+
INITIAL_TEST_SECRET_KEYS.map((encryptionKey, i) =>
58+
getSchnorrAccount(pxe, encryptionKey!, INITIAL_TEST_SIGNING_KEYS[i]!, INITIAL_TEST_ACCOUNT_SALTS[i]),
59+
),
60+
);
61+
}
62+
5063
/**
5164
* Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
5265
* @param pxe - PXE instance.
5366
* @returns A set of AccountWallet implementations for each of the initial accounts.
5467
*/
55-
export function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]> {
68+
export async function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]> {
5669
return Promise.all(
57-
INITIAL_TEST_SECRET_KEYS.map(async (encryptionKey, i) => {
58-
const account = await getSchnorrAccount(
59-
pxe,
60-
encryptionKey!,
61-
INITIAL_TEST_SIGNING_KEYS[i]!,
62-
INITIAL_TEST_ACCOUNT_SALTS[i],
63-
);
64-
return account.getWallet();
65-
}),
70+
(await Promise.all(await getInitialTestAccountsManagers(pxe))).map(accountManager => accountManager.getWallet()),
6671
);
6772
}
6873

yarn-project/cli/src/cmds/devnet/bootstrap_network.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
1+
import { getInitialTestAccountsManagers } from '@aztec/accounts/testing';
22
import {
33
AztecAddress,
44
BatchCall,
@@ -54,7 +54,12 @@ export async function bootstrapNetwork(
5454
) {
5555
const pxe = await createCompatibleClient(pxeUrl, debugLog);
5656

57-
const [wallet] = await getDeployedTestAccountsWallets(pxe);
57+
// We assume here that the initial test accounts were prefunded with deploy-l1-contracts, and deployed with setup-l2-contracts
58+
// so all we need to do is register them to our pxe.
59+
const [accountManager] = await getInitialTestAccountsManagers(pxe);
60+
await accountManager.register();
61+
62+
const wallet = await accountManager.getWallet();
5863

5964
const l1Clients = createL1Clients(
6065
l1Urls,

0 commit comments

Comments
 (0)