@aztec/end-to-end 3.0.0-nightly.20250908 → 3.0.0-nightly.20250911

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.
Files changed (78) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +14 -12
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +35 -39
  4. package/dest/bench/utils.d.ts.map +1 -1
  5. package/dest/bench/utils.js +6 -4
  6. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -6
  7. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  8. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +38 -38
  9. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +4 -5
  10. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  11. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +16 -20
  12. package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
  13. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  14. package/dest/e2e_deploy_contract/deploy_test.js +4 -7
  15. package/dest/e2e_fees/bridging_race.notest.js +10 -8
  16. package/dest/e2e_fees/fees_test.d.ts +3 -4
  17. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  18. package/dest/e2e_fees/fees_test.js +26 -21
  19. package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
  20. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  21. package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
  22. package/dest/e2e_p2p/p2p_network.d.ts +3 -2
  23. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  24. package/dest/e2e_p2p/p2p_network.js +6 -7
  25. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  26. package/dest/e2e_p2p/shared.js +7 -9
  27. package/dest/e2e_token_contract/token_contract_test.d.ts +2 -4
  28. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  29. package/dest/e2e_token_contract/token_contract_test.js +13 -16
  30. package/dest/fixtures/e2e_prover_test.d.ts +4 -3
  31. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  32. package/dest/fixtures/e2e_prover_test.js +22 -29
  33. package/dest/fixtures/snapshot_manager.d.ts +6 -4
  34. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  35. package/dest/fixtures/snapshot_manager.js +22 -12
  36. package/dest/fixtures/token_utils.d.ts +3 -3
  37. package/dest/fixtures/token_utils.d.ts.map +1 -1
  38. package/dest/fixtures/token_utils.js +8 -10
  39. package/dest/fixtures/utils.d.ts +7 -7
  40. package/dest/fixtures/utils.d.ts.map +1 -1
  41. package/dest/fixtures/utils.js +29 -25
  42. package/dest/shared/cross_chain_test_harness.d.ts +6 -6
  43. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  44. package/dest/shared/cross_chain_test_harness.js +5 -6
  45. package/dest/shared/gas_portal_test_harness.d.ts +1 -1
  46. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  47. package/dest/shared/submit-transactions.d.ts +3 -3
  48. package/dest/shared/submit-transactions.d.ts.map +1 -1
  49. package/dest/shared/submit-transactions.js +4 -5
  50. package/dest/shared/uniswap_l1_l2.d.ts +6 -4
  51. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  52. package/dest/shared/uniswap_l1_l2.js +18 -21
  53. package/dest/simulators/lending_simulator.js +1 -1
  54. package/dest/spartan/setup_test_wallets.d.ts +12 -10
  55. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  56. package/dest/spartan/setup_test_wallets.js +54 -50
  57. package/package.json +37 -36
  58. package/src/bench/client_flows/client_flows_benchmark.ts +41 -52
  59. package/src/bench/utils.ts +6 -6
  60. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +39 -50
  61. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +15 -33
  62. package/src/e2e_deploy_contract/deploy_test.ts +6 -14
  63. package/src/e2e_fees/bridging_race.notest.ts +12 -9
  64. package/src/e2e_fees/fees_test.ts +30 -30
  65. package/src/e2e_nested_contract/nested_contract_test.ts +6 -8
  66. package/src/e2e_p2p/p2p_network.ts +10 -10
  67. package/src/e2e_p2p/shared.ts +7 -16
  68. package/src/e2e_token_contract/token_contract_test.ts +14 -17
  69. package/src/fixtures/e2e_prover_test.ts +26 -60
  70. package/src/fixtures/snapshot_manager.ts +32 -24
  71. package/src/fixtures/token_utils.ts +7 -15
  72. package/src/fixtures/utils.ts +37 -41
  73. package/src/shared/cross_chain_test_harness.ts +5 -7
  74. package/src/shared/gas_portal_test_harness.ts +1 -1
  75. package/src/shared/submit-transactions.ts +7 -8
  76. package/src/shared/uniswap_l1_l2.ts +40 -36
  77. package/src/simulators/lending_simulator.ts +1 -1
  78. package/src/spartan/setup_test_wallets.ts +82 -73
