@aztec/end-to-end 0.0.1-commit.3469e52 → 0.0.1-commit.54489865

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 (127) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +28 -13
  4. package/dest/bench/utils.d.ts +5 -4
  5. package/dest/bench/utils.d.ts.map +1 -1
  6. package/dest/bench/utils.js +9 -7
  7. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
  8. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  9. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +7 -8
  10. package/dest/e2e_epochs/epochs_test.d.ts +7 -1
  11. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  12. package/dest/e2e_epochs/epochs_test.js +29 -7
  13. package/dest/e2e_fees/bridging_race.notest.js +1 -1
  14. package/dest/e2e_fees/fees_test.d.ts +1 -1
  15. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  16. package/dest/e2e_fees/fees_test.js +6 -6
  17. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  18. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  19. package/dest/e2e_l1_publisher/write_json.js +1 -7
  20. package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
  21. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  22. package/dest/e2e_nested_contract/nested_contract_test.js +2 -2
  23. package/dest/e2e_p2p/p2p_network.d.ts +1 -1
  24. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  25. package/dest/e2e_p2p/p2p_network.js +6 -2
  26. package/dest/e2e_p2p/shared.d.ts +6 -6
  27. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  28. package/dest/e2e_p2p/shared.js +9 -16
  29. package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
  30. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  31. package/dest/e2e_token_contract/token_contract_test.js +3 -3
  32. package/dest/fixtures/e2e_prover_test.d.ts +1 -1
  33. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  34. package/dest/fixtures/e2e_prover_test.js +8 -5
  35. package/dest/fixtures/setup.d.ts +5 -3
  36. package/dest/fixtures/setup.d.ts.map +1 -1
  37. package/dest/fixtures/setup.js +31 -20
  38. package/dest/fixtures/setup_p2p_test.d.ts +4 -5
  39. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  40. package/dest/fixtures/setup_p2p_test.js +24 -19
  41. package/dest/fixtures/token_utils.d.ts +1 -1
  42. package/dest/fixtures/token_utils.d.ts.map +1 -1
  43. package/dest/fixtures/token_utils.js +7 -4
  44. package/dest/shared/cross_chain_test_harness.d.ts +3 -4
  45. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  46. package/dest/shared/cross_chain_test_harness.js +11 -11
  47. package/dest/shared/gas_portal_test_harness.js +1 -1
  48. package/dest/shared/submit-transactions.d.ts +3 -3
  49. package/dest/shared/submit-transactions.d.ts.map +1 -1
  50. package/dest/shared/submit-transactions.js +9 -11
  51. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  52. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  53. package/dest/shared/uniswap_l1_l2.js +12 -12
  54. package/dest/simulators/lending_simulator.js +2 -2
  55. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  56. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  57. package/dest/spartan/setup_test_wallets.js +61 -34
  58. package/dest/spartan/tx_metrics.d.ts +38 -2
  59. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  60. package/dest/spartan/tx_metrics.js +178 -4
  61. package/dest/spartan/utils/bot.d.ts +27 -0
  62. package/dest/spartan/utils/bot.d.ts.map +1 -0
  63. package/dest/spartan/utils/bot.js +141 -0
  64. package/dest/spartan/utils/chaos.d.ts +79 -0
  65. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  66. package/dest/spartan/utils/chaos.js +142 -0
  67. package/dest/spartan/utils/clients.d.ts +39 -0
  68. package/dest/spartan/utils/clients.d.ts.map +1 -0
  69. package/dest/spartan/utils/clients.js +90 -0
  70. package/dest/spartan/utils/config.d.ts +36 -0
  71. package/dest/spartan/utils/config.d.ts.map +1 -0
  72. package/dest/spartan/utils/config.js +20 -0
  73. package/dest/spartan/utils/health.d.ts +63 -0
  74. package/dest/spartan/utils/health.d.ts.map +1 -0
  75. package/dest/spartan/utils/health.js +202 -0
  76. package/dest/spartan/utils/helm.d.ts +15 -0
  77. package/dest/spartan/utils/helm.d.ts.map +1 -0
  78. package/dest/spartan/utils/helm.js +47 -0
  79. package/dest/spartan/utils/index.d.ts +9 -0
  80. package/dest/spartan/utils/index.d.ts.map +1 -0
  81. package/dest/spartan/utils/index.js +18 -0
  82. package/dest/spartan/utils/k8s.d.ts +126 -0
  83. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  84. package/dest/spartan/utils/k8s.js +375 -0
  85. package/dest/spartan/utils/nodes.d.ts +41 -0
  86. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  87. package/dest/spartan/utils/nodes.js +455 -0
  88. package/dest/spartan/utils/scripts.d.ts +16 -0
  89. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  90. package/dest/spartan/utils/scripts.js +66 -0
  91. package/dest/spartan/utils.d.ts +2 -260
  92. package/dest/spartan/utils.d.ts.map +1 -1
  93. package/dest/spartan/utils.js +1 -942
  94. package/package.json +39 -39
  95. package/src/bench/client_flows/client_flows_benchmark.ts +11 -24
  96. package/src/bench/utils.ts +9 -7
  97. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +9 -12
  98. package/src/e2e_epochs/epochs_test.ts +58 -32
  99. package/src/e2e_fees/bridging_race.notest.ts +1 -4
  100. package/src/e2e_fees/fees_test.ts +10 -14
  101. package/src/e2e_l1_publisher/write_json.ts +3 -8
  102. package/src/e2e_nested_contract/nested_contract_test.ts +2 -4
  103. package/src/e2e_p2p/p2p_network.ts +15 -9
  104. package/src/e2e_p2p/shared.ts +20 -22
  105. package/src/e2e_token_contract/token_contract_test.ts +3 -5
  106. package/src/fixtures/e2e_prover_test.ts +4 -9
  107. package/src/fixtures/setup.ts +33 -26
  108. package/src/fixtures/setup_p2p_test.ts +15 -20
  109. package/src/fixtures/token_utils.ts +6 -5
  110. package/src/shared/cross_chain_test_harness.ts +13 -27
  111. package/src/shared/gas_portal_test_harness.ts +1 -1
  112. package/src/shared/submit-transactions.ts +9 -15
  113. package/src/shared/uniswap_l1_l2.ts +12 -19
  114. package/src/simulators/lending_simulator.ts +2 -2
  115. package/src/spartan/setup_test_wallets.ts +72 -24
  116. package/src/spartan/tx_metrics.ts +152 -7
  117. package/src/spartan/utils/bot.ts +185 -0
  118. package/src/spartan/utils/chaos.ts +253 -0
  119. package/src/spartan/utils/clients.ts +100 -0
  120. package/src/spartan/utils/config.ts +26 -0
  121. package/src/spartan/utils/health.ts +255 -0
  122. package/src/spartan/utils/helm.ts +84 -0
  123. package/src/spartan/utils/index.ts +64 -0
  124. package/src/spartan/utils/k8s.ts +527 -0
  125. package/src/spartan/utils/nodes.ts +535 -0
  126. package/src/spartan/utils/scripts.ts +63 -0
  127. package/src/spartan/utils.ts +1 -1246
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.1-commit.3469e52",
3
+ "version": "0.0.1-commit.54489865",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -25,44 +25,44 @@
25
25
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
26
26
  },
