@aztec/end-to-end 0.0.0-test.1 → 0.0.1-fake-ceab37513c

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 (156) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +60 -0
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
  3. package/dest/bench/client_flows/benchmark.js +261 -0
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +69 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
  6. package/dest/bench/client_flows/client_flows_benchmark.js +315 -0
  7. package/dest/bench/client_flows/config.d.ts +14 -0
  8. package/dest/bench/client_flows/config.d.ts.map +1 -0
  9. package/dest/bench/client_flows/config.js +106 -0
  10. package/dest/bench/client_flows/data_extractor.d.ts +2 -0
  11. package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
  12. package/dest/bench/client_flows/data_extractor.js +99 -0
  13. package/dest/bench/utils.d.ts +10 -27
  14. package/dest/bench/utils.d.ts.map +1 -1
  15. package/dest/bench/utils.js +27 -43
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +15 -7
  17. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  18. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +66 -38
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +10 -18
  20. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  21. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +34 -53
  22. package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -2
  23. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  24. package/dest/e2e_deploy_contract/deploy_test.js +9 -6
  25. package/dest/e2e_epochs/epochs_test.d.ts +56 -17
  26. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  27. package/dest/e2e_epochs/epochs_test.js +222 -42
  28. package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
  29. package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
  30. package/dest/e2e_fees/bridging_race.notest.js +60 -0
  31. package/dest/e2e_fees/fees_test.d.ts +16 -5
  32. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  33. package/dest/e2e_fees/fees_test.js +87 -88
  34. package/dest/e2e_l1_publisher/write_json.d.ts +8 -0
  35. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
  36. package/dest/e2e_l1_publisher/write_json.js +57 -0
  37. package/dest/e2e_multi_validator/utils.d.ts +12 -0
  38. package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
  39. package/dest/e2e_multi_validator/utils.js +214 -0
  40. package/dest/e2e_nested_contract/nested_contract_test.d.ts +5 -5
  41. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  42. package/dest/e2e_nested_contract/nested_contract_test.js +19 -14
  43. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  44. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  45. package/dest/e2e_p2p/inactivity_slash_test.js +132 -0
  46. package/dest/e2e_p2p/p2p_network.d.ts +56 -21
  47. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  48. package/dest/e2e_p2p/p2p_network.js +154 -125
  49. package/dest/e2e_p2p/shared.d.ts +41 -3
  50. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  51. package/dest/e2e_p2p/shared.js +146 -6
  52. package/dest/e2e_token_contract/token_contract_test.d.ts +10 -5
  53. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  54. package/dest/e2e_token_contract/token_contract_test.js +51 -24
  55. package/dest/{e2e_prover → fixtures}/e2e_prover_test.d.ts +7 -4
  56. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
  57. package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +67 -62
  58. package/dest/fixtures/fixtures.d.ts +5 -6
  59. package/dest/fixtures/fixtures.d.ts.map +1 -1
  60. package/dest/fixtures/fixtures.js +4 -3
  61. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  62. package/dest/fixtures/get_acvm_config.js +2 -14
  63. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  64. package/dest/fixtures/get_bb_config.js +8 -15
  65. package/dest/fixtures/l1_to_l2_messaging.d.ts +8 -5
  66. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  67. package/dest/fixtures/l1_to_l2_messaging.js +44 -18
  68. package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
  69. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  70. package/dest/fixtures/setup_l1_contracts.js +3 -3
  71. package/dest/fixtures/setup_p2p_test.d.ts +14 -6
  72. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  73. package/dest/fixtures/setup_p2p_test.js +73 -21
  74. package/dest/fixtures/snapshot_manager.d.ts +8 -3
  75. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  76. package/dest/fixtures/snapshot_manager.js +120 -104
  77. package/dest/fixtures/token_utils.d.ts +4 -3
  78. package/dest/fixtures/token_utils.d.ts.map +1 -1
  79. package/dest/fixtures/token_utils.js +24 -7
  80. package/dest/fixtures/utils.d.ts +65 -22
  81. package/dest/fixtures/utils.d.ts.map +1 -1
  82. package/dest/fixtures/utils.js +439 -318
  83. package/dest/fixtures/web3signer.d.ts +5 -0
  84. package/dest/fixtures/web3signer.d.ts.map +1 -0
  85. package/dest/fixtures/web3signer.js +42 -0
  86. package/dest/shared/cross_chain_test_harness.d.ts +28 -18
  87. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  88. package/dest/shared/cross_chain_test_harness.js +97 -41
  89. package/dest/shared/gas_portal_test_harness.d.ts +23 -18
  90. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  91. package/dest/shared/gas_portal_test_harness.js +43 -25
  92. package/dest/shared/submit-transactions.d.ts.map +1 -1
  93. package/dest/shared/uniswap_l1_l2.d.ts +5 -6
  94. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  95. package/dest/shared/uniswap_l1_l2.js +136 -90
  96. package/dest/simulators/lending_simulator.d.ts +5 -6
  97. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  98. package/dest/simulators/lending_simulator.js +11 -15
  99. package/dest/simulators/token_simulator.d.ts +2 -1
  100. package/dest/simulators/token_simulator.d.ts.map +1 -1
  101. package/dest/simulators/token_simulator.js +16 -13
  102. package/dest/spartan/setup_test_wallets.d.ts +8 -1
  103. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  104. package/dest/spartan/setup_test_wallets.js +108 -22
  105. package/dest/spartan/utils.d.ts +60 -307
  106. package/dest/spartan/utils.d.ts.map +1 -1
  107. package/dest/spartan/utils.js +200 -115
  108. package/package.json +60 -56
  109. package/src/bench/client_flows/benchmark.ts +341 -0
  110. package/src/bench/client_flows/client_flows_benchmark.ts +422 -0
  111. package/src/bench/client_flows/config.ts +61 -0
  112. package/src/bench/client_flows/data_extractor.ts +111 -0
  113. package/src/bench/utils.ts +26 -52
  114. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +60 -40
  115. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +47 -75
  116. package/src/e2e_deploy_contract/deploy_test.ts +11 -8
  117. package/src/e2e_epochs/epochs_test.ts +276 -54
  118. package/src/e2e_fees/bridging_race.notest.ts +75 -0
  119. package/src/e2e_fees/fees_test.ts +121 -108
  120. package/src/e2e_l1_publisher/write_json.ts +74 -0
  121. package/src/e2e_multi_validator/utils.ts +258 -0
  122. package/src/e2e_nested_contract/nested_contract_test.ts +22 -14
  123. package/src/e2e_p2p/inactivity_slash_test.ts +174 -0
  124. package/src/e2e_p2p/p2p_network.ts +212 -144
  125. package/src/e2e_p2p/shared.ts +234 -14
  126. package/src/e2e_token_contract/token_contract_test.ts +42 -38
  127. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  128. package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +62 -69
  129. package/src/fixtures/fixtures.ts +4 -3
  130. package/src/fixtures/get_acvm_config.ts +2 -10
  131. package/src/fixtures/get_bb_config.ts +15 -11
  132. package/src/fixtures/l1_to_l2_messaging.ts +53 -23
  133. package/src/fixtures/setup_l1_contracts.ts +5 -6
  134. package/src/fixtures/setup_p2p_test.ts +112 -30
  135. package/src/fixtures/snapshot_manager.ts +150 -102
  136. package/src/fixtures/token_utils.ts +33 -8
  137. package/src/fixtures/utils.ts +530 -352
  138. package/src/fixtures/web3signer.ts +46 -0
  139. package/src/guides/up_quick_start.sh +4 -4
  140. package/src/shared/cross_chain_test_harness.ts +92 -52
  141. package/src/shared/gas_portal_test_harness.ts +47 -31
  142. package/src/shared/uniswap_l1_l2.ts +127 -124
  143. package/src/simulators/lending_simulator.ts +11 -15
  144. package/src/simulators/token_simulator.ts +17 -12
  145. package/src/spartan/DEVELOP.md +116 -0
  146. package/src/spartan/setup_test_wallets.ts +144 -29
  147. package/src/spartan/utils.ts +194 -116
  148. package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
  149. package/dest/sample-dapp/connect.js +0 -12
  150. package/dest/sample-dapp/contracts.js +0 -10
  151. package/dest/sample-dapp/deploy.js +0 -35
  152. package/dest/sample-dapp/index.js +0 -98
  153. package/src/sample-dapp/connect.mjs +0 -16
  154. package/src/sample-dapp/contracts.mjs +0 -14
  155. package/src/sample-dapp/deploy.mjs +0 -40
  156. package/src/sample-dapp/index.mjs +0 -128