@@ -1,42 +1,43 @@
1
- import { getSchnorrAccount, getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
2
- import { generateSchnorrAccounts, getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
1
+ import { generateSchnorrAccounts, getDeployedTestAccounts } from '@aztec/accounts/testing';
3
2
  import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient, createCompatibleClient, retryUntil } from '@aztec/aztec.js';
4
3
  import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
5
4
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
6
5
  import { createPXEService } from '@aztec/pxe/server';
6
+ import { TestWallet } from '@aztec/test-wallet';
7
7
  import { getACVMConfig } from '../fixtures/get_acvm_config.js';
8
8
  import { getBBConfig } from '../fixtures/get_bb_config.js';
9
9
  import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
10
10
  const TOKEN_NAME = 'USDC';
11
11
  const TOKEN_SYMBOL = 'USD';
12
12
  const TOKEN_DECIMALS = 18n;
13
- export async function setupTestWalletsWithTokens(pxeUrl, mintAmount, logger) {
14
- const WALLET_COUNT = 1; // TODO fix this to allow for 16 wallets again
13
+ export async function setupTestAccountsWithTokens(pxeUrl, mintAmount, logger) {
14
+ const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
15
15
  const pxe = await createCompatibleClient(pxeUrl, logger);
16
- const [recipientWallet, ...wallets] = (await getDeployedTestAccountsWallets(pxe)).slice(0, WALLET_COUNT + 1);
17
- const tokenAdmin = wallets[0];
18
- const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
19
- const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
16
+ const wallet = new TestWallet(pxe);
17
+ const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(pxe)).slice(0, ACCOUNT_COUNT + 1);
18
+ const tokenAdmin = accounts[0];
19
+ const tokenAddress = await deployTokenAndMint(wallet, accounts.map((acc)=>acc.address), tokenAdmin.address, mintAmount, undefined, logger);
20
+ const tokenContract = await TokenContract.at(tokenAddress, wallet);
20
21
  return {
21
22
  pxe,
22
- wallets,
23
- tokenAdminWallet,
24
- tokenAdminAddress: tokenAdmin.getAddress(),
23
+ accounts: accounts.map((acc)=>acc.address),
24
+ wallet,
25
+ tokenAdminAddress: tokenAdmin.address,
25
26
  tokenName: TOKEN_NAME,
26
27
  tokenAddress,
27
- recipientAddress: recipientWallet.getAddress(),
28
- recipientWallet
28
+ tokenContract,
29
+ recipientAddress: recipientAccount.address
29
30
  };
30
31
  }
31
- export async function deploySponsoredTestWallets(pxe, mintAmount, logger, numberOfFundedWallets = 1) {
32
+ export async function deploySponsoredTestAccounts(pxe, mintAmount, logger, numberOfFundedWallets = 1) {
33
+ const wallet = new TestWallet(pxe);
32
34
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
33
- const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
34
- const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
35
- await registerSponsoredFPC(pxe);
36
- const wallets = await Promise.all(fundedAccounts.map(async (a)=>{
37
- const wallet = await a.getWallet();
35
+ const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
36
+ const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
37
+ await registerSponsoredFPC(wallet);
38
+ await Promise.all(fundedAccounts.map(async (a)=>{
38
39
  const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
39
- await a.deploy({
40
+ await recipientAccount.deploy({
40
41
  fee: {
41
42
  paymentMethod
42
43
  }
@@ -44,56 +45,54 @@ export async function deploySponsoredTestWallets(pxe, mintAmount, logger, number
44
45
  timeout: 2400
45
46
  }); // increase timeout on purpose in order to account for two empty epochs
46
47
  logger.info(`Account deployed at ${a.getAddress()}`);
47
- return wallet;
48
48
  }));
49
- const tokenAdmin = wallets[0];
50
- const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()), logger);
51
- const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
49
+ const tokenAdmin = fundedAccounts[0];
50
+ const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.getAddress()), tokenAdmin.getAddress(), mintAmount, new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()), logger);
51
+ const tokenContract = await TokenContract.at(tokenAddress, wallet);
52
52
  return {
53
53
  pxe,
54
- wallets,
54
+ wallet,
55
+ accounts: fundedAccounts.map((acc)=>acc.getAddress()),
55
56
  tokenAdminAddress: tokenAdmin.getAddress(),
56
- tokenAdminWallet,
57
57
  tokenName: TOKEN_NAME,
58
58
  tokenAddress,
59
- recipientWallet,
60
- recipientAddress: recipientWallet.getAddress()
59
+ tokenContract,
60
+ recipientAddress: recipientAccount.getAddress()
61
61
  };
62
62
  }
63
- export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
63
+ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
64
64
  const pxe = await createCompatibleClient(pxeUrl, logger);
65
65
  const node = createAztecNodeClient(nodeUrl);
66
+ const wallet = new TestWallet(pxe);
66
67
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
67
- const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
68
- const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
68
+ const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
69
+ const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
69
70
  const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)));