27
27
  "dependencies": {
28
- "@aztec/accounts": "0.0.1-commit.3469e52",
29
- "@aztec/archiver": "0.0.1-commit.3469e52",
30
- "@aztec/aztec": "0.0.1-commit.3469e52",
31
- "@aztec/aztec-node": "0.0.1-commit.3469e52",
32
- "@aztec/aztec.js": "0.0.1-commit.3469e52",
33
- "@aztec/bb-prover": "0.0.1-commit.3469e52",
34
- "@aztec/bb.js": "0.0.1-commit.3469e52",
35
- "@aztec/blob-client": "0.0.1-commit.3469e52",
36
- "@aztec/blob-lib": "0.0.1-commit.3469e52",
37
- "@aztec/bot": "0.0.1-commit.3469e52",
38
- "@aztec/cli": "0.0.1-commit.3469e52",
39
- "@aztec/constants": "0.0.1-commit.3469e52",
40
- "@aztec/entrypoints": "0.0.1-commit.3469e52",
41
- "@aztec/epoch-cache": "0.0.1-commit.3469e52",
42
- "@aztec/ethereum": "0.0.1-commit.3469e52",
43
- "@aztec/foundation": "0.0.1-commit.3469e52",
44
- "@aztec/kv-store": "0.0.1-commit.3469e52",
45
- "@aztec/l1-artifacts": "0.0.1-commit.3469e52",
46
- "@aztec/merkle-tree": "0.0.1-commit.3469e52",
47
- "@aztec/node-keystore": "0.0.1-commit.3469e52",
48
- "@aztec/noir-contracts.js": "0.0.1-commit.3469e52",
49
- "@aztec/noir-noirc_abi": "0.0.1-commit.3469e52",
50
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.3469e52",
51
- "@aztec/noir-test-contracts.js": "0.0.1-commit.3469e52",
52
- "@aztec/p2p": "0.0.1-commit.3469e52",
53
- "@aztec/protocol-contracts": "0.0.1-commit.3469e52",
54
- "@aztec/prover-client": "0.0.1-commit.3469e52",
55
- "@aztec/prover-node": "0.0.1-commit.3469e52",
56
- "@aztec/pxe": "0.0.1-commit.3469e52",
57
- "@aztec/sequencer-client": "0.0.1-commit.3469e52",
58
- "@aztec/simulator": "0.0.1-commit.3469e52",
59
- "@aztec/slasher": "0.0.1-commit.3469e52",
60
- "@aztec/stdlib": "0.0.1-commit.3469e52",
61
- "@aztec/telemetry-client": "0.0.1-commit.3469e52",
62
- "@aztec/test-wallet": "0.0.1-commit.3469e52",
63
- "@aztec/validator-client": "0.0.1-commit.3469e52",
64
- "@aztec/validator-ha-signer": "0.0.1-commit.3469e52",
65
- "@aztec/world-state": "0.0.1-commit.3469e52",
28
+ "@aztec/accounts": "0.0.1-commit.54489865",
29
+ "@aztec/archiver": "0.0.1-commit.54489865",
30
+ "@aztec/aztec": "0.0.1-commit.54489865",
31
+ "@aztec/aztec-node": "0.0.1-commit.54489865",
32
+ "@aztec/aztec.js": "0.0.1-commit.54489865",
33
+ "@aztec/bb-prover": "0.0.1-commit.54489865",
34
+ "@aztec/bb.js": "0.0.1-commit.54489865",
35
+ "@aztec/blob-client": "0.0.1-commit.54489865",
36
+ "@aztec/blob-lib": "0.0.1-commit.54489865",
37
+ "@aztec/bot": "0.0.1-commit.54489865",
38
+ "@aztec/cli": "0.0.1-commit.54489865",
39
+ "@aztec/constants": "0.0.1-commit.54489865",
40
+ "@aztec/entrypoints": "0.0.1-commit.54489865",
41
+ "@aztec/epoch-cache": "0.0.1-commit.54489865",
42
+ "@aztec/ethereum": "0.0.1-commit.54489865",
43
+ "@aztec/foundation": "0.0.1-commit.54489865",
44
+ "@aztec/kv-store": "0.0.1-commit.54489865",
45
+ "@aztec/l1-artifacts": "0.0.1-commit.54489865",
46
+ "@aztec/merkle-tree": "0.0.1-commit.54489865",
47
+ "@aztec/node-keystore": "0.0.1-commit.54489865",
48
+ "@aztec/noir-contracts.js": "0.0.1-commit.54489865",
49
+ "@aztec/noir-noirc_abi": "0.0.1-commit.54489865",
50
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.54489865",
51
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.54489865",
52
+ "@aztec/p2p": "0.0.1-commit.54489865",
53
+ "@aztec/protocol-contracts": "0.0.1-commit.54489865",
54
+ "@aztec/prover-client": "0.0.1-commit.54489865",
55
+ "@aztec/prover-node": "0.0.1-commit.54489865",
56
+ "@aztec/pxe": "0.0.1-commit.54489865",
57
+ "@aztec/sequencer-client": "0.0.1-commit.54489865",
58
+ "@aztec/simulator": "0.0.1-commit.54489865",
59
+ "@aztec/slasher": "0.0.1-commit.54489865",
60
+ "@aztec/stdlib": "0.0.1-commit.54489865",
61
+ "@aztec/telemetry-client": "0.0.1-commit.54489865",
62
+ "@aztec/test-wallet": "0.0.1-commit.54489865",
63
+ "@aztec/validator-client": "0.0.1-commit.54489865",
64
+ "@aztec/validator-ha-signer": "0.0.1-commit.54489865",
65
+ "@aztec/world-state": "0.0.1-commit.54489865",
66
66
  "@iarna/toml": "^2.2.5",
67
67
  "@jest/globals": "^30.0.0",
68
68
  "@noble/curves": "=1.0.0",
@@ -156,8 +156,7 @@ export class ClientFlowsBenchmark {
156
156
  const { claimSecret: secret, messageLeafIndex: index } = claim;
157
157
  await this.feeJuiceContract.methods
158
158
  .claim(address, claim.claimAmount, secret, index)
159
- .send({ from: this.adminAddress })
160
- .wait();
159
+ .send({ from: this.adminAddress });
161
160
  }
162
161
 
163
162
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
@@ -252,9 +251,7 @@ export class ClientFlowsBenchmark {
252
251
  'BC',
253
252
  'BC',
254
253
  18n,
255
- )
256
- .send({ from: this.adminAddress })
257
- .wait();
254
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
258
255
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
259
256
  this.bananaCoin = bananaCoin;
260
257
  this.bananaCoinInstance = bananaCoinInstance;
@@ -268,9 +265,7 @@ export class ClientFlowsBenchmark {
268
265
  'CBC',
269
266
  'CBC',
270
267
  18n,
271
- )
272
- .send({ from: this.adminAddress })
273
- .wait();
268
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
274
269
  this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
275
270
  this.candyBarCoin = candyBarCoin;
276
271
  this.candyBarCoinInstance = candyBarCoinInstance;
@@ -286,9 +281,7 @@ export class ClientFlowsBenchmark {
286
281
  this.adminWallet,
287
282
  bananaCoin.address,
288
283
  this.adminAddress,
289
- )
290
- .send({ from: this.adminAddress })
291
- .wait();
284
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
292
285
 
293
286
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
294
287
 
@@ -336,12 +329,10 @@ export class ClientFlowsBenchmark {
336
329
  const benchysAddress = benchysAccountManager.address;
337
330
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
338
331
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
339
- await behchysDeployMethod
340
- .send({
341
- from: AztecAddress.ZERO,
342
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
343
- })
344
- .wait();
332
+ await behchysDeployMethod.send({
333
+ from: AztecAddress.ZERO,
334
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
335
+ });
345
336
  // Register benchy on the user's Wallet, where we're going to be interacting from
346
337
  const accountManager = await this.userWallet.createAccount({
347
338
  secret: benchysAccount.getSecretKey(),
@@ -359,19 +350,15 @@ export class ClientFlowsBenchmark {
359
350
  'LPT',
360
351
  'LPT',
361
352
  18n,
362
- )
363
- .send({ from: this.adminAddress })
364
- .wait();
353
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
365
354
  const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
366
355
  this.adminWallet,
367
356
  this.bananaCoin.address,
368
357
  this.candyBarCoin.address,
369
358
  liquidityToken.address,
370
- )
371
- .send({ from: this.adminAddress })
372
- .wait();
359
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
373
360
  this.logger.info(`AMM deployed at ${amm.address}`);
374
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
361
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
375
362
  this.liquidityToken = liquidityToken;
376
363
  this.liquidityTokenInstance = liquidityTokenInstance;
377
364
  this.amm = amm;
@@ -1,8 +1,10 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { AztecAddress } from '@aztec/aztec.js/addresses';
3
- import { BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js/contracts';
3
+ import { BatchCall, NO_WAIT, type WaitOpts } from '@aztec/aztec.js/contracts';
4
+ import { waitForTx } from '@aztec/aztec.js/node';
4
5
  import { mean, stdDev, times } from '@aztec/foundation/collection';
5
6
  import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
7
+ import type { TxHash } from '@aztec/stdlib/tx';
6
8
  import type { MetricDefinition } from '@aztec/telemetry-client';
7
9
  import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
8
10
 
@@ -23,7 +25,7 @@ export async function benchmarkSetup(
23
25
  ) {
24
26
  const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
25
27
  const defaultAccountAddress = context.accounts[0];
26
- const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress }).deployed();
28
+ const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
27
29
  context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
28
30
  const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
29
31
  const telemetry = context.telemetryClient! as BenchmarkTelemetryClient;
@@ -142,18 +144,18 @@ export async function sendTxs(
142
144
  context: EndToEndContext,
143
145
  contract: BenchmarkingContract,
144
146
  heavyPublicCompute: boolean = false,
145
- ): Promise<SentTx[]> {
147
+ ): Promise<TxHash[]> {
146
148
  const calls = await Promise.all(times(txCount, index => makeCall(index, context, contract, heavyPublicCompute)));
147
149
  context.logger.info(`Creating ${txCount} txs`);
148
150
  const [from] = context.accounts;
149
151
  context.logger.info(`Sending ${txCount} txs`);
150
- return calls.map(call => call.send({ from }));
152
+ return Promise.all(calls.map(call => call.send({ from, wait: NO_WAIT })));
151
153
  }
152
154
 
153
- export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
155
+ export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
154
156
  context.logger.info(`Awaiting ${txs.length} txs to be mined`);
155
- await Promise.all(txs.map(tx => tx.wait(txWaitOpts)));
156
- context.logger.info(`All ${txs.length} txs have been mined`);
157
+ await Promise.all(txs.map(txHash => waitForTx(context.aztecNode, txHash, txWaitOpts)));
158
+ context.logger.info(`${txs.length} txs have been mined`);
157
159
  }
158
160
 
159
161
  function randomBytesAsBigInts(length: number): bigint[] {
@@ -105,13 +105,13 @@ export class BlacklistTokenContractTest {
105
105
  await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
106
106
 
107
107
  this.logger.verbose(`Deploying TokenContract...`);
108
- this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress)
109
- .send({ from: this.adminAddress })
110
- .deployed();
108
+ this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
109
+ from: this.adminAddress,
110
+ });
111
111
  this.logger.verbose(`Token deployed to ${this.asset.address}`);
112
112
 
113
113
  this.logger.verbose(`Deploying bad account...`);
114
- this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
114
+ this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
115
115
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
116
116
 
117
117
  await this.crossTimestampOfChange();
@@ -171,14 +171,12 @@ export class BlacklistTokenContractTest {
171
171
  const adminMinterRole = new Role().withAdmin().withMinter();
172
172
  await this.asset.methods
173
173
  .update_roles(this.adminAddress, adminMinterRole.toNoirStruct())
174
- .send({ from: this.adminAddress })
175
- .wait();
174
+ .send({ from: this.adminAddress });
176
175
 
177
176
  const blacklistRole = new Role().withBlacklisted();
178
177
  await this.asset.methods
179
178
  .update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct())
180
- .send({ from: this.adminAddress })
181
- .wait();
179
+ .send({ from: this.adminAddress });
182
180
 
183
181
  await this.crossTimestampOfChange();
184
182
 
@@ -187,16 +185,15 @@ export class BlacklistTokenContractTest {
187
185
  );
188
186
 
189
187
  this.logger.verbose(`Minting ${amount} publicly...`);
190
- await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress }).wait();
188
+ await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
191
189
 