@@ -8,39 +8,45 @@ import { type Archiver, createArchiver } from '@aztec/archiver';
8
8
  import {
9
9
  type AccountWalletWithSecretKey,
10
10
  type AztecNode,
11
- type CheatCodes,
12
11
  type CompleteAddress,
13
- type DeployL1ContractsReturnType,
14
12
  EthAddress,
15
13
  type Logger,
16
14
  type PXE,
17
15
  createLogger,
18
- deployL1Contract,
19
16
  } from '@aztec/aztec.js';
20
- import { BBCircuitVerifier, type ClientProtocolCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
17
+ import { CheatCodes } from '@aztec/aztec/testing';
18
+ import {
19
+ BBCircuitVerifier,
20
+ type ClientProtocolCircuitVerifier,
21
+ QueuedIVCVerifier,
22
+ TestCircuitVerifier,
23
+ } from '@aztec/bb-prover';
21
24
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
22
25
  import type { BlobSinkServer } from '@aztec/blob-sink/server';
26
+ import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
23
27
  import { Buffer32 } from '@aztec/foundation/buffer';
24
- import { HonkVerifierAbi, HonkVerifierBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
28
+ import { SecretValue } from '@aztec/foundation/config';
29
+ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
25
30
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
26
31
  import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
27
32
  import type { PXEService } from '@aztec/pxe/server';
33
+ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
28
34
  import { getGenesisValues } from '@aztec/world-state/testing';
29
35
 
30
36
  import { type Hex, getContract } from 'viem';
31
37
  import { privateKeyToAddress } from 'viem/accounts';
32
38
 
33
- import { getACVMConfig } from '../fixtures/get_acvm_config.js';
34
- import { getBBConfig } from '../fixtures/get_bb_config.js';
39
+ import { TokenSimulator } from '../simulators/token_simulator.js';
40
+ import { getACVMConfig } from './get_acvm_config.js';
41
+ import { getBBConfig } from './get_bb_config.js';
35
42
  import {
36
43
  type ISnapshotManager,
37
44
  type SubsystemsContext,
38
45
  createSnapshotManager,
39
46
  deployAccounts,
40
47
  publicDeployAccounts,
41
- } from '../fixtures/snapshot_manager.js';
42
- import { getPrivateKeyFromIndex, setupPXEService } from '../fixtures/utils.js';
43
- import { TokenSimulator } from '../simulators/token_simulator.js';
48
+ } from './snapshot_manager.js';
49
+ import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEService } from './utils.js';
44
50
 