70
71
  // Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
71
72
  await advanceL2Block(node);
72
73
  await advanceL2Block(node);
73
74
  await advanceL2Block(node);
74
- const wallets = await Promise.all(fundedAccounts.map(async (a, i)=>{
75
- const wallet = await a.getWallet();
76
- const paymentMethod = new FeeJuicePaymentMethodWithClaim(wallet, claims[i]);
75
+ await Promise.all(fundedAccounts.map(async (a, i)=>{
76
+ const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.getAddress(), claims[i]);
77
77
  await a.deploy({
78
78
  fee: {
79
79
  paymentMethod
80
80
  }
81
81
  }).wait();
82
82
  logger.info(`Account deployed at ${a.getAddress()}`);
83
- return wallet;
84
83
  }));
85
- const tokenAdmin = wallets[0];
86
- const tokenAddress = await deployTokenAndMint(wallets, tokenAdmin.getAddress(), mintAmount, undefined, logger);
87
- const tokenAdminWallet = await TokenContract.at(tokenAddress, tokenAdmin);
84
+ const tokenAdmin = fundedAccounts[0];
85
+ const tokenAddress = await deployTokenAndMint(wallet, fundedAccounts.map((acc)=>acc.getAddress()), tokenAdmin.getAddress(), mintAmount, undefined, logger);
86
+ const tokenContract = await TokenContract.at(tokenAddress, wallet);
88
87
  return {
89
88
  pxe,
90
- wallets,
89
+ wallet,
90
+ accounts: fundedAccounts.map((acc)=>acc.getAddress()),
91
91
  tokenAdminAddress: tokenAdmin.getAddress(),
92
- tokenAdminWallet,
93
92
  tokenName: TOKEN_NAME,
94
93
  tokenAddress,
95
- recipientWallet,
96
- recipientAddress: recipientWallet.getAddress()
94
+ tokenContract,
95
+ recipientAddress: recipientAccount.getAddress()
97
96
  };
98
97
  }
99
98
  async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, recipient, amount, log) {
@@ -125,9 +124,9 @@ async function advanceL2Block(node, nodeAdmin) {
125
124
  });
126
125
  }
127
126
  }