192
190
  this.logger.verbose(`Minting ${amount} privately...`);
193
191
  const secret = Fr.random();
194
192
  const secretHash = await computeSecretHash(secret);
195
- const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress }).wait();
193
+ const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
196
194
 
197
195
  await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
198
- const txClaim = asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
199
- await txClaim.wait();
196
+ await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
200
197
  this.logger.verbose(`Minting complete.`);
201
198
 
202
199
  tokenSim.mintPublic(this.adminAddress, amount);
@@ -14,13 +14,15 @@ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
14
14
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
15
15
  import { SecretValue } from '@aztec/foundation/config';
16
16
  import { randomBytes } from '@aztec/foundation/crypto/random';
17
- import { withLogNameSuffix } from '@aztec/foundation/log';
17
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
18
18
  import { retryUntil } from '@aztec/foundation/retry';
19
19
  import { sleep } from '@aztec/foundation/sleep';
20
20
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
21
+ import { TestContract } from '@aztec/noir-test-contracts.js/Test';
21
22
  import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
22
23
  import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
23
24
  import type { TestProverNode } from '@aztec/prover-node/test';
25
+ import type { PXEConfig } from '@aztec/pxe/config';
24
26
  import {
25
27
  type SequencerClient,
26
28
  type SequencerEvents,
@@ -49,7 +51,11 @@ export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
49
51
  export const ARCHIVER_POLL_INTERVAL = 50;
50
52
  export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
51
53
 
52
- export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
54
+ export type EpochsTestOpts = Partial<SetupOptions> & {
55
+ numberOfAccounts?: number;
56
+ pxeOpts?: Partial<PXEConfig>;
57
+ aztecSlotDurationInL1Slots?: number;
58
+ };
53
59
 
54
60
  export type TrackedSequencerEvent = {
55
61
  [K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
@@ -94,7 +100,7 @@ export class EpochsTestContext {
94
100
  ? parseInt(process.env.L1_BLOCK_TIME)
95
101
  : DEFAULT_L1_BLOCK_TIME;
96
102
  const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
97
- const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
103
+ const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
98
104
  const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
99
105
  const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
100
106
  const l1PublishingTime = opts.l1PublishingTime ?? 1;
@@ -121,30 +127,36 @@ export class EpochsTestContext {
121
127
 
122
128
  // Set up system without any account nor protocol contracts
123
129
  // and with faster block times and shorter epochs.
124
- const context = await setup(opts.numberOfAccounts ?? 0, {
125
- automineL1Setup: true,
126
- checkIntervalMs: 50,
127
- archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
128
- worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
129
- aztecEpochDuration,
130
- aztecSlotDuration,
131
- ethereumSlotDuration,
132
- aztecProofSubmissionEpochs,
133
- aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
134
- minTxsPerBlock: 0,
135
- realProofs: false,
136
- startProverNode: true,
137
- proverTestDelayMs: opts.proverTestDelayMs ?? 0,
138
- // We use numeric incremental prover ids for simplicity, but we can switch to
139
- // using the prover's eth address if the proverId is used for something in the rollup contract
140
- // Use numeric EthAddress for deterministic prover id
141
- proverId: EthAddress.fromNumber(1),
142
- worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
143
- exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
144
- slasherFlavor: 'none',
145
- l1PublishingTime,
146
- ...opts,
147
- });
130
+ const context = await setup(
131
+ opts.numberOfAccounts ?? 0,
132
+ {
133
+ automineL1Setup: true,
134
+ checkIntervalMs: 50,
135
+ archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
136
+ worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
137
+ aztecEpochDuration,
138
+ aztecSlotDuration,
139
+ ethereumSlotDuration,
140
+ aztecProofSubmissionEpochs,
141
+ aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
142
+ minTxsPerBlock: 0,
143
+ realProofs: false,
144
+ startProverNode: true,
145
+ proverTestDelayMs: opts.proverTestDelayMs ?? 0,
146
+ // We use numeric incremental prover ids for simplicity, but we can switch to
147
+ // using the prover's eth address if the proverId is used for something in the rollup contract
148
+ // Use numeric EthAddress for deterministic prover id
149
+ proverId: EthAddress.fromNumber(1),
150
+ worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
151
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
152
+ slasherFlavor: 'none',
153
+ l1PublishingTime,
154
+ ...opts,
155
+ },
156
+ // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
157
+ // Can be overridden via opts.pxeOpts.
158
+ { syncChainTip: 'checkpointed', ...opts.pxeOpts },
159
+ );
148
160
 
149
161
  this.context = context;
150
162
  this.proverNodes = context.proverNode ? [context.proverNode] : [];
@@ -199,14 +211,14 @@ export class EpochsTestContext {
199
211
  public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
200
212
  this.logger.warn('Creating and syncing a simulated prover node...');
201
213
  const proverNodePrivateKey = this.getNextPrivateKey();
202
- const suffix = (this.proverNodes.length + 1).toString();
203
- const proverNode = await withLogNameSuffix(suffix, () =>
214
+ const proverIndex = this.proverNodes.length + 1;
215
+ const proverNode = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
204
216
  createAndSyncProverNode(
205
217
  proverNodePrivateKey,
206
218
  { ...this.context.config },
207
219
  {
208
220
  dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
209
- proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
221
+ proverId: EthAddress.fromNumber(proverIndex),
210
222
  dontStart: opts.dontStart,
211
223
  ...opts,
212
224
  },
@@ -235,12 +247,13 @@ export class EpochsTestContext {
235
247
  private async createNode(
236
248
  opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
237
249
  ) {
238
- const suffix = (this.nodes.length + 1).toString();
250
+ const nodeIndex = this.nodes.length + 1;
251
+ const actorPrefix = opts.disableValidator ? 'node' : 'validator';
239
252
  const { mockGossipSubNetwork } = this.context;
240
253
  const resolvedConfig = { ...this.context.config, ...opts };
241
254
  const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
242
255
  const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
243
- const node = await withLogNameSuffix(suffix, () =>
256
+ const node = await withLoggerBindings({ actor: `${actorPrefix}-${nodeIndex}` }, () =>
244
257
  AztecNodeService.createAndSync(
245
258
  {
246
259
  ...resolvedConfig,
@@ -370,6 +383,19 @@ export class EpochsTestContext {
370
383
  return SpamContract.at(instance.address, wallet);
371
384
  }
372
385
 
386
+ /** Registers the TestContract on the given wallet. */
387
+ public async registerTestContract(wallet: Wallet, salt = Fr.ZERO) {
388
+ const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
389
+ constructorArgs: [],
390
+ constructorArtifact: undefined,
391
+ salt,
392
+ publicKeys: undefined,
393
+ deployer: undefined,
394
+ });
395
+ await wallet.registerContract(instance, TestContract.artifact);
396
+ return TestContract.at(instance.address, wallet);
397
+ }
398
+
373
399
  /** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
374
400
  public async createL1Client() {
375
401
  const { client, delayer } = withDelayer(
@@ -67,10 +67,7 @@ describe('e2e_fees bridging_race', () => {
67
67
  // Yes, we need to REFACTOR it at some point
68
68
  const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
69
69
  const { claimSecret: secret, messageLeafIndex: index } = claim;
70
- await t.feeJuiceContract.methods
71
- .claim(bobsAddress, claim.claimAmount, secret, index)
72
- .send({ from: bobsAddress })
73
- .wait();
70
+ await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({ from: bobsAddress });
74
71
  const [balance] = await t.getGasBalanceFn(bobsAddress);
75
72
  expect(balance).toEqual(claim.claimAmount);
76
73
  });
@@ -152,10 +152,7 @@ export class FeesTest {
152
152
  async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress) {
153
153
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
154
154
  const { claimSecret: secret, messageLeafIndex: index } = claim;
155
- await this.feeJuiceContract.methods
156
- .claim(recipient, claim.claimAmount, secret, index)
157
- .send({ from: minter })
158
- .wait();
155
+ await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({ from: minter });
159
156
  }
160
157
 
161
158
  /** Alice mints bananaCoin tokens privately to the target address and redeems them. */
@@ -235,9 +232,9 @@ export class FeesTest {
235
232
  async applyDeployBananaToken() {
236
233
  this.logger.info('Applying deploy banana token setup');
237
234
 
238
- const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n)
239
- .send({ from: this.aliceAddress })
240
- .deployed();
235
+ const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
236
+ from: this.aliceAddress,
237
+ });
241
238
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
242
239
 
243
240
  this.bananaCoin = bananaCoin;
@@ -262,9 +259,9 @@ export class FeesTest {
262
259
  expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
263
260
 
264
261
  const bananaCoin = this.bananaCoin;
265
- const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
266
- .send({ from: this.aliceAddress })
267
- .deployed();
262
+ const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
263
+ from: this.aliceAddress,
264
+ });
268
265
 
269
266
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
270
267
 
@@ -306,10 +303,10 @@ export class FeesTest {
306
303
  await this.rollupContract.getManaTarget(),
307
304
  ) + (await this.rollupContract.getProvingCostPerMana());
308
305
 
309
- const price = await this.rollupContract.getFeeAssetPerEth();
306
+ const price = await this.rollupContract.getEthPerFeeAsset();
310
307
 
311
308
  const mana = block!.header.totalManaUsed.toBigInt();
312
- return mulDiv(mana * proverCost, price, 10n ** 9n);
309
+ return mulDiv(mana * proverCost, 10n ** 12n, price);
313
310
  };
314
311
  }
315
312
 
@@ -331,8 +328,7 @@ export class FeesTest {
331
328
  await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
332
329
  await this.bananaCoin.methods
333
330
  .mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS)
334
- .send({ from: this.aliceAddress })
335
- .wait();
331
+ .send({ from: this.aliceAddress });
336
332
  }
337
333
 
338
334
  public async applyFundAliceWithPrivateBananas() {
@@ -2,7 +2,7 @@ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { Fr } from '@aztec/aztec.js/fields';
3
3
  import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
4
4
  import { EthAddress } from '@aztec/foundation/eth-address';
5
- import { L2BlockNew } from '@aztec/stdlib/block';
5
+ import { L2Block } from '@aztec/stdlib/block';
6
6
  import { CheckpointHeader } from '@aztec/stdlib/rollup';
7
7
 
8
8
  import { writeFile } from 'fs/promises';
@@ -15,7 +15,8 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
15
15
  */
16
16
  export async function writeJson(
17
17
  fileName: string,
18
- block: L2BlockNew,
18
+ checkpointHeader: CheckpointHeader,
19
+ block: L2Block,
19
20
  l1ToL2Content: Fr[],
20
21
  blobs: Blob[],
21
22
  batchedBlob: BatchedBlob,
@@ -33,12 +34,6 @@ export async function writeJson(
33
34
  return `0x${buffer.toString('hex').padStart(size, '0')}`;
34
35
  };
35
36
 
36
- // Create a checkpoint header for this block
37
- const checkpointHeader = CheckpointHeader.random({
38
- slotNumber: block.slot,
39
- timestamp: block.timestamp,
40
- });
41
-
42
37
  const jsonObject = {
43
38
  populate: {
44
39
  l1ToL2Content: l1ToL2Content.map(value => asHex(value)),
@@ -65,10 +65,8 @@ export class NestedContractTest {
65
65
 
66
66
  async applyManual() {
67
67
  this.logger.info('Deploying parent and child contracts');
68
- const parentContract = await ParentContract.deploy(this.wallet)
69
- .send({ from: this.defaultAccountAddress })
70
- .deployed();
71
- const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress }).deployed();
68
+ const parentContract = await ParentContract.deploy(this.wallet).send({ from: this.defaultAccountAddress });
69
+ const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress });
72
70
  this.parentContract = parentContract;
73
71
  this.childContract = childContract;
74
72
  }
@@ -128,6 +128,7 @@ export class P2PNetworkTest {
128
128
  metricsPort: metricsPort,
129
129
  numberOfInitialFundedAccounts: 2,
130
130
  startProverNode,
131
+ walletMinFeePadding: 2.0,
131
132
  };
132
133
 
133
134
  this.deployL1ContractsArgs = {
@@ -321,7 +322,7 @@ export class P2PNetworkTest {
321
322
  throw new Error('Call setupAccount before deploying spam contract');
322
323
  }
323
324
 
324
- const spamContract = await SpamContract.deploy(this.wallet).send({ from: this.defaultAccountAddress! }).deployed();
325
+ const spamContract = await SpamContract.deploy(this.wallet).send({ from: this.defaultAccountAddress! });
325
326
  this.spamContract = spamContract;
326
327
  }
327
328
 
@@ -351,14 +352,19 @@ export class P2PNetworkTest {
351
352
 
352
353
  async setup() {
353
354
  this.logger.info('Setting up subsystems from fresh');
354
- this.context = await setup(0, {
355
- ...this.setupOptions,
356
- fundSponsoredFPC: true,
357
- skipAccountDeployment: true,
358
- slasherFlavor: this.setupOptions.slasherFlavor ?? this.deployL1ContractsArgs.slasherFlavor ?? 'none',
359
- aztecTargetCommitteeSize: 0,
360
- l1ContractsArgs: this.deployL1ContractsArgs,
361
- });
355
+ this.context = await setup(
356
+ 0,
357
+ {
358
+ ...this.setupOptions,
359
+ fundSponsoredFPC: true,
360
+ skipAccountDeployment: true,
361
+ slasherFlavor: this.setupOptions.slasherFlavor ?? this.deployL1ContractsArgs.slasherFlavor ?? 'none',
362
+ aztecTargetCommitteeSize: 0,
363
+ l1ContractsArgs: this.deployL1ContractsArgs,
364
+ },
365
+ // Use checkpointed chain tip for PXE to avoid issues with blocks being dropped due to pruned anchor blocks.
366
+ { syncChainTip: 'checkpointed' },
367
+ );
362
368
  this.ctx = this.context;
363
369
 
364
370
  const sponsoredFPCAddress = await getSponsoredFPCAddress();