45
51
  const { E2E_DATA_PATH: dataPath } = process.env;
46
52
 
@@ -68,6 +74,7 @@ export class FullProverTest {
68
74
  fakeProofsAsset!: TokenContract;
69
75
  tokenSim!: TokenSimulator;
70
76
  aztecNode!: AztecNode;
77
+ aztecNodeAdmin!: AztecNodeAdmin;
71
78
  pxe!: PXEService;
72
79
  cheatCodes!: CheatCodes;
73
80
  blobSink!: BlobSinkServer;
@@ -93,7 +100,9 @@ export class FullProverTest {
93
100
  `full_prover_integration/${testName}`,
94
101
  dataPath,
95
102
  { startProverNode: true, fundRewardDistributor: true, coinbase },
96
- {},
103
+ {
104
+ realVerifier: realProofs,
105
+ },
97
106
  );
98
107
  }
99
108
 
@@ -122,7 +131,7 @@ export class FullProverTest {
122
131
  // Create the token contract state.
123
132
  // Move this account thing to addAccounts above?
124
133
  this.logger.verbose(`Public deploy accounts...`);
125
- await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2), false);
134
+ await publicDeployAccounts(this.wallets[0], this.accounts.slice(0, 2));
126
135
 
127
136
  this.logger.verbose(`Deploying TokenContract...`);
