@aztec/end-to-end 3.0.0-nightly.20251115 → 3.0.0-nightly.20251119

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 (42) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +7 -0
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +53 -30
  4. package/dest/bench/client_flows/data_extractor.js +5 -27
  5. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +2 -2
  6. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  7. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +4 -3
  8. package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
  9. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  10. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  11. package/dest/e2e_fees/fees_test.js +11 -8
  12. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  13. package/dest/e2e_nested_contract/nested_contract_test.js +4 -3
  14. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  15. package/dest/e2e_p2p/p2p_network.js +3 -2
  16. package/dest/e2e_p2p/shared.js +1 -1
  17. package/dest/e2e_token_contract/token_contract_test.js +2 -2
  18. package/dest/fixtures/e2e_prover_test.d.ts +2 -0
  19. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  20. package/dest/fixtures/e2e_prover_test.js +16 -13
  21. package/dest/fixtures/token_utils.d.ts +4 -1
  22. package/dest/fixtures/token_utils.d.ts.map +1 -1
  23. package/dest/fixtures/token_utils.js +7 -4
  24. package/dest/fixtures/utils.js +2 -8
  25. package/dest/shared/gas_portal_test_harness.js +1 -1
  26. package/dest/spartan/setup_test_wallets.js +6 -6
  27. package/package.json +38 -37
  28. package/src/bench/client_flows/client_flows_benchmark.ts +75 -30
  29. package/src/bench/client_flows/data_extractor.ts +6 -28
  30. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +2 -2
  31. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +4 -3
  32. package/src/e2e_deploy_contract/deploy_test.ts +1 -1
  33. package/src/e2e_fees/fees_test.ts +11 -8
  34. package/src/e2e_nested_contract/nested_contract_test.ts +4 -3
  35. package/src/e2e_p2p/p2p_network.ts +3 -2
  36. package/src/e2e_p2p/shared.ts +1 -1
  37. package/src/e2e_token_contract/token_contract_test.ts +2 -2
  38. package/src/fixtures/e2e_prover_test.ts +14 -15
  39. package/src/fixtures/token_utils.ts +4 -4
  40. package/src/fixtures/utils.ts +2 -2
  41. package/src/shared/gas_portal_test_harness.ts +1 -1
  42. package/src/spartan/setup_test_wallets.ts +8 -8
@@ -10,6 +10,7 @@ import {
10
10
  QueuedIVCVerifier,
11
11
  TestCircuitVerifier,
12
12
  } from '@aztec/bb-prover';
13
+ import { BackendType, Barretenberg } from '@aztec/bb.js';
13
14
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
14
15
  import type { BlobSinkServer } from '@aztec/blob-sink/server';
15
16
  import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
@@ -18,6 +19,7 @@ import { SecretValue } from '@aztec/foundation/config';
18
19
  import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
19
20
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
20
21
  import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
22
+ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
21
23
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
22
24
  import { TestWallet } from '@aztec/test-wallet/server';
