@aztec/end-to-end 0.86.0 → 0.87.0

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 (94) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.js +1 -1
  2. package/dest/bench/client_flows/config.d.ts +1 -1
  3. package/dest/bench/client_flows/config.d.ts.map +1 -1
  4. package/dest/bench/client_flows/config.js +22 -3
  5. package/dest/bench/client_flows/data_extractor.d.ts.map +1 -1
  6. package/dest/bench/client_flows/data_extractor.js +23 -12
  7. package/dest/bench/utils.d.ts +1 -1
  8. package/dest/bench/utils.d.ts.map +1 -1
  9. package/dest/bench/utils.js +9 -5
  10. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -1
  13. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +5 -2
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +8 -4
  16. package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  18. package/dest/e2e_epochs/epochs_test.d.ts +13 -5
  19. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  20. package/dest/e2e_epochs/epochs_test.js +41 -16
  21. package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
  22. package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
  23. package/dest/e2e_fees/bridging_race.notest.js +60 -0
  24. package/dest/e2e_fees/fees_test.d.ts +1 -1
  25. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  26. package/dest/e2e_fees/fees_test.js +15 -9
  27. package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
  28. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  29. package/dest/e2e_nested_contract/nested_contract_test.js +2 -2
  30. package/dest/e2e_p2p/p2p_network.d.ts +10 -214
  31. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  32. package/dest/e2e_p2p/p2p_network.js +20 -23
  33. package/dest/e2e_p2p/shared.d.ts +1 -1
  34. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  35. package/dest/e2e_p2p/shared.js +3 -7
  36. package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
  37. package/dest/e2e_prover/e2e_prover_test.js +2 -1
  38. package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
  39. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  40. package/dest/e2e_token_contract/token_contract_test.js +1 -1
  41. package/dest/fixtures/fixtures.d.ts +4 -6
  42. package/dest/fixtures/fixtures.d.ts.map +1 -1
  43. package/dest/fixtures/fixtures.js +2 -2
  44. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  45. package/dest/fixtures/l1_to_l2_messaging.d.ts +5 -1
  46. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  47. package/dest/fixtures/l1_to_l2_messaging.js +5 -4
  48. package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
  49. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  50. package/dest/fixtures/setup_p2p_test.d.ts +1 -2
  51. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  52. package/dest/fixtures/setup_p2p_test.js +3 -3
  53. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  54. package/dest/fixtures/snapshot_manager.js +6 -2
  55. package/dest/fixtures/utils.d.ts +6 -6
  56. package/dest/fixtures/utils.d.ts.map +1 -1
  57. package/dest/fixtures/utils.js +64 -63
  58. package/dest/shared/capture_private_execution_steps.d.ts.map +1 -1
  59. package/dest/shared/capture_private_execution_steps.js +8 -4
  60. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  61. package/dest/shared/submit-transactions.d.ts.map +1 -1
  62. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  63. package/dest/shared/uniswap_l1_l2.js +1 -1
  64. package/dest/simulators/token_simulator.d.ts.map +1 -1
  65. package/dest/simulators/token_simulator.js +1 -1
  66. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  67. package/dest/spartan/utils.d.ts +0 -1
  68. package/dest/spartan/utils.d.ts.map +1 -1
  69. package/package.json +38 -37
  70. package/src/bench/client_flows/client_flows_benchmark.ts +1 -1
  71. package/src/bench/client_flows/config.ts +12 -4
  72. package/src/bench/client_flows/data_extractor.ts +40 -20
  73. package/src/bench/utils.ts +7 -3
  74. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
  75. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +16 -5
  76. package/src/e2e_deploy_contract/deploy_test.ts +1 -1
  77. package/src/e2e_epochs/epochs_test.ts +51 -18
  78. package/src/e2e_fees/bridging_race.notest.ts +74 -0
  79. package/src/e2e_fees/fees_test.ts +24 -9
  80. package/src/e2e_nested_contract/nested_contract_test.ts +6 -3
  81. package/src/e2e_p2p/p2p_network.ts +27 -21
  82. package/src/e2e_p2p/shared.ts +4 -6
  83. package/src/e2e_prover/e2e_prover_test.ts +1 -0
  84. package/src/e2e_token_contract/token_contract_test.ts +1 -1
  85. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  86. package/src/fixtures/fixtures.ts +2 -2
  87. package/src/fixtures/l1_to_l2_messaging.ts +1 -1
  88. package/src/fixtures/setup_p2p_test.ts +3 -3
  89. package/src/fixtures/snapshot_manager.ts +2 -2
  90. package/src/fixtures/utils.ts +57 -66
  91. package/src/shared/capture_private_execution_steps.ts +9 -2
  92. package/src/shared/uniswap_l1_l2.ts +1 -1
  93. package/src/simulators/token_simulator.ts +0 -1
  94. package/src/spartan/setup_test_wallets.ts +6 -3