128
137
  const asset = await TokenContract.deploy(
@@ -132,7 +141,7 @@ export class FullProverTest {
132
141
  FullProverTest.TOKEN_SYMBOL,
133
142
  FullProverTest.TOKEN_DECIMALS,
134
143
  )
135
- .send()
144
+ .send({ from: this.wallets[0].getAddress() })
136
145
  .deployed();
137
146
  this.logger.verbose(`Token deployed to ${asset.address}`);
138
147
 
@@ -146,11 +155,14 @@ export class FullProverTest {
146
155
  this.tokenSim = new TokenSimulator(
147
156
  this.fakeProofsAsset,
148
157
  this.wallets[0],
158
+ this.wallets[0].getAddress(),
149
159
  this.logger,
150
160
  this.accounts.map(a => a.address),
151
161
  );
152
162
 
153
- expect(await this.fakeProofsAsset.methods.get_admin().simulate()).toBe(this.accounts[0].address.toBigInt());
163
+ expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0].address })).toBe(
164
+ this.accounts[0].address.toBigInt(),
165
+ );
154
166
  },
155
167
  );
156
168
  }
@@ -169,6 +181,7 @@ export class FullProverTest {
169
181
  cheatCodes: this.cheatCodes,
170
182
  blobSink: this.blobSink,
171
183
  } = this.context);
184
+ this.aztecNodeAdmin = this.context.aztecNode;
172
185
 
173
186
  const blobSinkClient = createBlobSinkClient({ blobSinkUrl: `http://localhost:${this.blobSink.port}` });
174
187
 
@@ -188,17 +201,18 @@ export class FullProverTest {
188
201
  throw new Error(`Test must be run with BB native configuration`);
189
202
  }
190
203
 
191
- this.circuitProofVerifier = await BBCircuitVerifier.new(bbConfig);
204
+ const verifier = await BBCircuitVerifier.new(bbConfig);
205
+ this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
192
206
 
193
207
  this.logger.debug(`Configuring the node for real proofs...`);
