Skip to content

Commit 8a47d8b

Browse files
sklppy88sklppy88
andauthored
fix: bootstrap network and sponsored fpc devnet (#13044)
Enables sponsoredFPC and fixes bootstrap network Co-authored-by: sklppy88 <esau@aztecprotocol.com>
1 parent 1ebd044 commit 8a47d8b

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
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/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+
sponsoredFPC: 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)