128
- async function deployTokenAndMint(wallets, admin, mintAmount, paymentMethod, logger) {
127
+ async function deployTokenAndMint(wallet, accounts, admin, mintAmount, paymentMethod, logger) {
129
128
  logger.verbose(`Deploying TokenContract...`);
130
- const tokenContract = await TokenContract.deploy(wallets[0], admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS).send({
129
+ const tokenContract = await TokenContract.deploy(wallet, admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS).send({
131
130
  from: admin,
132
131
  fee: {
133
132
  paymentMethod
@@ -136,8 +135,8 @@ async function deployTokenAndMint(wallets, admin, mintAmount, paymentMethod, log
136
135
  timeout: 600
137
136
  });
138
137
  const tokenAddress = tokenContract.address;
139
- logger.verbose(`Minting ${mintAmount} public assets to the ${wallets.length} wallets...`);
140
- await Promise.all(wallets.map(async (w)=>(await TokenContract.at(tokenAddress, w)).methods.mint_to_public(w.getAddress(), mintAmount).send({
138
+ logger.verbose(`Minting ${mintAmount} public assets to the ${accounts.length} accounts...`);
139
+ await Promise.all(accounts.map(async (acc)=>(await TokenContract.at(tokenAddress, wallet)).methods.mint_to_public(acc, mintAmount).send({
141
140
  from: admin,
142
141
  fee: {
143
142
  paymentMethod
@@ -148,11 +147,16 @@ async function deployTokenAndMint(wallets, admin, mintAmount, paymentMethod, log
148
147
  logger.verbose(`Minting complete.`);
149
148
  return tokenAddress;
150
149
  }
151
- export async function performTransfers({ testWallets, rounds, transferAmount, logger }) {
152
- const recipient = testWallets.recipientWallet.getAddress();
150
+ export async function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod }) {
151
+ const recipient = testAccounts.recipientAddress;
152
+ // Default to sponsored fee payment if no fee method is provided
153
+ const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
153
154
  for(let i = 0; i < rounds; i++){
154
- const txs = testWallets.wallets.map(async (w)=>(await TokenContract.at(testWallets.tokenAddress, w)).methods.transfer_in_public(w.getAddress(), recipient, transferAmount, 0).prove({
155
- from: w.getAddress()
155
+ const txs = testAccounts.accounts.map(async (acc)=>(await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet)).methods.transfer_in_public(acc, recipient, transferAmount, 0).prove({
156
+ from: acc,
157
+ fee: {
158
+ paymentMethod: defaultFeePaymentMethod
159
+ }
156
160
  }));
157
161
  const provenTxs = await Promise.all(txs);
158
162
  await Promise.all(provenTxs.map((t)=>t.send().wait({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "3.0.0-nightly.20250908",
3
+ "version": "3.0.0-nightly.20250911",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -25,41 +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.20250908",
29
- "@aztec/archiver": "3.0.0-nightly.20250908",
30
- "@aztec/aztec": "3.0.0-nightly.20250908",
31
- "@aztec/aztec-node": "3.0.0-nightly.20250908",
32
- "@aztec/aztec.js": "3.0.0-nightly.20250908",
33
- "@aztec/bb-prover": "3.0.0-nightly.20250908",
34
- "@aztec/blob-lib": "3.0.0-nightly.20250908",
35
- "@aztec/blob-sink": "3.0.0-nightly.20250908",
36
- "@aztec/bot": "3.0.0-nightly.20250908",
37
- "@aztec/cli": "3.0.0-nightly.20250908",
38
- "@aztec/constants": "3.0.0-nightly.20250908",
39
- "@aztec/entrypoints": "3.0.0-nightly.20250908",
40
- "@aztec/epoch-cache": "3.0.0-nightly.20250908",
41
- "@aztec/ethereum": "3.0.0-nightly.20250908",
42
- "@aztec/foundation": "3.0.0-nightly.20250908",
43
- "@aztec/kv-store": "3.0.0-nightly.20250908",
44
- "@aztec/l1-artifacts": "3.0.0-nightly.20250908",
45
- "@aztec/merkle-tree": "3.0.0-nightly.20250908",
46
- "@aztec/node-keystore": "3.0.0-nightly.20250908",
47
- "@aztec/noir-contracts.js": "3.0.0-nightly.20250908",
48
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20250908",
49
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250908",
50
- "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250908",
51
- "@aztec/p2p": "3.0.0-nightly.20250908",
52
- "@aztec/protocol-contracts": "3.0.0-nightly.20250908",
53
- "@aztec/prover-client": "3.0.0-nightly.20250908",
54
- "@aztec/prover-node": "3.0.0-nightly.20250908",
55
- "@aztec/pxe": "3.0.0-nightly.20250908",
56
- "@aztec/sequencer-client": "3.0.0-nightly.20250908",
57
- "@aztec/simulator": "3.0.0-nightly.20250908",
58
- "@aztec/slasher": "3.0.0-nightly.20250908",
59
- "@aztec/stdlib": "3.0.0-nightly.20250908",
60
- "@aztec/telemetry-client": "3.0.0-nightly.20250908",
61
- "@aztec/validator-client": "3.0.0-nightly.20250908",
62
- "@aztec/world-state": "3.0.0-nightly.20250908",
28
+ "@aztec/accounts": "3.0.0-nightly.20250911",
29
+ "@aztec/archiver": "3.0.0-nightly.20250911",
30
+ "@aztec/aztec": "3.0.0-nightly.20250911",
31
+ "@aztec/aztec-node": "3.0.0-nightly.20250911",
32
+ "@aztec/aztec.js": "3.0.0-nightly.20250911",
33
+ "@aztec/bb-prover": "3.0.0-nightly.20250911",
34
+ "@aztec/blob-lib": "3.0.0-nightly.20250911",
35
+ "@aztec/blob-sink": "3.0.0-nightly.20250911",
36
+ "@aztec/bot": "3.0.0-nightly.20250911",
37
+ "@aztec/cli": "3.0.0-nightly.20250911",
38
+ "@aztec/constants": "3.0.0-nightly.20250911",
39
+ "@aztec/entrypoints": "3.0.0-nightly.20250911",
40
+ "@aztec/epoch-cache": "3.0.0-nightly.20250911",
41
+ "@aztec/ethereum": "3.0.0-nightly.20250911",
42
+ "@aztec/foundation": "3.0.0-nightly.20250911",
43
+ "@aztec/kv-store": "3.0.0-nightly.20250911",
44
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250911",
45
+ "@aztec/merkle-tree": "3.0.0-nightly.20250911",
46
+ "@aztec/node-keystore": "3.0.0-nightly.20250911",
47
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20250911",
48
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20250911",
49
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250911",
50
+ "@aztec/noir-test-contracts.js": "3.0.0-nightly.20250911",
51
+ "@aztec/p2p": "3.0.0-nightly.20250911",
52
+ "@aztec/protocol-contracts": "3.0.0-nightly.20250911",
53
+ "@aztec/prover-client": "3.0.0-nightly.20250911",
54
+ "@aztec/prover-node": "3.0.0-nightly.20250911",
55
+ "@aztec/pxe": "3.0.0-nightly.20250911",
56
+ "@aztec/sequencer-client": "3.0.0-nightly.20250911",
57
+ "@aztec/simulator": "3.0.0-nightly.20250911",
58
+ "@aztec/slasher": "3.0.0-nightly.20250911",
59
+ "@aztec/stdlib": "3.0.0-nightly.20250911",
60
+ "@aztec/telemetry-client": "3.0.0-nightly.20250911",
61
+ "@aztec/test-wallet": "3.0.0-nightly.20250911",
62
+ "@aztec/validator-client": "3.0.0-nightly.20250911",
63
+ "@aztec/world-state": "3.0.0-nightly.20250911",
63
64
  "@iarna/toml": "^2.2.5",
64
65
  "@jest/globals": "^30.0.0",
65
66
  "@noble/curves": "=1.0.0",
@@ -1,8 +1,4 @@
1
- import { EcdsaRAccountContractArtifact, getEcdsaRAccount } from '@aztec/accounts/ecdsa';
2
- import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWallet } from '@aztec/accounts/schnorr';
3
1
  import {
4
- type AccountWallet,
5
- AccountWalletWithSecretKey,
6
2
  AztecAddress,
7
3
  type AztecNode,
8
4
  FeeJuicePaymentMethod,
@@ -32,6 +28,7 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
32
28
  import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
33
29
  import { type PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
34
30
  import { deriveSigningKey } from '@aztec/stdlib/keys';
31
+ import { TestWallet } from '@aztec/test-wallet';
35
32
 
36
33
  import { MNEMONIC } from '../../fixtures/fixtures.js';
37
34
  import {
@@ -53,22 +50,22 @@ import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './c
53
50
  const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
54
51
 
55
52
  export type AccountType = 'ecdsar1' | 'schnorr';
56
- export type FeePaymentMethodGetter = (wallet: Wallet) => Promise<FeePaymentMethod>;
53
+ export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod>;
57
54
  export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
58
55
 
59
56
  export class ClientFlowsBenchmark {
60
57
  private snapshotManager: ISnapshotManager;
61
58
 
62
59
  public logger: Logger;
63
- public pxe!: PXE;
60
+ private pxe!: PXE;
64
61
  public aztecNode!: AztecNode;
65
62
  public cheatCodes!: CheatCodes;
66
63
  public context!: SubsystemsContext;
67
64
  public chainMonitor!: ChainMonitor;
68
65
  public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
66
+ public adminWallet!: TestWallet;
69
67
 
70
68
  // The admin that aids in the setup of the test
71
- public adminWallet!: AccountWallet;
72
69
  public adminAddress!: AztecAddress;
73
70
 
74
71
  // Aztec Node config
@@ -89,8 +86,9 @@ export class ClientFlowsBenchmark {
89
86
  // Sponsored FPC contract
90
87
  public sponsoredFPC!: SponsoredFPCContract;
91
88
 
92
- // PXE used by the benchmarking user. It can be set up with client-side proving enabled
93
- public userPXE!: PXE;
89
+ // PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
90
+ public userWallet!: TestWallet;
91
+ private userPXE!: PXE;
94
92
 
95
93
  public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
96
94
 
@@ -169,7 +167,7 @@ export class ClientFlowsBenchmark {
169
167
  .balance_of_private(address)
170
168
  .simulate({ from: this.adminAddress });
171
169
 
172
- await mintTokensToPrivate(this.bananaCoin, this.adminAddress, this.adminWallet, address, amount);
170
+ await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
173
171
 
174
172
  const balanceAfter = await this.bananaCoin.methods
175
173
  .balance_of_private(address)
@@ -177,23 +175,20 @@ export class ClientFlowsBenchmark {
177
175
  expect(balanceAfter).toEqual(balanceBefore + amount);
178
176
  }
179
177
 
180
- async createBenchmarkingAccountManager(pxe: PXE, type: 'ecdsar1' | 'schnorr') {
181
- const benchysSecretKey = Fr.random();
178
+ createBenchmarkingAccountManager(wallet: TestWallet, type: 'ecdsar1' | 'schnorr') {
179
+ const benchysSecret = Fr.random();
182
180
  const salt = Fr.random();
183
181
 
184
182
  let benchysPrivateSigningKey;
185
- let benchysAccountManager;
186
183
  if (type === 'schnorr') {
187
- benchysPrivateSigningKey = deriveSigningKey(benchysSecretKey);
188
- benchysAccountManager = await getSchnorrAccount(pxe, benchysSecretKey, benchysPrivateSigningKey, salt);
184
+ benchysPrivateSigningKey = deriveSigningKey(benchysSecret);
185
+ return wallet.createSchnorrAccount(benchysSecret, salt, benchysPrivateSigningKey);
189
186
  } else if (type === 'ecdsar1') {
190
187
  benchysPrivateSigningKey = randomBytes(32);
191
- benchysAccountManager = await getEcdsaRAccount(pxe, benchysSecretKey, benchysPrivateSigningKey, salt);
188
+ return wallet.createECDSARAccount(benchysSecret, salt, benchysPrivateSigningKey);
192
189
  } else {
193
190
  throw new Error(`Unknown account type: ${type}`);
194
191
  }
195
- await benchysAccountManager.register();
196
- return benchysAccountManager;
197
192
  }
198
193
 
199
194
  public async applyBaseSnapshots() {
@@ -205,18 +200,17 @@ export class ClientFlowsBenchmark {
205
200
  await this.snapshotManager.snapshot(
206
201
  'initial_accounts',
207
202
  deployAccounts(2, this.logger),
208
- async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig }) => {
203
+ async (
204
+ { deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
205
+ { wallet, pxe, aztecNode, aztecNodeConfig },
206
+ ) => {
209
207
  this.pxe = pxe;
210
-
208
+ this.adminWallet = wallet;
211
209
  this.aztecNode = aztecNode;
212
210
  this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
213
211
 
214
- const deployedWallets = await Promise.all(
215
- deployedAccounts.map(a => getSchnorrWallet(pxe, a.address, a.signingKey)),
216
- );
217
- [this.adminWallet] = deployedWallets;
218
- this.adminAddress = this.adminWallet.getAddress();
219
- this.sequencerAddress = deployedWallets[1].getAddress();
212
+ this.adminAddress = adminAddress;
213
+ this.sequencerAddress = sequencerAddress;
220
214
 
221
215
  const canonicalFeeJuice = await getCanonicalFeeJuice();
222
216
  this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
@@ -235,6 +229,7 @@ export class ClientFlowsBenchmark {
235
229
  prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
236
230
  },
237
231
  });
232
+ this.userWallet = new TestWallet(this.userPXE);
238
233
  },
239
234
  );
240
235
  }
@@ -330,7 +325,7 @@ export class ClientFlowsBenchmark {
330
325
  );
331
326
  }
332
327
 
333
- public async createCrossChainTestHarness(owner: AccountWallet) {
328
+ public async createCrossChainTestHarness(owner: AztecAddress) {
334
329
  const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
335
330
 
336
331
  const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
@@ -344,8 +339,8 @@ export class ClientFlowsBenchmark {
344
339
  this.aztecNode,
345
340
  this.pxe,
346
341
  l1Client,
342
+ this.adminWallet,
347
343
  owner,
348
- owner.getAddress(),
349
344
  this.logger,
350
345
  underlyingERC20Address,
351
346
  );
@@ -355,26 +350,20 @@ export class ClientFlowsBenchmark {
355
350
  return crossChainTestHarness;
356
351
  }
357
352
 
358
- public async createAndFundBenchmarkingWallet(accountType: AccountType) {
359
- const benchysAccountManager = await this.createBenchmarkingAccountManager(this.pxe, accountType);
360
- const benchysWallet = await benchysAccountManager.getWallet();
353
+ public async createAndFundBenchmarkingAccountOnUserWallet(accountType: AccountType) {
354
+ const benchysAccountManager = await this.createBenchmarkingAccountManager(this.adminWallet, accountType);
355
+ const benchysAccount = await benchysAccountManager.getAccount();
361
356
  const benchysAddress = benchysAccountManager.getAddress();
362
357
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
363
- const paymentMethod = new FeeJuicePaymentMethodWithClaim(benchysWallet, claim);
358
+ const paymentMethod = new FeeJuicePaymentMethodWithClaim(benchysAddress, claim);
364
359
  await benchysAccountManager.deploy({ fee: { paymentMethod } }).wait();
365
- // Register benchy on the user's PXE, where we're going to be interacting from
366
- await this.userPXE.registerContract({
367
- instance: benchysAccountManager.getInstance(),
368
- artifact: accountType === 'ecdsar1' ? EcdsaRAccountContractArtifact : SchnorrAccountContractArtifact,
360
+ // Register benchy on the user's Wallet, where we're going to be interacting from
361
+ const accountManager = await this.userWallet.createAccount({
362
+ secret: benchysAccount.getSecretKey(),
363
+ salt: new Fr(benchysAccount.salt),
364
+ contract: benchysAccountManager.getAccountContract(),
369
365
  });
370
- await this.userPXE.registerAccount(benchysWallet.getSecretKey(), benchysWallet.getCompleteAddress().partialAddress);
371
- const entrypoint = await benchysAccountManager.getAccount();
372
- return new AccountWalletWithSecretKey(
373
- this.userPXE,
374
- entrypoint,
375
- benchysWallet.getSecretKey(),
376
- benchysAccountManager.salt,
377
- );
366
+ return accountManager.getAddress();
378
367
  }
379
368
 
380
369
  public async applyDeployAmmSnapshot() {
@@ -403,20 +392,20 @@ export class ClientFlowsBenchmark {
403
392
  );
404
393
  }
405
394
 
406
- public async getBridgedFeeJuicePaymentMethodForWallet(wallet: Wallet) {
407
- const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(wallet.getAddress());
408
- return new FeeJuicePaymentMethodWithClaim(wallet, claim);
395
+ public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
396
+ const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(sender);
397
+ return new FeeJuicePaymentMethodWithClaim(sender, claim);
409
398
  }
410
399
 
411
- public getPrivateFPCPaymentMethodForWallet(wallet: Wallet) {
412
- return Promise.resolve(new PrivateFeePaymentMethod(this.bananaFPC.address, wallet));
400
+ public getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
401
+ return Promise.resolve(new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet));
413
402
  }
414
403
 
415
- public getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet) {
404
+ public getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet, _sender: AztecAddress) {
416
405
  return Promise.resolve(new SponsoredFeePaymentMethod(this.sponsoredFPC.address));
417
406
  }
418
407
 
419
- public getFeeJuicePaymentMethodForWallet(wallet: Wallet) {
420
- return Promise.resolve(new FeeJuicePaymentMethod(wallet.getAddress()));
408
+ public getFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
409
+ return Promise.resolve(new FeeJuicePaymentMethod(sender));
421
410
  }
422
411
  }
@@ -22,9 +22,8 @@ export async function benchmarkSetup(
22
22
  },
23
23
  ) {
24
24
  const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
25
- const contract = await BenchmarkingContract.deploy(context.wallet)
26
- .send({ from: context.wallet.getAddress() })
27
- .deployed();
25
+ const defaultAccountAddress = context.accounts[0];
26
+ const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress }).deployed();
28
27
  context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
29
28
  const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
30
29
  const telemetry = context.telemetryClient! as BenchmarkTelemetryClient;
@@ -111,9 +110,9 @@ function makeCall(
111
110
  contract: BenchmarkingContract,
112
111
  heavyPublicCompute: boolean,
113
112
  ) {
114
- const owner = context.wallet.getAddress();
113
+ const [owner] = context.accounts;
115
114
  if (heavyPublicCompute) {
116
- return new BatchCall(context.wallet, [contract.methods.sha256_hash_2048(randomBytesAsBigInts(2048))]);
115
+ return new BatchCall(context.wallet, [contract.methods.sha256_hash_1024(randomBytesAsBigInts(1024))]);
117
116
  } else {
118
117
  return new BatchCall(context.wallet, [
119
118
  contract.methods.create_note(owner, index + 1),
@@ -139,7 +138,8 @@ export async function sendTxs(
139
138
  ): Promise<SentTx[]> {
140
139
  const calls = times(txCount, index => makeCall(index, context, contract, heavyPublicCompute));
141
140
  context.logger.info(`Creating ${txCount} txs`);
142
- const provenTxs = await Promise.all(calls.map(call => call.prove({ from: context.wallet.getAddress() })));
141
+ const [from] = context.accounts;
142
+ const provenTxs = await Promise.all(calls.map(call => call.prove({ from })));
143
143
  context.logger.info(`Sending ${txCount} txs`);
144
144
  return provenTxs.map(tx => tx.send());
145
145
  }