194
- await this.aztecNode.setConfig({
208
+ await this.aztecNodeAdmin.setConfig({
195
209
  realProofs: true,
196
210
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
197
211
  });
198
212
  } else {
199
213
  this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
200
214
  this.circuitProofVerifier = new TestCircuitVerifier();
201
- await this.aztecNode.setConfig({
215
+ await this.aztecNodeAdmin.setConfig({
202
216
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
203
217
  });
204
218
  }
@@ -265,7 +279,7 @@ export class FullProverTest {
265
279
  this.logger.verbose('Starting archiver for new prover node');
266
280
  const archiver = await createArchiver(
267
281
  { ...this.context.aztecNodeConfig, dataDirectory: undefined },
268
- blobSinkClient,
282
+ { blobSinkClient },
269
283
  { blockUntilSync: true },
270
284
  );
271
285
 
@@ -275,25 +289,31 @@ export class FullProverTest {
275
289
  this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
276
290
 
277
291
  this.logger.verbose(`Funding prover node at ${proverNodeSenderAddress}`);
278
- await this.mintL1ERC20(proverNodeSenderAddress, 100_000_000n);
292
+ await this.mintFeeJuice(proverNodeSenderAddress);
279
293
 
280
294
  this.logger.verbose('Starting prover node');
281
295
  const proverConfig: ProverNodeConfig = {
282
296
  ...this.context.aztecNodeConfig,
283
- proverCoordinationNodeUrl: undefined,
297
+ txCollectionNodeRpcUrls: [],
284
298
  dataDirectory: undefined,
285
- proverId: this.proverAddress.toField(),
299
+ proverId: this.proverAddress,
286
300
  realProofs: this.realProofs,
287
301
  proverAgentCount: 2,
288
- publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}`,
302
+ publisherPrivateKeys: [new SecretValue(`0x${proverNodePrivateKey!.toString('hex')}` as const)],
289
303
  proverNodeMaxPendingJobs: 100,
290
304
  proverNodeMaxParallelBlocksPerEpoch: 32,
291
305
  proverNodePollingIntervalMs: 100,
292
- txGatheringTimeoutMs: 60000,
293
306
  txGatheringIntervalMs: 1000,
294
- txGatheringMaxParallelRequests: 100,
307
+ txGatheringBatchSize: 10,
308
+ txGatheringMaxParallelRequestsPerNode: 100,
309
+ txGatheringTimeoutMs: 24_000,
310
+ proverNodeFailedEpochStore: undefined,
311
+ proverNodeEpochProvingDelayMs: undefined,
295
312
  };
296
- const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map(a => a.address));
313
+ const sponsoredFPCAddress = await getSponsoredFPCAddress();
314
+ const { prefilledPublicData } = await getGenesisValues(
315
+ this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
316
+ );
297
317
  this.proverNode = await createProverNode(
298
318
  proverConfig,
299
319
  {
@@ -303,18 +323,19 @@ export class FullProverTest {
303
323
  },
304
324
  { prefilledPublicData },
305
325
  );
306
- this.proverNode.start();
326
+ await this.proverNode.start();
307
327
 
308
328
  this.logger.warn(`Proofs are now enabled`);
309
329
  return this;
310
330
  }
311
331
 
312
- private async mintL1ERC20(recipient: Hex, amount: bigint) {
313
- const erc20Address = this.context.deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress;
314
- const client = this.context.deployL1ContractsValues.walletClient;
315
- const erc20 = getContract({ abi: TestERC20Abi, address: erc20Address.toString(), client });
316
- const hash = await erc20.write.mint([recipient, amount]);
317
- await this.context.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash });
332
+ private async mintFeeJuice(recipient: Hex) {
333
+ const handlerAddress = this.context.deployL1ContractsValues.l1ContractAddresses.feeAssetHandlerAddress!;
334
+ this.logger.verbose(`Minting fee juice to ${recipient} using handler at ${handlerAddress}`);
335
+ const client = this.context.deployL1ContractsValues.l1Client;
336
+ const handler = getContract({ abi: FeeAssetHandlerAbi, address: handlerAddress.toString(), client });
337
+ const hash = await handler.write.mint([recipient]);
338
+ await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
318
339
  }
319
340
 
320
341
  snapshot = <T>(
@@ -346,16 +367,17 @@ export class FullProverTest {
346
367
  const privateAmount = 10000n;
347
368
  const publicAmount = 10000n;
348
369
 
349
- const waitOpts = { proven: false };
350
-
351
370
  this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
352
371
  await asset.methods
353
372
  .mint_to_public(accounts[0].address, privateAmount + publicAmount)
354
- .send()
355
- .wait(waitOpts);
373
+ .send({ from: accounts[0].address })
374
+ .wait();
356
375
 
357
376
  this.logger.verbose(`Transferring ${privateAmount} to private...`);
358
- await asset.methods.transfer_to_private(accounts[0].address, privateAmount).send().wait(waitOpts);
377
+ await asset.methods
378
+ .transfer_to_private(accounts[0].address, privateAmount)
379
+ .send({ from: accounts[0].address })
380
+ .wait();
359
381
 
360
382
  this.logger.verbose(`Minting complete.`);
361
383
 
@@ -369,16 +391,16 @@ export class FullProverTest {
369
391
  } = this;
370
392
  tokenSim.mintPublic(address, amount);
371
393
 
372
- const publicBalance = await asset.methods.balance_of_public(address).simulate();
394
+ const publicBalance = await asset.methods.balance_of_public(address).simulate({ from: address });
373
395
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
374
396
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
375
397
 
376
398
  tokenSim.mintPrivate(address, amount);
377
- const privateBalance = await asset.methods.balance_of_private(address).simulate();
399
+ const privateBalance = await asset.methods.balance_of_private(address).simulate({ from: address });
378
400
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
379
401
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
380
402
 
381
- const totalSupply = await asset.methods.total_supply().simulate();
403
+ const totalSupply = await asset.methods.total_supply().simulate({ from: address });
382
404
  this.logger.verbose(`Total supply: ${totalSupply}`);
383
405
  expect(totalSupply).toEqual(tokenSim.totalSupply);
384
406
 
@@ -386,33 +408,4 @@ export class FullProverTest {
386
408
  },
387
409
  );
388
410
  }
389
-
390
- async deployVerifier() {
391
- if (!this.realProofs) {
392
- return;
393
- }
394
-
395
- if (!this.circuitProofVerifier) {
396
- throw new Error('No verifier');
397
- }
398
-
399
- const { walletClient, publicClient, l1ContractAddresses } = this.context.deployL1ContractsValues;
400
- const rollup = getContract({
401
- abi: RollupAbi,
402
- address: l1ContractAddresses.rollupAddress.toString(),
403
- client: walletClient,
404
- });
405
-
406
- const { address: verifierAddress } = await deployL1Contract(
407
- walletClient,
408
- publicClient,
409
- HonkVerifierAbi,
410
- HonkVerifierBytecode,
411
- );
412
- this.logger.info(`Deployed honk verifier at ${verifierAddress}`);
413
-
414
- await rollup.write.setEpochVerifier([verifierAddress.toString()]);
415
-
416
- this.logger.info('Rollup only accepts valid proofs now');
417
- }
418
411
  }
@@ -8,17 +8,18 @@ export const shouldCollectMetrics = () => {
8
8
  };
9
9
 
10
10
  export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
11
+ export const TEST_MAX_TX_POOL_SIZE = 2 * 1024 * 1024 * 1024; // 2GB
11
12
 
12
13
  export const MNEMONIC = 'test test test test test test test test test test test junk';
13
14
  export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
14
15
  export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
15
16
 
16
17
  /// Common errors
17
- export const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with overflow 'self - other'";
18
- export const U128_OVERFLOW_ERROR = "Assertion failed: attempt to add with overflow 'self + other'";
18
+ export const U128_UNDERFLOW_ERROR = 'Assertion failed: attempt to subtract with overflow';
19
+ export const U128_OVERFLOW_ERROR = 'Assertion failed: attempt to add with overflow';
19
20
  export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_size 'self.__assert_max_bit_size'";
20
21
  // TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): Make these a fixed error after transition.
21
- export const DUPLICATE_NULLIFIER_ERROR = /dropped|duplicate nullifier|reverted|Nullifier collision/;
22
+ export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
22
23
  export const NO_L1_TO_L2_MSG_ERROR =
23
24
  /No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/;
24
25
  export const STATIC_CALL_STATE_MODIFICATION_ERROR =
@@ -1,6 +1,7 @@
1
1
  import type { Logger } from '@aztec/aztec.js';
2
2
  import { parseBooleanEnv } from '@aztec/foundation/config';
3
3
  import { randomBytes } from '@aztec/foundation/crypto';
4
+ import { tryRmDir } from '@aztec/foundation/fs';
4
5
 
5
6
  import { promises as fs } from 'fs';
6
7
 
@@ -36,16 +37,7 @@ export async function getACVMConfig(logger: Logger): Promise<
36
37
 
37
38
  const directoryToCleanup = ACVM_WORKING_DIRECTORY ? undefined : tempWorkingDirectory;
38
39
 
39
- const cleanup = async () => {
40
- if (directoryToCleanup) {
41
- try {
42
- logger.info(`Cleaning up ACVM temp directory ${directoryToCleanup}`);
43
- await fs.rm(directoryToCleanup, { recursive: true, force: true, maxRetries: 3 });
44
- } catch (err) {
45
- logger.warn(`Failed to delete ACVM temp directory at ${directoryToCleanup}: ${err}`);
46
- }
47
- }
48
- };
40
+ const cleanup = () => tryRmDir(directoryToCleanup, logger);
49
41
 
50
42
  return {
51
43
  acvmWorkingDirectory,
@@ -1,5 +1,6 @@
1
1
  import { type Logger, fileURLToPath } from '@aztec/aztec.js';
2
2
  import type { BBConfig } from '@aztec/bb-prover';
3
+ import { tryRmDir } from '@aztec/foundation/fs';
3
4
 
4
5
  import fs from 'node:fs/promises';
5
6
  import { tmpdir } from 'node:os';
@@ -11,6 +12,8 @@ const {
11
12
  BB_SKIP_CLEANUP = '',
12
13
  TEMP_DIR = tmpdir(),
13
14
  BB_WORKING_DIRECTORY = '',
15
+ BB_NUM_IVC_VERIFIERS = '1',
16
+ BB_IVC_CONCURRENCY = '1',
14
17
  } = process.env;
15
18
 
16
19
  export const getBBConfig = async (
@@ -35,18 +38,19 @@ export const getBBConfig = async (
35
38
  await fs.mkdir(bbWorkingDirectory, { recursive: true });
36
39
 
37
40
  const bbSkipCleanup = ['1', 'true'].includes(BB_SKIP_CLEANUP);
38
-
39
- const cleanup = async () => {
40
- if (directoryToCleanup && !bbSkipCleanup) {
41
- try {
42
- await fs.rm(directoryToCleanup, { recursive: true, force: true, maxRetries: 3 });
43
- } catch (err) {
44
- logger.warn(`Failed to delete bb working directory at ${directoryToCleanup}: ${err}`);
45
- }
46
- }
41
+ const cleanup = bbSkipCleanup ? () => Promise.resolve() : () => tryRmDir(directoryToCleanup);
42
+
43
+ const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
44
+ const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
45
+
46
+ return {
47
+ bbSkipCleanup,
48
+ bbBinaryPath,
49
+ bbWorkingDirectory,
50
+ cleanup,
51
+ numConcurrentIVCVerifiers: numIvcVerifiers,
52
+ bbIVCConcurrency: ivcConcurrency,
47
53
  };
48
-
49
- return { bbSkipCleanup, bbBinaryPath, bbWorkingDirectory, cleanup };
50
54
  } catch (err) {
51
55
  logger.error(`Native BB not available, error: ${err}`);
52
56
  return undefined;
@@ -1,50 +1,80 @@
1
- import type { L1ContractAddresses, ViemPublicClient, ViemWalletClient } from '@aztec/ethereum';
1
+ import { type ExtendedViemWalletClient, type L1ContractAddresses, RollupContract } from '@aztec/ethereum';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
+ import { tryJsonStringify } from '@aztec/foundation/json-rpc';
3
4
  import { InboxAbi } from '@aztec/l1-artifacts';
4
5
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
6
 
6
- import { expect } from '@jest/globals';
7
7
  import { decodeEventLog, getContract } from 'viem';
8
8
 
9
+ import { getLogger } from './utils.js';
10
+
9
11
  export async function sendL1ToL2Message(
10
12
  message: { recipient: AztecAddress; content: Fr; secretHash: Fr },
11
13
  ctx: {
12
- walletClient: ViemWalletClient;
13
- publicClient: ViemPublicClient;
14
- l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress'>;
14
+ l1Client: ExtendedViemWalletClient;
15
+ l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress' | 'rollupAddress'>;
15
16
  },
16
17
  ) {
18
+ const logger = getLogger();
17
19
  const inbox = getContract({
18
20
  address: ctx.l1ContractAddresses.inboxAddress.toString(),
19
21
  abi: InboxAbi,
20
- client: ctx.walletClient,
22
+ client: ctx.l1Client,
21
23
  });
22
24
 
23
25
  const { recipient, content, secretHash } = message;
24
- const version = 1;
26
+
27
+ const version = await new RollupContract(ctx.l1Client, ctx.l1ContractAddresses.rollupAddress.toString()).getVersion();
25
28
 
26
29
  // We inject the message to Inbox
27
- const txHash = await inbox.write.sendL2Message([
28
- { actor: recipient.toString(), version: BigInt(version) },
29
- content.toString(),
30
- secretHash.toString(),
31
- ]);
30
+ const txHash = await inbox.write.sendL2Message(
31
+ [{ actor: recipient.toString(), version: BigInt(version) }, content.toString(), secretHash.toString()],
32
+ {
33
+ gas: 1_000_000n,
34
+ },
35
+ );
36
+ logger.info(`L1 to L2 message sent in tx ${txHash}`);
32
37
 
33
38
  // We check that the message was correctly injected by checking the emitted event
34
- const txReceipt = await ctx.publicClient.waitForTransactionReceipt({ hash: txHash });
39
+ const txReceipt = await ctx.l1Client.waitForTransactionReceipt({ hash: txHash });
35
40
 
36
- // Exactly 1 event should be emitted in the transaction
37
- expect(txReceipt.logs.length).toBe(1);
41
+ if (txReceipt.status !== 'success') {
42
+ throw new Error(`L1 to L2 message failed to be sent in tx ${txHash}. Status: ${txReceipt.status}`);
43
+ }
38
44
 
39
- // We decode the event and get leaf out of it
40
- const messageSentLog = txReceipt.logs[0];
41
- const topics = decodeEventLog({
42
- abi: InboxAbi,
43
- data: messageSentLog.data,
44
- topics: messageSentLog.topics,
45
- });
45
+ logger.info(`L1 to L2 message receipt retrieved for tx ${txReceipt.transactionHash}`, txReceipt);
46
+
47
+ if (txReceipt.transactionHash !== txHash) {
48
+ throw new Error(`Receipt transaction hash mismatch: ${txReceipt.transactionHash} !== ${txHash}`);
49
+ }
50
+
51
+ // Filter for MessageSent events from the Inbox contract by trying to decode each log
52
+ const messageSentLogs = txReceipt.logs
53
+ .filter(log => log.address.toLowerCase() === ctx.l1ContractAddresses.inboxAddress.toString().toLowerCase())
54
+ .map(log => {
55
+ try {
56
+ const decoded = decodeEventLog({
57
+ abi: InboxAbi,
58
+ data: log.data,
59
+ topics: log.topics,
60
+ });
61
+ return { log, decoded };
62
+ } catch {
63
+ return null; // Not a decodable event from this ABI
64
+ }
65
+ })
66
+ .filter((item): item is { log: any; decoded: any } => item !== null && item.decoded.eventName === 'MessageSent');
67
+
68
+ if (messageSentLogs.length !== 1) {
69
+ throw new Error(
70
+ `Wrong number of MessageSent logs found in ${txHash} transaction (got ${messageSentLogs.length} expected 1)\n${tryJsonStringify(messageSentLogs.map(item => item.log))}`,
71
+ );
72
+ }
73
+
74
+ // We already have the decoded event
75
+ const topics = messageSentLogs[0].decoded;
46
76
  const receivedMsgHash = topics.args.hash;
47
77
  const receivedGlobalLeafIndex = topics.args.index;
48
78
 
49
- return [Fr.fromHexString(receivedMsgHash), new Fr(receivedGlobalLeafIndex)];
79
+ return { msgHash: Fr.fromHexString(receivedMsgHash), globalLeafIndex: new Fr(receivedGlobalLeafIndex), txReceipt };
50
80
  }
@@ -1,7 +1,7 @@
1
- import { type Logger, deployL1Contracts } from '@aztec/aztec.js';
2
- import type { DeployL1ContractsArgs, L1ContractsConfig } from '@aztec/ethereum';
1
+ import type { Logger } from '@aztec/aztec.js';
2
+ import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum';
3
3
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
4
- import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
4
+ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
5
5
 
6
6
  import type { HDAccount, PrivateKeyAccount } from 'viem';
7
7
  import { foundry } from 'viem/chains';
@@ -12,14 +12,13 @@ export const setupL1Contracts = async (
12
12
  l1RpcUrl: string,
13
13
  account: HDAccount | PrivateKeyAccount,
14
14
  logger: Logger,
15
- args: Pick<DeployL1ContractsArgs, 'genesisArchiveRoot' | 'genesisBlockHash' | 'initialValidators'> &
16
- L1ContractsConfig,
15
+ args: Pick<DeployL1ContractsArgs, 'genesisArchiveRoot' | 'initialValidators'> & L1ContractsConfig,
17
16
  ) => {
18
17
  const l1Data = await deployL1Contracts([l1RpcUrl], account, foundry, logger, {
19
- l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(),
20
18
  vkTreeRoot: getVKTreeRoot(),
21
19
  protocolContractTreeRoot,
22
20
  salt: undefined,
21
+ realVerifier: false,
23
22
  ...args,
24
23
  });
25
24