@@ -218,7 +218,7 @@ export class ClientFlowsBenchmark {
218
218
  async applyDeploySponsoredFPCSnapshot() {
219
219
  await this.snapshotManager.snapshot('deploy_sponsored_fpc', async ()=>{
220
220
  const sponsoredFPC = await setupSponsoredFPC(this.pxe);
221
- this.logger.info(`SponsoredFPC deployed at ${sponsoredFPC.address}`);
221
+ this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
222
222
  return {
223
223
  sponsoredFPCAddress: sponsoredFPC.address
224
224
  };
@@ -4,7 +4,7 @@ export type ClientFlowConfig = {
4
4
  feePaymentMethods: BenchmarkingFeePaymentMethod[];
5
5
  recursions?: number[];
6
6
  };
7
- type ClientFlows = 'deployments' | 'transfers' | 'bridging' | 'amm';
7
+ type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
8
8
  export type ClientFlowsConfig = {
9
9
  [key in ClientFlows]: ClientFlowConfig;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;AAEpE,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,WAAW,GAAG,gBAAgB;CACvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAkB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBAkB/B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,WAAW,GAAG,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CAAC;AAE3F,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,WAAW,GAAG,gBAAgB;CACvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAsB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBAsB/B,CAAC"}
@@ -1,4 +1,13 @@
1
1
  export const KEY_FLOWS_CONFIG = {
2
+ accountDeployments: {
3
+ accounts: [
4
+ 'ecdsar1',
5
+ 'schnorr'
6
+ ],
7
+ feePaymentMethods: [
8
+ 'sponsored_fpc'
9
+ ]
10
+ },
2
11
  deployments: {
3
12
  accounts: [
4
13
  'ecdsar1',
@@ -26,19 +35,29 @@ export const KEY_FLOWS_CONFIG = {
26
35
  },
27
36
  transfers: {
28
37
  accounts: [
29
- 'ecdsar1',
30
- 'schnorr'
38
+ 'ecdsar1'
31
39
  ],
32
40
  feePaymentMethods: [
33
41
  'sponsored_fpc',
34
- 'fee_juice'
42
+ 'private_fpc'
35
43
  ],
36
44
  recursions: [
45
+ 0,
37
46
  1
38
47
  ]
39
48
  }
40
49
  };
41
50
  export const FULL_FLOWS_CONFIG = {
51
+ accountDeployments: {
52
+ accounts: [
53
+ 'ecdsar1',
54
+ 'schnorr'
55
+ ],
56
+ feePaymentMethods: [
57
+ 'bridged_fee_juice',
58
+ 'sponsored_fpc'
59
+ ]
60
+ },
42
61
  deployments: {
43
62
  accounts: [
44
63
  'ecdsar1',
@@ -1 +1 @@
1
- {"version":3,"file":"data_extractor.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/data_extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAY9C,QAAA,MAAM,QAAQ,oFAAqF,CAAC;AACpG,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1C,KAAK,GAAG,GAAG;IACT,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAsBF,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO;IAEP,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,WAAW;IAIlB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAiBpC,OAAO,CAAC,SAAS;IAIV,SAAS;IAIT,OAAO;CAGf"}
1
+ {"version":3,"file":"data_extractor.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/data_extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAa9C,QAAA,MAAM,QAAQ,oFAAqF,CAAC;AACpG,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1C,KAAK,GAAG,GAAG;IACT,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAsBF,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO;IAEP,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,WAAW;IAIlB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAiBpC,OAAO,CAAC,SAAS;IAIV,SAAS;IAIT,OAAO;CAGf"}
@@ -1,6 +1,7 @@
1
1
  import { BBNativePrivateKernelProver } from '@aztec/bb-prover/client/native';
2
2
  import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
3
3
  import { createLogger, logger } from '@aztec/foundation/log';
4
+ import { Timer } from '@aztec/foundation/timer';
4
5
  import { WASMSimulator } from '@aztec/simulator/client';
5
6
  import { Decoder } from 'msgpackr';
6
7
  import assert from 'node:assert';
@@ -96,11 +97,11 @@ async function createProver(config = {}, log) {
96
97
  };
97
98
  }
98
99
  }
99
- function getMinimumTrace(logs, proverType) {
100
- const minimumMessage = 'Minimum required block sizes for structured trace:';
100
+ function getMinimumTrace(logs) {
101
+ const minimumMessage = 'Trace details:';
101
102
  const minimumMessageIndex = logs.findIndex((log)=>log.message.includes(minimumMessage));
102
103
  const candidateLogs = logs.slice(minimumMessageIndex - GATE_TYPES.length, minimumMessageIndex);
103
- const traceLogs = proverType === 'wasm' ? candidateLogs.map((log)=>log.message) : logs.slice(minimumMessageIndex - GATE_TYPES.length, minimumMessageIndex).filter((log)=>GATE_TYPES.some((type)=>log.message.includes(`bb - ${type}`))).map((log)=>log.message.split('\n')).flat();
104
+ const traceLogs = candidateLogs.filter((log)=>GATE_TYPES.some((type)=>log.message.includes(type))).map((log)=>log.message.split(/\t|\n/)).flat().map((log)=>log.replace(/\(mem: .*\)/, '').trim()).filter(Boolean);
104
105
  const traceSizes = traceLogs.map((log)=>{
105
106
  const [gateType, gateSizeStr] = log.replace(/\n.*\)$/, '').replace(/bb - /, '').split(':').map((s)=>s.trim());
106
107
  const gateSize = parseInt(gateSizeStr);
@@ -142,23 +143,28 @@ async function main() {
142
143
  v
143
144
  ]));
144
145
  });
145
- const stepsFile = await readFile(join(ivcFolder, flow, 'steps.json'));
146
- const executionSteps = JSON.parse(stepsFile.toString());
147
- const privateExecutionSteps = executionSteps.map((step, i)=>({
146
+ const profileFile = await readFile(join(ivcFolder, flow, 'profile.json'));
147
+ const profile = JSON.parse(profileFile.toString());
148
+ const privateExecutionSteps = profile.steps.map((step, i)=>({
148
149
  functionName: step.fnName,
149
150
  gateCount: step.gateCount,
150
151
  bytecode: stepsFromFile[i].bytecode,
151
152
  // TODO(AD) do we still want to take this from witness.json?
152
153
  witness: witnessStack[i],
153
- // This can be left empty. If so, the prover will generate a vk on the fly (~25% slower).
154
- vk: Buffer.from([])
154
+ vk: stepsFromFile[i].vk,
155
+ timings: {
156
+ witgen: step.timings.witgen,
157
+ gateCount: step.timings.witgen
158
+ }
155
159
  }));
156
160
  let stats;
157
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
158
161
  let error;
159
162
  let currentLogs = [];
163
+ let provingTime;
160
164
  try {
165
+ const provingTimer = new Timer();
161
166
  await prover.createClientIvcProof(privateExecutionSteps);
167
+ provingTime = provingTimer.ms();
162
168
  } catch (e) {
163
169
  userLog.error(`Failed to generate client ivc proof for ${flow}`, e);
164
170
  error = e.message;
@@ -169,20 +175,25 @@ async function main() {
169
175
  if (!error) {
170
176
  stats = currentLogs[0].data;
171
177
  }
172
- const minimumTrace = getMinimumTrace(currentLogs, proverType);
173
- const steps = executionSteps.reduce((acc, step, i)=>{
178
+ const minimumTrace = getMinimumTrace(currentLogs);
179
+ const steps = profile.steps.reduce((acc, step, i)=>{
174
180
  const previousAccGateCount = i === 0 ? 0 : acc[i - 1].accGateCount;
175
181
  return [
176
182
  ...acc,
177
183
  {
178
184
  fnName: step.fnName,
179
185
  gateCount: step.gateCount,
180
- accGateCount: previousAccGateCount + step.gateCount
186
+ accGateCount: previousAccGateCount + step.gateCount,
187
+ timings: {
188
+ witgen: step.timings.witgen
189
+ }
181
190
  }
182
191
  ];
183
192
  }, []);
184
193
  const totalGateCount = steps[steps.length - 1].accGateCount;
185
194
  const benchmark = {
195
+ syncTime: profile.syncTime,
196
+ provingTime,
186
197
  proverType,
187
198
  minimumTrace: minimumTrace,
188
199
  totalGateCount,
@@ -1,5 +1,5 @@
1
1
  import { type AztecNode, type SentTx, type WaitOpts } from '@aztec/aztec.js';
2
- import { BenchmarkingContract } from '@aztec/noir-contracts.js/Benchmarking';
2
+ import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
3
3
  import { type PXEService } from '@aztec/pxe/server';
4
4
  import type { MetricsType } from '@aztec/telemetry-client';
5
5
  import type { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAA2C,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAA4C,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAIxH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACtE,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;GAuBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MA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,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAuEF;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBvG"}
@@ -1,8 +1,9 @@
1
1
  import { BatchCall } from '@aztec/aztec.js';
2
2
  import { mean, stdDev, times } from '@aztec/foundation/collection';
3
- import { BenchmarkingContract } from '@aztec/noir-contracts.js/Benchmarking';
3
+ import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
4
4
  import { createPXEService } from '@aztec/pxe/server';
5
- import { writeFileSync } from 'fs';
5
+ import { mkdirSync, writeFileSync } from 'fs';
6
+ import path from 'path';
6
7
  import { setup } from '../fixtures/utils.js';
7
8
  /**
8
9
  * Setup for benchmarks. Initializes a remote node with a single account and deploys a benchmark contract.
@@ -28,6 +29,9 @@ import { setup } from '../fixtures/utils.js';
28
29
  throw new Error(`No benchmark data generated. Please review your test setup.`);
29
30
  }
30
31
  const benchOutput = opts.benchOutput ?? process.env.BENCH_OUTPUT ?? 'bench.json';
32
+ mkdirSync(path.dirname(benchOutput), {
33
+ recursive: true
34
+ });
31
35
  writeFileSync(benchOutput, JSON.stringify(formatted));
32
36
  context.logger.info(`Wrote ${data.length} metrics to ${benchOutput}`);
33
37
  await origTeardown();
@@ -110,9 +114,7 @@ function getMetricValues(points) {
110
114
  */ export async function sendTxs(txCount, context, contract, heavyPublicCompute = false) {
111
115
  const calls = times(txCount, (index)=>makeCall(index, context, contract, heavyPublicCompute));
112
116
  context.logger.info(`Creating ${txCount} txs`);
113
- const provenTxs = await Promise.all(calls.map((call)=>call.prove({
114
- skipPublicSimulation: true
115
- })));
117
+ const provenTxs = await Promise.all(calls.map((call)=>call.prove()));
116
118
  context.logger.info(`Sending ${txCount} txs`);
117
119
  return provenTxs.map((tx)=>tx.send());
118
120
  }
@@ -139,7 +141,9 @@ export async function waitTxs(txs, context, txWaitOpts) {
139
141
  l1ChainId,
140
142
  rollupVersion
141
143
  };
144
+ // docs:start:PXEcreate
142
145
  const pxe = await createPXEService(node, pxeConfig);
146
+ // docs:end:PXEcreate
143
147
  await pxe.registerContract(contract);
144
148
  return pxe;
145
149
  }
@@ -1,6 +1,6 @@
1
1
  import { type AccountWallet, AztecAddress, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
2
- import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
3
2
  import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
3
+ import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
4
4
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
5
5
  import { TokenSimulator } from '../simulators/token_simulator.js';
6
6
  export declare class Role {
@@ -1 +1 @@
1
- {"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAy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AS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAQR,yBAAyB,CAC7B,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,EACd,MAAM,EAAE,MAAM;IAgBV,iBAAiB;CAmExB"}
@@ -1,8 +1,8 @@
1
1
  import { getSchnorrWallet } from '@aztec/accounts/schnorr';
2
2
  import { Fr, computeSecretHash, createLogger } from '@aztec/aztec.js';
3
3
  import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
4
- import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
5
4
  import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
5
+ import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
6
6
  import { jest } from '@jest/globals';
7
7
  import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
8
8
  import { TokenSimulator } from '../simulators/token_simulator.js';
@@ -1,9 +1,10 @@
1
1
  import type { AztecNodeConfig } from '@aztec/aztec-node';
2
2
  import { type AccountWallet, AztecAddress, type AztecNode, type CompleteAddress, EthAddress, type Logger, type PXE } from '@aztec/aztec.js';
3
3
  import { CheatCodes } from '@aztec/aztec.js/testing';
4
- import { type ExtendedViemWalletClient } from '@aztec/ethereum';
4
+ import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
5
5
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
6
6
  import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
7
+ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
7
8
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
8
9
  import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
9
10
  export declare class CrossChainMessagingTest {
@@ -14,6 +15,7 @@ export declare class CrossChainMessagingTest {
14
15
  aztecNode: AztecNode;
15
16
  pxe: PXE;
16
17
  aztecNodeConfig: AztecNodeConfig;
18
+ aztecNodeAdmin: AztecNodeAdmin;
17
19
  l1Client: ExtendedViemWalletClient | undefined;
18
20
  user1Wallet: AccountWallet;
19
21
  user2Wallet: AccountWallet;
@@ -24,7 +26,8 @@ export declare class CrossChainMessagingTest {
24
26
  l2Bridge: TokenBridgeContract;
25
27
  inbox: any;
26
28
  outbox: any;
27
- cheatcodes: CheatCodes;
29
+ cheatCodes: CheatCodes;
30
+ deployL1ContractsValues: DeployL1ContractsReturnType;
28
31
  constructor(testName: string);
29
32
  assumeProven(): Promise<void>;
30
33
  setup(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,wBAAwB,EAA4C,MAAM,iBAAiB,CAAC;AAE1G,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAK3E,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,E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AC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,kBAAkB;CA6FzB"}
@@ -18,6 +18,7 @@ export class CrossChainMessagingTest {
18
18
  aztecNode;
19
19
  pxe;
20
20
  aztecNodeConfig;
21
+ aztecNodeAdmin;
21
22
  l1Client;
22
23
  user1Wallet;
23
24
  user2Wallet;
@@ -28,20 +29,23 @@ export class CrossChainMessagingTest {
28
29
  l2Bridge;
29
30
  inbox;
30
31
  outbox;
31
- cheatcodes;
32
+ cheatCodes;
33
+ deployL1ContractsValues;
32
34
  constructor(testName){
33
35
  this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
34
36
  this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath);
35
37
  }
36
38
  async assumeProven() {
37
- await this.cheatcodes.rollup.markAsProven();
39
+ await this.cheatCodes.rollup.markAsProven();
38
40
  }
39
41
  async setup() {
40
- const { aztecNode, pxe, aztecNodeConfig } = await this.snapshotManager.setup();
42
+ const { aztecNode, pxe, aztecNodeConfig, deployL1ContractsValues } = await this.snapshotManager.setup();
41
43
  this.aztecNode = aztecNode;
42
44
  this.pxe = pxe;
43
45
  this.aztecNodeConfig = aztecNodeConfig;
44
- this.cheatcodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
46
+ this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
47
+ this.deployL1ContractsValues = deployL1ContractsValues;
48
+ this.aztecNodeAdmin = aztecNode;
45
49
  }
46
50
  snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
47
51
  async teardown() {
@@ -1,5 +1,5 @@
1
1
  import { type AccountWallet, type AztecAddress, type AztecNode, type ContractArtifact, type ContractBase, Fr, type Logger, type PXE, type PublicKeys, type Wallet } from '@aztec/aztec.js';
2
- import type { StatefulTestContract } from '@aztec/noir-contracts.js/StatefulTest';
2
+ import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
3
3
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
4
4
  export declare class DeployTest {
5
5
  private snapshotManager;
@@ -1 +1 @@
1
- {"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMtE,qBAAa,UAAU;IACrB,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,OAAO,CAAuB;IAE/B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAG,GAAG,CAAC;IACV,MAAM,EAAG,aAAa,CAAC;IACvB,SAAS,EAAG,SAAS,CAAC;IACtB,cAAc,EAAG,cAAc,CAAC;gBAE3B,QAAQ,EAAE,MAAM;IAKtB,KAAK;IAQL,QAAQ;YAIA,2BAA2B;IAYnC,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAC3C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAC1C,IAAI,GAAE;QACJ,IAAI,CAAC,EAAE,EAAE,CAAC;QACV,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;KACpB,GACL,OAAO,CAAC,CAAC,CAAC;IAaP,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;CAIrD;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CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;KACpB,GACL,OAAO,CAAC,CAAC,CAAC;IAaP,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;CAIrD;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAElG,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,YAAY,IAAI;IAC1D,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
@@ -5,14 +5,12 @@ import { RollupContract } from '@aztec/ethereum/contracts';
5
5
  import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
6
6
  import { ProverNode } from '@aztec/prover-node';
7
7
  import type { L2BlockNumber } from '@aztec/stdlib/block';
8
- import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
8
+ import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
9
9
  import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
10
- export declare const L1_BLOCK_TIME_IN_S: number;
11
- export declare const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
12
10
  export declare const WORLD_STATE_BLOCK_HISTORY = 2;
13
11
  export declare const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
14
12
  export declare const ARCHIVER_POLL_INTERVAL = 50;
15
- export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs'>>;
13
+ export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs' | 'l1PublishRetryIntervalMS' | 'txPropagationMaxQueryAttempts' | 'proverNodeConfig' | 'ethereumSlotDuration' | 'aztecSlotDuration'>>;
16
14
  /**
17
15
  * Tests building of epochs using fast block times and short epochs.
18
16
  * Spawns an aztec node and a prover node with fake proofs.
@@ -30,7 +28,15 @@ export declare class EpochsTestContext {
30
28
  proverNodes: ProverNode[];
31
29
  nodes: AztecNodeService[];
32
30
  epochDuration: number;
31
+ L1_BLOCK_TIME_IN_S: number;
32
+ L2_SLOT_DURATION_IN_S: number;
33
33
  static setup(opts?: EpochsTestOpts): Promise<EpochsTestContext>;
34
+ static getSlotDurations(opts?: EpochsTestOpts): {
35
+ ethereumSlotDuration: number;
36
+ aztecSlotDuration: number;
37
+ aztecEpochDuration: number;
38
+ aztecProofSubmissionWindow: number;
39
+ };
34
40
  setup(opts?: EpochsTestOpts): Promise<void>;
35
41
  teardown(): Promise<void>;
36
42
  createProverNode(): Promise<ProverNode>;
@@ -41,7 +47,9 @@ export declare class EpochsTestContext {
41
47
  /** Waits until the given L2 block number is mined. */
42
48
  waitUntilL2BlockNumber(target: number, timeout?: number): Promise<void>;
43
49
  /** Waits until the given L2 block number is marked as proven. */
44
- waitUntilProvenL2BlockNumber(t: number, timeout?: number): Promise<void>;
50
+ waitUntilProvenL2BlockNumber(t: number, timeout?: number): Promise<number>;
51
+ /** Waits until the end of the proof submission window for a given epoch. */
52
+ waitUntilEndOfProofSubmissionWindow(epochNumber: number | bigint): Promise<void>;
45
53
  /** Waits for the aztec node to sync to the target block number. */
46
54
  waitForNodeToSync(blockNumber: number, type: 'finalised' | 'historic'): Promise<void>;
47
55
  /** Verifies whether the given block number is found on the aztec node. */
@@ -1 +1 @@
1
- {"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAM,KAAK,MAAM,EAA8D,MAAM,iBAAiB,CAAC;AAC9G,OAAO,KAAK,EA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AAO;CAUtF"}
@@ -4,11 +4,9 @@ import { RollupContract } from '@aztec/ethereum/contracts';
4
4
  import { ChainMonitor, waitUntilL1Timestamp } from '@aztec/ethereum/test';
5
5
  import { randomBytes } from '@aztec/foundation/crypto';
6
6
  import { withLogNameSuffix } from '@aztec/foundation/log';
7
+ import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
7
8
  import { join } from 'path';
8
9
  import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
9
- // This can be lowered to as much as 2s in non-CI
10
- export const L1_BLOCK_TIME_IN_S = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
11
- export const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
12
10
  export const WORLD_STATE_BLOCK_HISTORY = 2;
13
11
  export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
14
12
  export const ARCHIVER_POLL_INTERVAL = 50;
@@ -28,16 +26,32 @@ export const ARCHIVER_POLL_INTERVAL = 50;
28
26
  proverNodes = [];
29
27
  nodes = [];
30
28
  epochDuration;
29
+ L1_BLOCK_TIME_IN_S;
30
+ L2_SLOT_DURATION_IN_S;
31
31
  static async setup(opts = {}) {
32
32
  const test = new EpochsTestContext();
33
33
  await test.setup(opts);
34
34
  return test;
35
35
  }
36
+ static getSlotDurations(opts = {}) {
37
+ const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
38
+ const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
39
+ const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
40
+ const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
41
+ const aztecProofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
42
+ return {
43
+ ethereumSlotDuration,
44
+ aztecSlotDuration,
45
+ aztecEpochDuration,
46
+ aztecProofSubmissionWindow
47
+ };
48
+ }
36
49
  async setup(opts = {}) {
50
+ const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionWindow } = EpochsTestContext.getSlotDurations(opts);
51
+ this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
52
+ this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
37
53
  // Set up system without any account nor protocol contracts
38
54
  // and with faster block times and shorter epochs.
39
- const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
40
- const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
41
55
  const context = await setup(0, {
42
56
  checkIntervalMs: 50,
43
57
  archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
@@ -45,9 +59,9 @@ export const ARCHIVER_POLL_INTERVAL = 50;
45
59
  skipProtocolContracts: true,
46
60
  salt: 1,
47
61
  aztecEpochDuration,
48
- aztecSlotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
49
- ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
50
- aztecProofSubmissionWindow: proofSubmissionWindow,
62
+ aztecSlotDuration,
63
+ ethereumSlotDuration,
64
+ aztecProofSubmissionWindow,
51
65
  minTxsPerBlock: 0,
52
66
  realProofs: false,
53
67
  startProverNode: true,
@@ -57,7 +71,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
57
71
  proverId: Fr.fromString('1'),
58
72
  // This must be enough so that the tx from the prover is delayed properly,
59
73
  // but not so much to hang the sequencer and timeout the teardown
60
- txPropagationMaxQueryAttempts: 12,
74
+ txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
61
75
  worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
62
76
  ...opts
63
77
  });
@@ -84,11 +98,11 @@ export const ARCHIVER_POLL_INTERVAL = 50;
84
98
  this.epochDuration = aztecEpochDuration;
85
99
  this.constants = {
86
100
  epochDuration: aztecEpochDuration,
87
- slotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
101
+ slotDuration: aztecSlotDuration,
88
102
  l1StartBlock: await this.rollup.getL1StartBlock(),
89
103
  l1GenesisTime: await this.rollup.getL1GenesisTime(),
90
- ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
91
- proofSubmissionWindow
104
+ ethereumSlotDuration,
105
+ proofSubmissionWindow: aztecProofSubmissionWindow
92
106
  };
93
107
  this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
94
108
  }
@@ -105,7 +119,9 @@ export const ARCHIVER_POLL_INTERVAL = 50;
105
119
  const proverNode = await withLogNameSuffix(suffix, ()=>createAndSyncProverNode(proverNodePrivateKey, {
106
120
  ...this.context.config,
107
121
  proverId: Fr.fromString(suffix)
108
- }, this.context.aztecNode, join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))));
122
+ }, {
123
+ dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
124
+ }, this.context.aztecNode));
109
125
  this.proverNodes.push(proverNode);
110
126
  return proverNode;
111
127
  }
@@ -127,14 +143,23 @@ export const ARCHIVER_POLL_INTERVAL = 50;
127
143
  /** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
128
144
  const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
129
145
  this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
130
- await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
146
+ await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S));
131
147
  return start;
132
148
  }
133
149
  /** Waits until the given L2 block number is mined. */ async waitUntilL2BlockNumber(target, timeout = 60) {
134
- await retryUntil(()=>Promise.resolve(target === this.monitor.l2BlockNumber), `Wait until L2 block ${target}`, timeout, 0.1);
150
+ await retryUntil(()=>Promise.resolve(target <= this.monitor.l2BlockNumber), `Wait until L2 block ${target}`, timeout, 0.1);
135
151
  }
136
152
  /** Waits until the given L2 block number is marked as proven. */ async waitUntilProvenL2BlockNumber(t, timeout = 60) {
137
- await retryUntil(()=>Promise.resolve(t === this.monitor.l2ProvenBlockNumber), `Wait proven L2 block ${t}`, timeout, 0.1);
153
+ await retryUntil(()=>Promise.resolve(t <= this.monitor.l2ProvenBlockNumber), `Wait proven L2 block ${t}`, timeout, 0.1);
154
+ return this.monitor.l2ProvenBlockNumber;
155
+ }
156
+ /** Waits until the end of the proof submission window for a given epoch. */ async waitUntilEndOfProofSubmissionWindow(epochNumber) {
157
+ const deadline = getProofSubmissionDeadlineTimestamp(BigInt(epochNumber), this.constants);
158
+ const date = new Date(Number(deadline) * 1000);
159
+ this.logger.info(`Waiting until end of submission window for epoch ${epochNumber} at ${date}`, {
160
+ deadline
161
+ });
162
+ await waitUntilL1Timestamp(this.l1Client, deadline);
138
163
  }
139
164
  /** Waits for the aztec node to sync to the target block number. */ async waitForNodeToSync(blockNumber, type) {
140
165
  const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bridging_race.notest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridging_race.notest.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/bridging_race.notest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
+ import { Fr, sleep } from '@aztec/aztec.js';
3
+ import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
4
+ import { Fq } from '@aztec/foundation/fields';
5
+ import { jest } from '@jest/globals';
6
+ import { FeesTest } from './fees_test.js';
7
+ jest.setTimeout(300_000);
8
+ // Regression for https://github.com/AztecProtocol/aztec-packages/issues/12366
9
+ // Similar to e2e_fees/account_init but with no automine
10
+ describe('e2e_fees bridging_race', ()=>{
11
+ const ETHEREUM_SLOT_DURATION = 4;
12
+ const AZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION * 2;
13
+ const t = new FeesTest('bridging_race', 1, {
14
+ ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
15
+ aztecSlotDuration: AZTEC_SLOT_DURATION,
16
+ minTxsPerBlock: 0
17
+ });
18
+ beforeAll(async ()=>{
19
+ await t.applyInitialAccountsSnapshot();
20
+ await t.applyPublicDeployAccountsSnapshot();
21
+ await t.applySetupFeeJuiceSnapshot();
22
+ ({ pxe, logger } = await t.setup());
23
+ });
24
+ afterAll(async ()=>{
25
+ await t.teardown();
26
+ });
27
+ let logger;
28
+ let pxe;
29
+ let bobsAddress;
30
+ beforeEach(async ()=>{
31
+ const bobsSecretKey = Fr.random();
32
+ const bobsPrivateSigningKey = Fq.random();
33
+ const bobsAccountManager = await getSchnorrAccount(pxe, bobsSecretKey, bobsPrivateSigningKey, Fr.random());
34
+ const bobsCompleteAddress = await bobsAccountManager.getCompleteAddress();
35
+ bobsAddress = bobsCompleteAddress.address;
36
+ await bobsAccountManager.getWallet();
37
+ await bobsAccountManager.register();
38
+ });
39
+ it('Alice bridges funds to Bob', async ()=>{
40
+ // Tweak the token manager so the bridging happens immediately before the end of the current L2 slot
41
+ // This caused the message to be "not in state" when tried to be used
42
+ const l1TokenManager = t.feeJuiceBridgeTestHarness.l1TokenManager;
43
+ const origApprove = l1TokenManager.approve.bind(l1TokenManager);
44
+ l1TokenManager.approve = async (amount, address, addressName = '')=>{
45
+ await origApprove(amount, address, addressName);
46
+ const sleepTime = (Number(t.chainMonitor.l2BlockTimestamp) + AZTEC_SLOT_DURATION) * 1000 - Date.now() - 500;
47
+ logger.info(`Sleeping for ${sleepTime}ms until near end of L2 slot before sending L1 fee juice to L2 inbox`);
48
+ await sleep(sleepTime);
49
+ };
50
+ // Waiting for the archiver to sync the message _before_ waiting for the mandatory 2 L2 blocks to pass fixed it
51
+ // This was added everywhere we wait for two blocks, which is spread across three different places in the codebase
52
+ // Yes, we need to REFACTOR it at some point
53
+ const amount = FEE_FUNDING_FOR_TESTER_ACCOUNT;
54
+ const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(amount, bobsAddress);
55
+ const { claimSecret: secret, messageLeafIndex: index } = claim;
56
+ await t.feeJuiceContract.methods.claim(bobsAddress, amount, secret, index).send().wait();
57
+ const [balance] = await t.getGasBalanceFn(bobsAddress);
58
+ expect(balance).toEqual(amount);
59
+ });
60
+ });
@@ -4,11 +4,11 @@ import { type DeployL1ContractsArgs } from '@aztec/ethereum';
4
4
  import { ChainMonitor } from '@aztec/ethereum/test';
5
5
  import { EthAddress } from '@aztec/foundation/eth-address';
6
6
  import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
7
- import { CounterContract } from '@aztec/noir-contracts.js/Counter';
8
7
  import { FPCContract } from '@aztec/noir-contracts.js/FPC';
9
8
  import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
10
9
  import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
11
10
  import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
11
+ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
12
12
  import { GasSettings } from '@aztec/stdlib/gas';
13
13
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
14
14
  import { type BalancesFn, type SetupOptions } from '../fixtures/utils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EACL,KAAK,qBAAqB,EAK3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY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