23
25
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -62,6 +64,7 @@ export class FullProverTest {
62
64
  accounts: AztecAddress[] = [];
63
65
  deployedAccounts!: InitialAccountData[];
64
66
  fakeProofsAsset!: TokenContract;
67
+ fakeProofsAssetInstance!: ContractInstanceWithAddress;
65
68
  tokenSim!: TokenSimulator;
66
69
  aztecNode!: AztecNode;
67
70
  aztecNodeAdmin!: AztecNodeAdmin;
@@ -121,7 +124,7 @@ export class FullProverTest {
121
124
  await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
122
125
 
123
126
  this.logger.verbose(`Deploying TokenContract...`);
124
- const asset = await TokenContract.deploy(
127
+ const { contract: asset, instance } = await TokenContract.deploy(
125
128
  this.wallet,
126
129
  this.accounts[0],
127
130
  FullProverTest.TOKEN_NAME,
@@ -129,14 +132,15 @@ export class FullProverTest {
129
132
  FullProverTest.TOKEN_DECIMALS,
130
133
  )
131
134
  .send({ from: this.accounts[0] })
132
- .deployed();
135
+ .wait();
133
136
  this.logger.verbose(`Token deployed to ${asset.address}`);
134
137
 
135
- return { tokenContractAddress: asset.address };
138
+ return { tokenContractAddress: asset.address, tokenContractInstance: instance };
136
139
  },
137
- async ({ tokenContractAddress }) => {
140
+ async ({ tokenContractAddress, tokenContractInstance }) => {
138
141
  // Restore the token contract state.
139
- this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallet);
142
+ this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
143
+ this.fakeProofsAssetInstance = tokenContractInstance;
140
144
  this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
141
145
 
142
146
  this.tokenSim = new TokenSimulator(
@@ -183,9 +187,7 @@ export class FullProverTest {
183
187
  this.acvmConfigCleanup = acvmConfig.cleanup;
184
188
  this.bbConfigCleanup = bbConfig.cleanup;
185
189
 
186
- if (!bbConfig?.bbWorkingDirectory || !bbConfig?.bbBinaryPath) {
187
- throw new Error(`Test must be run with BB native configuration`);
188
- }
190
+ await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
189
191
 
190
192
  const verifier = await BBCircuitVerifier.new(bbConfig);
191
193
  this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
@@ -212,23 +214,19 @@ export class FullProverTest {
212
214
  this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
213
215
  const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
214
216
  this.aztecNode,
215
- {
216
- proverEnabled: this.realProofs,
217
- bbBinaryPath: bbConfig?.bbBinaryPath,
218
- bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
219
- },
217
+ { proverEnabled: this.realProofs },
220
218
  undefined,
221
219
  true,
222
220
  );
223
221
  this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
224
- await provenWallet.registerContract(this.fakeProofsAsset);
222
+ await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
225
223
 
226
224
  for (let i = 0; i < 2; i++) {
227
225
  await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
228
226
  await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
229
227
  }
230
228
 
231
- const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
229
+ const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
232
230
  this.provenComponents.push({
233
231
  wallet: provenWallet,
234
232
  teardown: provenTeardown,
@@ -321,6 +319,7 @@ export class FullProverTest {
321
319
  // clean up the full prover node
322
320
  await this.proverNode.stop();
323
321
 
322
+ await Barretenberg.destroySingleton();
324
323
  await this.bbConfigCleanup?.();
325
324
  await this.acvmConfigCleanup?.();
326
325
  }
@@ -6,9 +6,9 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token';
6
6
 
7
7
  export async function deployToken(wallet: Wallet, admin: AztecAddress, initialAdminBalance: bigint, logger: Logger) {
8
8
  logger.info(`Deploying Token contract...`);
9
- const contract = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18)
9
+ const { contract, instance } = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18)
10
10
  .send({ from: admin })
11
- .deployed();
11
+ .wait();
12
12
 
13
13
  if (initialAdminBalance > 0n) {
14
14
  await mintTokensToPrivate(contract, admin, admin, initialAdminBalance);
@@ -16,7 +16,7 @@ export async function deployToken(wallet: Wallet, admin: AztecAddress, initialAd
16
16
 
17
17
  logger.info('L2 contract deployed');
18
18
 
19
- return contract;
19
+ return { contract, instance };
20
20
  }
21
21
 
22
22
  export async function mintTokensToPrivate(
@@ -36,7 +36,7 @@ export async function expectTokenBalance(
36
36
  logger: Logger,
37
37
  ) {
38
38
  // Then check the balance
39
- const contractWithWallet = await TokenContract.at(token.address, wallet);
39
+ const contractWithWallet = TokenContract.at(token.address, wallet);
40
40
  const balance = await contractWithWallet.methods.balance_of_private(owner).simulate({ from: owner });
41
41
  logger.info(`Account ${owner} balance: ${balance}`);
42
42
  expect(balance).toBe(expectedBalance);
@@ -858,7 +858,7 @@ export async function setupSponsoredFPC(wallet: Wallet) {
858
858
  salt: new Fr(SPONSORED_FPC_SALT),
859
859
  });
860
860
 
861
- await wallet.registerContract({ instance, artifact: SponsoredFPCContract.artifact });
861
+ await wallet.registerContract(instance, SponsoredFPCContract.artifact);
862
862
  getLogger().info(`SponsoredFPC: ${instance.address}`);
863
863
  return instance;
864
864
  }
@@ -868,7 +868,7 @@ export async function setupSponsoredFPC(wallet: Wallet) {
868
868
  * @param wallet - The wallet
869
869
  */
870
870
  export async function registerSponsoredFPC(wallet: Wallet): Promise<void> {
871
- await wallet.registerContract({ instance: await getSponsoredFPCInstance(), artifact: SponsoredFPCContract.artifact });
871
+ await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
872
872
  }
873
873
 
874
874
  export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
@@ -43,7 +43,7 @@ export class FeeJuicePortalTestingHarnessFactory {
43
43
  throw new Error('Fee Juice portal not deployed on L1');
44
44
  }
45
45
 
46
- const gasL2 = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
46
+ const gasL2 = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
47
47
 
48
48
  return new GasBridgingTestHarness(
49
49
  aztecNode,
@@ -49,7 +49,7 @@ export async function setupTestAccountsWithTokens(
49
49
 
50
50
  const tokenAdmin = accounts[0];
51
51
  const tokenAddress = await deployTokenAndMint(wallet, accounts, tokenAdmin, mintAmount, undefined, logger);
52
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
52
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
53
53
 
54
54
  return {
55
55
  aztecNode,
@@ -96,7 +96,7 @@ export async function deploySponsoredTestAccounts(
96
96
  new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()),
97
97
  logger,
98
98
  );
99
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
99
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
100
100
 
101
101
  return {
102
102
  aztecNode,
@@ -152,7 +152,7 @@ export async function deployTestAccountsWithTokens(
152
152
  undefined,
153
153
  logger,
154
154
  );
155
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
155
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
156
156
 
157
157
  return {
158
158
  aztecNode,
@@ -228,9 +228,9 @@ async function deployTokenAndMint(
228
228
  logger.verbose(`Minting ${mintAmount} public assets to the ${accounts.length} accounts...`);
229
229
 
230
230
  await Promise.all(
231
- accounts.map(async acc =>
232
- (await TokenContract.at(tokenAddress, wallet)).methods
233
- .mint_to_public(acc, mintAmount)
231
+ accounts.map(acc =>
232
+ TokenContract.at(tokenAddress, wallet)
233
+ .methods.mint_to_public(acc, mintAmount)
234
234
  .send({ from: admin, fee: { paymentMethod } })
235
235
  .wait({ timeout: 600 }),
236
236
  ),
@@ -260,8 +260,8 @@ export async function performTransfers({
260
260
  // Default to sponsored fee payment if no fee method is provided
261
261
  const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
262
262
  for (let i = 0; i < rounds; i++) {
263
- const txs = testAccounts.accounts.map(async acc => {
264
- const token = await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
263
+ const txs = testAccounts.accounts.map(acc => {
264
+ const token = TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
265
265
  return proveInteraction(wallet, token.methods.transfer_in_public(acc, recipient, transferAmount, 0), {
266
266
  from: acc,
267
267
  fee: {