@aztec/end-to-end 3.0.0-nightly.20250919 → 3.0.0-nightly.20250921
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.js +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +3 -3
- package/dest/e2e_p2p/shared.js +2 -2
- package/dest/fixtures/e2e_prover_test.js +1 -1
- package/dest/fixtures/snapshot_manager.js +2 -2
- package/dest/fixtures/utils.js +3 -3
- package/dest/shared/cross_chain_test_harness.js +1 -1
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/shared/uniswap_l1_l2.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +4 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +21 -17
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +5 -2
- package/src/e2e_p2p/shared.ts +2 -2
- package/src/fixtures/e2e_prover_test.ts +1 -1
- package/src/fixtures/snapshot_manager.ts +2 -2
- package/src/fixtures/utils.ts +3 -3
- package/src/shared/cross_chain_test_harness.ts +1 -1
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +23 -15
|
@@ -172,7 +172,7 @@ export class ClientFlowsBenchmark {
|
|
|
172
172
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
|
-
this.userWallet = new TestWallet(this.userPXE);
|
|
175
|
+
this.userWallet = new TestWallet(this.userPXE, this.aztecNode);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
async applySetupFeeJuiceSnapshot() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sour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B,UAAU,EAAE,eAAe,EAAE,EAC7B,WAAW,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAc;;;;CAiD/D"}
|
|
@@ -136,10 +136,10 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
136
136
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
137
137
|
const suffix = (this.proverNodes.length + 1).toString();
|
|
138
138
|
const proverNode = await withLogNameSuffix(suffix, ()=>createAndSyncProverNode(proverNodePrivateKey, {
|
|
139
|
-
...this.context.config
|
|
140
|
-
proverId: EthAddress.fromNumber(parseInt(suffix, 10))
|
|
139
|
+
...this.context.config
|
|
141
140
|
}, {
|
|
142
|
-
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
|
|
141
|
+
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
142
|
+
proverId: EthAddress.fromNumber(parseInt(suffix, 10))
|
|
143
143
|
}, this.context.aztecNode, undefined, {
|
|
144
144
|
dateProvider: this.context.dateProvider
|
|
145
145
|
}));
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -33,7 +33,7 @@ export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs
|
|
|
33
33
|
const pxeService = await createPXEService(node, rpcConfig, {
|
|
34
34
|
useLogSuffix: true
|
|
35
35
|
});
|
|
36
|
-
const wallet = new TestWallet(pxeService);
|
|
36
|
+
const wallet = new TestWallet(pxeService, node);
|
|
37
37
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
38
38
|
const txs = await submitTxsTo(wallet, fundedAccountManager.getAddress(), numTxs, logger);
|
|
39
39
|
return {
|
|
@@ -48,7 +48,7 @@ export async function createPXEServiceAndPrepareTransactions(logger, node, numTx
|
|
|
48
48
|
const pxe = await createPXEService(node, rpcConfig, {
|
|
49
49
|
useLogSuffix: true
|
|
50
50
|
});
|
|
51
|
-
const wallet = new TestWallet(pxe);
|
|
51
|
+
const wallet = new TestWallet(pxe, node);
|
|
52
52
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
53
53
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
54
54
|
salt: Fr.random()
|
|
@@ -153,7 +153,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
153
153
|
}, undefined, true);
|
|
154
154
|
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
155
155
|
await result.pxe.registerContract(this.fakeProofsAsset);
|
|
156
|
-
const provenWallet = new TestWallet(result.pxe);
|
|
156
|
+
const provenWallet = new TestWallet(result.pxe, this.aztecNode);
|
|
157
157
|
for(let i = 0; i < 2; i++){
|
|
158
158
|
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
159
159
|
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
@@ -331,7 +331,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
331
331
|
// Only enable proving if specifically requested.
|
|
332
332
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
333
333
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
334
|
-
const wallet = new TestWallet(pxe);
|
|
334
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
335
335
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
336
336
|
if (statePath) {
|
|
337
337
|
writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
|
|
@@ -430,7 +430,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
430
430
|
const pxeConfig = getPXEServiceConfig();
|
|
431
431
|
pxeConfig.dataDirectory = statePath;
|
|
432
432
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
433
|
-
const wallet = new TestWallet(pxe);
|
|
433
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
434
434
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
435
435
|
return {
|
|
436
436
|
aztecNodeConfig,
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -137,7 +137,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
137
137
|
await waitForPXE(pxeClient, logger);
|
|
138
138
|
logger.verbose('JSON RPC client connected to PXE');
|
|
139
139
|
logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
|
|
140
|
-
const { l1ContractAddresses, rollupVersion } = await
|
|
140
|
+
const { l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
141
141
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
142
142
|
const deployL1ContractsValues = {
|
|
143
143
|
l1ContractAddresses,
|
|
@@ -149,7 +149,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
149
149
|
const teardown = ()=>Promise.resolve();
|
|
150
150
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
151
151
|
const initialFundedAccounts = await getDeployedTestAccounts(pxeClient);
|
|
152
|
-
const wallet = new TestWallet(pxeClient);
|
|
152
|
+
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
153
153
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
154
154
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
155
155
|
// Deploy new accounts if there's a test that requires more funded accounts in the remote environment.
|
|
@@ -419,7 +419,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
419
419
|
await cheatCodes.rollup.setupEpoch();
|
|
420
420
|
await cheatCodes.rollup.debugRollup();
|
|
421
421
|
}
|
|
422
|
-
const wallet = new TestWallet(pxe);
|
|
422
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
423
423
|
let accounts = [];
|
|
424
424
|
// Below we continue with what we described in the long comment on line 571.
|
|
425
425
|
if (numberOfAccounts === 0) {
|
|
@@ -88,7 +88,7 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
88
88
|
ownerAddress;
|
|
89
89
|
static async new(aztecNode, pxeService, l1Client, wallet, ownerAddress, logger, underlyingERC20Address) {
|
|
90
90
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
91
|
-
const l1ContractAddresses = (await
|
|
91
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
92
92
|
// Deploy and initialize all required contracts
|
|
93
93
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
94
94
|
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, ownerAddress, underlyingERC20Address);
|
|
@@ -9,7 +9,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
9
9
|
async createReal() {
|
|
10
10
|
const { aztecNode, aztecNodeAdmin, pxeService, l1Client, wallet, logger } = this.config;
|
|
11
11
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
12
|
-
const l1ContractAddresses = (await
|
|
12
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
13
13
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
14
14
|
const feeJuicePortalAddress = l1ContractAddresses.feeJuicePortalAddress;
|
|
15
15
|
if (feeJuiceAddress.isZero() || feeJuicePortalAddress.isZero()) {
|
|
@@ -72,7 +72,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
72
72
|
uniswapL2Contract = await UniswapContract.deploy(wallet, uniswapPortalAddress).send({
|
|
73
73
|
from: ownerAddress
|
|
74
74
|
}).deployed();
|
|
75
|
-
const registryAddress = (await
|
|
75
|
+
const registryAddress = (await aztecNode.getNodeInfo()).l1ContractAddresses.registryAddress;
|
|
76
76
|
await uniswapPortal.write.initialize([
|
|
77
77
|
registryAddress.toString(),
|
|
78
78
|
uniswapL2Contract.address.toString()
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type AztecAddress, type FeePaymentMethod, type PXE } from '@aztec/aztec.js';
|
|
1
|
+
import { type AztecAddress, type AztecNode, type FeePaymentMethod, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TestWallet } from '@aztec/test-wallet';
|
|
5
5
|
export interface TestAccounts {
|
|
6
6
|
pxe: PXE;
|
|
7
|
+
aztecNode: AztecNode;
|
|
7
8
|
wallet: TestWallet;
|
|
8
9
|
accounts: AztecAddress[];
|
|
9
10
|
tokenContract: TokenContract;
|
|
@@ -12,8 +13,8 @@ export interface TestAccounts {
|
|
|
12
13
|
recipientAddress: AztecAddress;
|
|
13
14
|
tokenAddress: AztecAddress;
|
|
14
15
|
}
|
|
15
|
-
export declare function setupTestAccountsWithTokens(pxeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
16
|
-
export declare function deploySponsoredTestAccounts(pxe: PXE, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
16
|
+
export declare function setupTestAccountsWithTokens(pxeUrl: string, nodeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
17
|
+
export declare function deploySponsoredTestAccounts(pxe: PXE, aztecNode: AztecNode, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
17
18
|
export declare function deployTestAccountsWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
18
19
|
export declare function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
19
20
|
testAccounts: TestAccounts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,gBAAgB,EAGrB,KAAK,GAAG,EAMT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,YAAY,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA+BvB;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAsCvB;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAkDvB;AAgFD,wBAAsB,gBAAgB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,gBAAgB,GACjB,EAAE;IACD,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,iBAiBA;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAmBrD"}
|
|
@@ -10,16 +10,18 @@ import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.
|
|
|
10
10
|
const TOKEN_NAME = 'USDC';
|
|
11
11
|
const TOKEN_SYMBOL = 'USD';
|
|
12
12
|
const TOKEN_DECIMALS = 18n;
|
|
13
|
-
export async function setupTestAccountsWithTokens(pxeUrl, mintAmount, logger) {
|
|
13
|
+
export async function setupTestAccountsWithTokens(pxeUrl, nodeUrl, mintAmount, logger) {
|
|
14
14
|
const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
|
|
15
15
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
16
|
-
const
|
|
16
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
17
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
17
18
|
const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(pxe)).slice(0, ACCOUNT_COUNT + 1);
|
|
18
19
|
const tokenAdmin = accounts[0];
|
|
19
20
|
const tokenAddress = await deployTokenAndMint(wallet, accounts.map((acc)=>acc.address), tokenAdmin.address, mintAmount, undefined, logger);
|
|
20
21
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
21
22
|
return {
|
|
22
23
|
pxe,
|
|
24
|
+
aztecNode,
|
|
23
25
|
accounts: accounts.map((acc)=>acc.address),
|
|
24
26
|
wallet,
|
|
25
27
|
tokenAdminAddress: tokenAdmin.address,
|
|
@@ -29,8 +31,8 @@ export async function setupTestAccountsWithTokens(pxeUrl, mintAmount, logger) {
|
|
|
29
31
|
recipientAddress: recipientAccount.address
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
export async function deploySponsoredTestAccounts(pxe, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
33
|
-
const wallet = new TestWallet(pxe);
|
|
34
|
+
export async function deploySponsoredTestAccounts(pxe, aztecNode, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
35
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
34
36
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
35
37
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
36
38
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
@@ -51,6 +53,7 @@ export async function deploySponsoredTestAccounts(pxe, mintAmount, logger, numbe
|
|
|
51
53
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
52
54
|
return {
|
|
53
55
|
pxe,
|
|
56
|
+
aztecNode,
|
|
54
57
|
wallet,
|
|
55
58
|
accounts: fundedAccounts.map((acc)=>acc.getAddress()),
|
|
56
59
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
@@ -62,16 +65,16 @@ export async function deploySponsoredTestAccounts(pxe, mintAmount, logger, numbe
|
|
|
62
65
|
}
|
|
63
66
|
export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
64
67
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
65
|
-
const
|
|
66
|
-
const wallet = new TestWallet(pxe);
|
|
68
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
69
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
67
70
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
68
71
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
69
72
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
70
|
-
const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe,
|
|
73
|
+
const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, aztecNode, a.getAddress(), undefined, logger)));
|
|
71
74
|
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
72
|
-
await advanceL2Block(
|
|
73
|
-
await advanceL2Block(
|
|
74
|
-
await advanceL2Block(
|
|
75
|
+
await advanceL2Block(aztecNode);
|
|
76
|
+
await advanceL2Block(aztecNode);
|
|
77
|
+
await advanceL2Block(aztecNode);
|
|
75
78
|
await Promise.all(fundedAccounts.map(async (a, i)=>{
|
|
76
79
|
const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.getAddress(), claims[i]);
|
|
77
80
|
await a.deploy({
|
|
@@ -86,6 +89,7 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
|
|
|
86
89
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
87
90
|
return {
|
|
88
91
|
pxe,
|
|
92
|
+
aztecNode,
|
|
89
93
|
wallet,
|
|
90
94
|
accounts: fundedAccounts.map((acc)=>acc.getAddress()),
|
|
91
95
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
@@ -95,21 +99,21 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
|
|
|
95
99
|
recipientAddress: recipientAccount.getAddress()
|
|
96
100
|
};
|
|
97
101
|
}
|
|
98
|
-
async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe,
|
|
99
|
-
const { l1ChainId } = await
|
|
102
|
+
async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, aztecNode, recipient, amount, log) {
|
|
103
|
+
const { l1ChainId } = await aztecNode.getNodeInfo();
|
|
100
104
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
101
105
|
const l1Client = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
|
|
102
106
|
// docs:start:bridge_fee_juice
|
|
103
|
-
const portal = await L1FeeJuicePortalManager.new(
|
|
107
|
+
const portal = await L1FeeJuicePortalManager.new(aztecNode, l1Client, log);
|
|
104
108
|
const claim = await portal.bridgeTokensPublic(recipient, amount, true);
|
|
105
109
|
// docs:end:bridge_fee_juice
|
|
106
|
-
const isSynced = async ()=>await
|
|
110
|
+
const isSynced = async ()=>await aztecNode.getL1ToL2MessageBlock(Fr.fromHexString(claim.messageHash)) !== undefined;
|
|
107
111
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
|
|
108
112
|
log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
|
|
109
113
|
return claim;
|
|
110
114
|
}
|
|
111
|
-
async function advanceL2Block(
|
|
112
|
-
const initialBlockNumber = await
|
|
115
|
+
async function advanceL2Block(aztecNode, nodeAdmin) {
|
|
116
|
+
const initialBlockNumber = await aztecNode.getBlockNumber();
|
|
113
117
|
let minTxsPerBlock = undefined;
|
|
114
118
|
if (nodeAdmin) {
|
|
115
119
|
({ minTxsPerBlock } = await nodeAdmin.getConfig());
|
|
@@ -117,7 +121,7 @@ async function advanceL2Block(node, nodeAdmin) {
|
|
|
117
121
|
minTxsPerBlock: 0
|
|
118
122
|
}); // Set to 0 to ensure we can advance the block
|
|
119
123
|
}
|
|
120
|
-
await retryUntil(async ()=>await
|
|
124
|
+
await retryUntil(async ()=>await aztecNode.getBlockNumber() >= initialBlockNumber + 1);
|
|
121
125
|
if (nodeAdmin && minTxsPerBlock !== undefined) {
|
|
122
126
|
await nodeAdmin.setConfig({
|
|
123
127
|
minTxsPerBlock
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250921",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250921",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250921",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250921",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250921",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250921",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250921",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250921",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250921",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250921",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250921",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250921",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250921",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250921",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250921",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250921",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250921",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250921",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250921",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250921",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250921",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250921",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250921",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250921",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250921",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250921",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250921",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250921",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250921",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250921",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250921",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250921",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250921",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250921",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250921",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250921",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250921",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -229,7 +229,7 @@ export class ClientFlowsBenchmark {
|
|
|
229
229
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
230
230
|
},
|
|
231
231
|
});
|
|
232
|
-
this.userWallet = new TestWallet(this.userPXE);
|
|
232
|
+
this.userWallet = new TestWallet(this.userPXE, this.aztecNode);
|
|
233
233
|
},
|
|
234
234
|
);
|
|
235
235
|
}
|
|
@@ -194,8 +194,11 @@ export class EpochsTestContext {
|
|
|
194
194
|
const proverNode = await withLogNameSuffix(suffix, () =>
|
|
195
195
|
createAndSyncProverNode(
|
|
196
196
|
proverNodePrivateKey,
|
|
197
|
-
{ ...this.context.config
|
|
198
|
-
{
|
|
197
|
+
{ ...this.context.config },
|
|
198
|
+
{
|
|
199
|
+
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
200
|
+
proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
|
|
201
|
+
},
|
|
199
202
|
this.context.aztecNode,
|
|
200
203
|
undefined,
|
|
201
204
|
{ dateProvider: this.context.dateProvider },
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -65,7 +65,7 @@ export const createPXEServiceAndSubmitTransactions = async (
|
|
|
65
65
|
const rpcConfig = getRpcConfig();
|
|
66
66
|
rpcConfig.proverEnabled = false;
|
|
67
67
|
const pxeService = await createPXEService(node, rpcConfig, { useLogSuffix: true });
|
|
68
|
-
const wallet = new TestWallet(pxeService);
|
|
68
|
+
const wallet = new TestWallet(pxeService, node);
|
|
69
69
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
70
70
|
const txs = await submitTxsTo(wallet, fundedAccountManager.getAddress(), numTxs, logger);
|
|
71
71
|
return { txs, pxeService, node };
|
|
@@ -81,7 +81,7 @@ export async function createPXEServiceAndPrepareTransactions(
|
|
|
81
81
|
rpcConfig.proverEnabled = false;
|
|
82
82
|
const pxe = await createPXEService(node, rpcConfig, { useLogSuffix: true });
|
|
83
83
|
|
|
84
|
-
const wallet = new TestWallet(pxe);
|
|
84
|
+
const wallet = new TestWallet(pxe, node);
|
|
85
85
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
86
86
|
|
|
87
87
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
@@ -224,7 +224,7 @@ export class FullProverTest {
|
|
|
224
224
|
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
225
225
|
await result.pxe.registerContract(this.fakeProofsAsset);
|
|
226
226
|
|
|
227
|
-
const provenWallet = new TestWallet(result.pxe);
|
|
227
|
+
const provenWallet = new TestWallet(result.pxe, this.aztecNode);
|
|
228
228
|
|
|
229
229
|
for (let i = 0; i < 2; i++) {
|
|
230
230
|
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
@@ -448,7 +448,7 @@ async function setupFromFresh(
|
|
|
448
448
|
// Only enable proving if specifically requested.
|
|
449
449
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
450
450
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
451
|
-
const wallet = new TestWallet(pxe);
|
|
451
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
452
452
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
453
453
|
|
|
454
454
|
if (statePath) {
|
|
@@ -577,7 +577,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
577
577
|
const pxeConfig = getPXEServiceConfig();
|
|
578
578
|
pxeConfig.dataDirectory = statePath;
|
|
579
579
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
580
|
-
const wallet = new TestWallet(pxe);
|
|
580
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
581
581
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
582
582
|
|
|
583
583
|
return {
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -226,7 +226,7 @@ async function setupWithRemoteEnvironment(
|
|
|
226
226
|
await waitForPXE(pxeClient, logger);
|
|
227
227
|
logger.verbose('JSON RPC client connected to PXE');
|
|
228
228
|
logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
|
|
229
|
-
const { l1ContractAddresses, rollupVersion } = await
|
|
229
|
+
const { l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
230
230
|
|
|
231
231
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
232
232
|
|
|
@@ -241,7 +241,7 @@ async function setupWithRemoteEnvironment(
|
|
|
241
241
|
|
|
242
242
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
243
243
|
const initialFundedAccounts = await getDeployedTestAccounts(pxeClient);
|
|
244
|
-
const wallet = new TestWallet(pxeClient);
|
|
244
|
+
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
245
245
|
|
|
246
246
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
247
247
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
@@ -670,7 +670,7 @@ export async function setup(
|
|
|
670
670
|
await cheatCodes.rollup.setupEpoch();
|
|
671
671
|
await cheatCodes.rollup.debugRollup();
|
|
672
672
|
}
|
|
673
|
-
const wallet = new TestWallet(pxe);
|
|
673
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
674
674
|
let accounts: AztecAddress[] = [];
|
|
675
675
|
// Below we continue with what we described in the long comment on line 571.
|
|
676
676
|
if (numberOfAccounts === 0) {
|
|
@@ -139,7 +139,7 @@ export class CrossChainTestHarness {
|
|
|
139
139
|
underlyingERC20Address: EthAddress,
|
|
140
140
|
): Promise<CrossChainTestHarness> {
|
|
141
141
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
142
|
-
const l1ContractAddresses = (await
|
|
142
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
143
143
|
|
|
144
144
|
// Deploy and initialize all required contracts
|
|
145
145
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
@@ -41,7 +41,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
41
41
|
const { aztecNode, aztecNodeAdmin, pxeService, l1Client, wallet, logger } = this.config;
|
|
42
42
|
|
|
43
43
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
44
|
-
const l1ContractAddresses = (await
|
|
44
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
45
45
|
|
|
46
46
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
47
47
|
const feeJuicePortalAddress = l1ContractAddresses.feeJuicePortalAddress;
|
|
@@ -155,7 +155,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
155
155
|
.send({ from: ownerAddress })
|
|
156
156
|
.deployed();
|
|
157
157
|
|
|
158
|
-
const registryAddress = (await
|
|
158
|
+
const registryAddress = (await aztecNode.getNodeInfo()).l1ContractAddresses.registryAddress;
|
|
159
159
|
|
|
160
160
|
await uniswapPortal.write.initialize(
|
|
161
161
|
[registryAddress.toString(), uniswapL2Contract.address.toString()],
|
|
@@ -26,6 +26,7 @@ import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.
|
|
|
26
26
|
|
|
27
27
|
export interface TestAccounts {
|
|
28
28
|
pxe: PXE;
|
|
29
|
+
aztecNode: AztecNode;
|
|
29
30
|
wallet: TestWallet;
|
|
30
31
|
accounts: AztecAddress[];
|
|
31
32
|
tokenContract: TokenContract;
|
|
@@ -41,13 +42,15 @@ const TOKEN_DECIMALS = 18n;
|
|
|
41
42
|
|
|
42
43
|
export async function setupTestAccountsWithTokens(
|
|
43
44
|
pxeUrl: string,
|
|
45
|
+
nodeUrl: string,
|
|
44
46
|
mintAmount: bigint,
|
|
45
47
|
logger: Logger,
|
|
46
48
|
): Promise<TestAccounts> {
|
|
47
49
|
const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
|
|
48
50
|
|
|
49
51
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
50
|
-
const
|
|
52
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
53
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
51
54
|
|
|
52
55
|
const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(pxe)).slice(0, ACCOUNT_COUNT + 1);
|
|
53
56
|
|
|
@@ -64,6 +67,7 @@ export async function setupTestAccountsWithTokens(
|
|
|
64
67
|
|
|
65
68
|
return {
|
|
66
69
|
pxe,
|
|
70
|
+
aztecNode,
|
|
67
71
|
accounts: accounts.map(acc => acc.address),
|
|
68
72
|
wallet,
|
|
69
73
|
tokenAdminAddress: tokenAdmin.address,
|
|
@@ -76,11 +80,12 @@ export async function setupTestAccountsWithTokens(
|
|
|
76
80
|
|
|
77
81
|
export async function deploySponsoredTestAccounts(
|
|
78
82
|
pxe: PXE,
|
|
83
|
+
aztecNode: AztecNode,
|
|
79
84
|
mintAmount: bigint,
|
|
80
85
|
logger: Logger,
|
|
81
86
|
numberOfFundedWallets = 1,
|
|
82
87
|
): Promise<TestAccounts> {
|
|
83
|
-
const wallet = new TestWallet(pxe);
|
|
88
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
84
89
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
85
90
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
86
91
|
const fundedAccounts = await Promise.all(funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
@@ -108,6 +113,7 @@ export async function deploySponsoredTestAccounts(
|
|
|
108
113
|
|
|
109
114
|
return {
|
|
110
115
|
pxe,
|
|
116
|
+
aztecNode,
|
|
111
117
|
wallet,
|
|
112
118
|
accounts: fundedAccounts.map(acc => acc.getAddress()),
|
|
113
119
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
@@ -128,8 +134,8 @@ export async function deployTestAccountsWithTokens(
|
|
|
128
134
|
numberOfFundedWallets = 1,
|
|
129
135
|
): Promise<TestAccounts> {
|
|
130
136
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
131
|
-
const
|
|
132
|
-
const wallet = new TestWallet(pxe);
|
|
137
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
138
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
133
139
|
|
|
134
140
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
135
141
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
@@ -137,14 +143,14 @@ export async function deployTestAccountsWithTokens(
|
|
|
137
143
|
|
|
138
144
|
const claims = await Promise.all(
|
|
139
145
|
fundedAccounts.map(a =>
|
|
140
|
-
bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe,
|
|
146
|
+
bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, aztecNode, a.getAddress(), undefined, logger),
|
|
141
147
|
),
|
|
142
148
|
);
|
|
143
149
|
|
|
144
150
|
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
145
|
-
await advanceL2Block(
|
|
146
|
-
await advanceL2Block(
|
|
147
|
-
await advanceL2Block(
|
|
151
|
+
await advanceL2Block(aztecNode);
|
|
152
|
+
await advanceL2Block(aztecNode);
|
|
153
|
+
await advanceL2Block(aztecNode);
|
|
148
154
|
|
|
149
155
|
await Promise.all(
|
|
150
156
|
fundedAccounts.map(async (a, i) => {
|
|
@@ -167,6 +173,7 @@ export async function deployTestAccountsWithTokens(
|
|
|
167
173
|
|
|
168
174
|
return {
|
|
169
175
|
pxe,
|
|
176
|
+
aztecNode,
|
|
170
177
|
wallet,
|
|
171
178
|
accounts: fundedAccounts.map(acc => acc.getAddress()),
|
|
172
179
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
@@ -181,29 +188,30 @@ async function bridgeL1FeeJuice(
|
|
|
181
188
|
l1RpcUrls: string[],
|
|
182
189
|
mnemonicOrPrivateKey: string,
|
|
183
190
|
pxe: PXE,
|
|
184
|
-
|
|
191
|
+
aztecNode: AztecNode,
|
|
185
192
|
recipient: AztecAddress,
|
|
186
193
|
amount: bigint | undefined,
|
|
187
194
|
log: Logger,
|
|
188
195
|
) {
|
|
189
|
-
const { l1ChainId } = await
|
|
196
|
+
const { l1ChainId } = await aztecNode.getNodeInfo();
|
|
190
197
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
191
198
|
const l1Client = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
|
|
192
199
|
|
|
193
200
|
// docs:start:bridge_fee_juice
|
|
194
|
-
const portal = await L1FeeJuicePortalManager.new(
|
|
201
|
+
const portal = await L1FeeJuicePortalManager.new(aztecNode, l1Client, log);
|
|
195
202
|
const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
|
|
196
203
|
// docs:end:bridge_fee_juice
|
|
197
204
|
|
|
198
|
-
const isSynced = async () =>
|
|
205
|
+
const isSynced = async () =>
|
|
206
|
+
(await aztecNode.getL1ToL2MessageBlock(Fr.fromHexString(claim.messageHash))) !== undefined;
|
|
199
207
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
|
|
200
208
|
|
|
201
209
|
log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
|
|
202
210
|
return claim;
|
|
203
211
|
}
|
|
204
212
|
|
|
205
|
-
async function advanceL2Block(
|
|
206
|
-
const initialBlockNumber = await
|
|
213
|
+
async function advanceL2Block(aztecNode: AztecNode, nodeAdmin?: AztecNodeAdmin) {
|
|
214
|
+
const initialBlockNumber = await aztecNode.getBlockNumber();
|
|
207
215
|
|
|
208
216
|
let minTxsPerBlock = undefined;
|
|
209
217
|
if (nodeAdmin) {
|
|
@@ -211,7 +219,7 @@ async function advanceL2Block(node: AztecNode, nodeAdmin?: AztecNodeAdmin) {
|
|
|
211
219
|
await nodeAdmin.setConfig({ minTxsPerBlock: 0 }); // Set to 0 to ensure we can advance the block
|
|
212
220
|
}
|
|
213
221
|
|
|
214
|
-
await retryUntil(async () => (await
|
|
222
|
+
await retryUntil(async () => (await aztecNode.getBlockNumber()) >= initialBlockNumber + 1);
|
|
215
223
|
|
|
216
224
|
if (nodeAdmin && minTxsPerBlock !== undefined) {
|
|
217
225
|
await nodeAdmin.setConfig({ minTxsPerBlock });
|