@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.f295ac2

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 (141) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +21 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +14 -15
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +110 -138
  7. package/dest/bench/client_flows/data_extractor.js +3 -1
  8. package/dest/bench/utils.d.ts +6 -6
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +18 -11
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -7
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +98 -113
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +19 -13
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +91 -71
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -3
  18. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  19. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  20. package/dest/e2e_epochs/epochs_test.d.ts +3 -2
  21. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  22. package/dest/e2e_epochs/epochs_test.js +13 -11
  23. package/dest/e2e_fees/bridging_race.notest.js +3 -5
  24. package/dest/e2e_fees/fees_test.d.ts +18 -15
  25. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  26. package/dest/e2e_fees/fees_test.js +126 -141
  27. package/dest/e2e_l1_publisher/write_json.d.ts +3 -3
  28. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  29. package/dest/e2e_l1_publisher/write_json.js +19 -15
  30. package/dest/e2e_multi_validator/utils.js +1 -1
  31. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  32. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  33. package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
  34. package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
  35. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  36. package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
  37. package/dest/e2e_p2p/p2p_network.d.ts +13 -11
  38. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  39. package/dest/e2e_p2p/p2p_network.js +116 -111
  40. package/dest/e2e_p2p/shared.d.ts +2 -2
  41. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  42. package/dest/e2e_p2p/shared.js +4 -4
  43. package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
  44. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  45. package/dest/e2e_token_contract/token_contract_test.js +90 -92
  46. package/dest/fixtures/e2e_prover_test.d.ts +10 -18
  47. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  48. package/dest/fixtures/e2e_prover_test.js +88 -103
  49. package/dest/fixtures/fixtures.d.ts +2 -3
  50. package/dest/fixtures/fixtures.d.ts.map +1 -1
  51. package/dest/fixtures/fixtures.js +1 -2
  52. package/dest/fixtures/get_acvm_config.js +1 -1
  53. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  54. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  55. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  56. package/dest/fixtures/setup.d.ts +216 -0
  57. package/dest/fixtures/setup.d.ts.map +1 -0
  58. package/dest/fixtures/setup.js +684 -0
  59. package/dest/fixtures/setup_p2p_test.js +3 -3
  60. package/dest/fixtures/utils.d.ts +5 -638
  61. package/dest/fixtures/utils.d.ts.map +1 -1
  62. package/dest/fixtures/utils.js +4 -647
  63. package/dest/fixtures/web3signer.js +1 -1
  64. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  65. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  66. package/dest/fixtures/with_telemetry_utils.js +2 -2
  67. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  68. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  69. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  70. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  71. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  72. package/dest/quality_of_service/prometheus_client.js +67 -0
  73. package/dest/shared/cross_chain_test_harness.d.ts +16 -4
  74. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  75. package/dest/shared/cross_chain_test_harness.js +3 -3
  76. package/dest/shared/gas_portal_test_harness.d.ts +12 -2
  77. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  78. package/dest/shared/index.d.ts +2 -2
  79. package/dest/shared/index.d.ts.map +1 -1
  80. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  81. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  82. package/dest/shared/uniswap_l1_l2.js +43 -23
  83. package/dest/simulators/lending_simulator.d.ts +6 -2
  84. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  85. package/dest/simulators/lending_simulator.js +1 -1
  86. package/dest/spartan/setup_test_wallets.d.ts +4 -3
  87. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  88. package/dest/spartan/setup_test_wallets.js +2 -1
  89. package/dest/spartan/tx_metrics.d.ts +42 -0
  90. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  91. package/dest/spartan/tx_metrics.js +118 -0
  92. package/dest/spartan/utils.d.ts +51 -12
  93. package/dest/spartan/utils.d.ts.map +1 -1
  94. package/dest/spartan/utils.js +262 -102
  95. package/package.json +40 -39
  96. package/src/bench/client_flows/benchmark.ts +24 -2
  97. package/src/bench/client_flows/client_flows_benchmark.ts +150 -200
  98. package/src/bench/client_flows/data_extractor.ts +1 -1
  99. package/src/bench/utils.ts +22 -14
  100. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +107 -142
  101. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -125
  102. package/src/e2e_deploy_contract/deploy_test.ts +21 -14
  103. package/src/e2e_epochs/epochs_test.ts +26 -13
  104. package/src/e2e_fees/bridging_race.notest.ts +3 -6
  105. package/src/e2e_fees/fees_test.ts +177 -216
  106. package/src/e2e_l1_publisher/write_json.ts +22 -17
  107. package/src/e2e_multi_validator/utils.ts +1 -1
  108. package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
  109. package/src/e2e_p2p/inactivity_slash_test.ts +9 -12
  110. package/src/e2e_p2p/p2p_network.ts +174 -183
  111. package/src/e2e_p2p/shared.ts +11 -6
  112. package/src/e2e_token_contract/token_contract_test.ts +105 -118
  113. package/src/fixtures/e2e_prover_test.ts +112 -144
  114. package/src/fixtures/fixtures.ts +1 -3
  115. package/src/fixtures/get_acvm_config.ts +1 -1
  116. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  117. package/src/fixtures/setup.ts +1010 -0
  118. package/src/fixtures/setup_p2p_test.ts +3 -3
  119. package/src/fixtures/utils.ts +27 -966
  120. package/src/fixtures/web3signer.ts +1 -1
  121. package/src/fixtures/with_telemetry_utils.ts +2 -2
  122. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  123. package/src/quality_of_service/prometheus_client.ts +113 -0
  124. package/src/shared/cross_chain_test_harness.ts +6 -10
  125. package/src/shared/gas_portal_test_harness.ts +1 -1
  126. package/src/shared/index.ts +1 -1
  127. package/src/shared/uniswap_l1_l2.ts +53 -67
  128. package/src/simulators/lending_simulator.ts +2 -2
  129. package/src/spartan/setup_test_wallets.ts +9 -2
  130. package/src/spartan/tx_metrics.ts +153 -0
  131. package/src/spartan/utils.ts +308 -45
  132. package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
  133. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  134. package/dest/fixtures/setup_l1_contracts.js +0 -17
  135. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  136. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  137. package/dest/fixtures/snapshot_manager.js +0 -505
  138. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  139. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  140. package/src/fixtures/setup_l1_contracts.ts +0 -26
  141. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -10,12 +10,10 @@ import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/Statefu
10
10
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
11
11
  import type { TestWallet } from '@aztec/test-wallet/server';
12
12
 
13
- import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
14
-
15
- const { E2E_DATA_PATH: dataPath } = process.env;
13
+ import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
16
14
 
17
15
  export class DeployTest {
18
- private snapshotManager: ISnapshotManager;
16
+ public context!: EndToEndContext;
19
17
  public logger: Logger;
20
18
  public wallet!: TestWallet;
21
19
  public defaultAccountAddress!: AztecAddress;
@@ -24,26 +22,35 @@ export class DeployTest {
24
22
 
25
23
  constructor(testName: string) {
26
24
  this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
27
- this.snapshotManager = createSnapshotManager(`e2e_deploy_contract/${testName}`, dataPath);
28
25
  }
29
26
 
30
27
  async setup() {
31
- await this.applyInitialAccountSnapshot();
32
- const context = await this.snapshotManager.setup();
33
- ({ aztecNode: this.aztecNode, wallet: this.wallet } = context);
34
- this.aztecNodeAdmin = context.aztecNode;
28
+ this.logger.info('Setting up test environment');
29
+ this.context = await setup(0, {
30
+ fundSponsoredFPC: true,
31
+ skipAccountDeployment: true,
32
+ });
33
+ this.aztecNode = this.context.aztecNodeService!;
34
+ this.wallet = this.context.wallet;
35
+ this.aztecNodeAdmin = this.context.aztecNodeService!;
36
+ await this.applyInitialAccount();
35
37
  return this;
36
38
  }
37
39
 
38
40
  async teardown() {
39
- await this.snapshotManager.teardown();
41
+ await teardown(this.context);
40
42
  }
41
43
 
42
- private async applyInitialAccountSnapshot() {
43
- await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger), ({ deployedAccounts }) => {
44
- this.defaultAccountAddress = deployedAccounts[0].address;
45
- return Promise.resolve();
44
+ private async applyInitialAccount() {
45
+ this.logger.info('Applying initial account setup');
46
+ const { deployedAccounts } = await deployAccounts(
47
+ 1,
48
+ this.logger,
49
+ )({
50
+ wallet: this.context.wallet,
51
+ initialFundedAccounts: this.context.initialFundedAccounts,
46
52
  });
53
+ this.defaultAccountAddress = deployedAccounts[0].address;
47
54
  }
48
55
 
49
56
  async registerContract<T extends ContractBase>(
@@ -6,12 +6,14 @@ import type { Logger } from '@aztec/aztec.js/log';
6
6
  import { MerkleTreeId } from '@aztec/aztec.js/trees';
7
7
  import type { Wallet } from '@aztec/aztec.js/wallet';
8
8
  import { EpochCache } from '@aztec/epoch-cache';
9
- import { DefaultL1ContractsConfig, type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
9
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
10
+ import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
10
11
  import { RollupContract } from '@aztec/ethereum/contracts';
11
12
  import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
13
+ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
12
14
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
13
15
  import { SecretValue } from '@aztec/foundation/config';
14
- import { randomBytes } from '@aztec/foundation/crypto';
16
+ import { randomBytes } from '@aztec/foundation/crypto/random';
15
17
  import { withLogNameSuffix } from '@aztec/foundation/log';
16
18
  import { retryUntil } from '@aztec/foundation/retry';
17
19
  import { sleep } from '@aztec/foundation/sleep';
@@ -95,12 +97,24 @@ export class EpochsTestContext {
95
97
  const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
96
98
  const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
97
99
  const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
98
- return { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs };
100
+ const l1PublishingTime = opts.l1PublishingTime ?? 1;
101
+ return {
102
+ l1PublishingTime,
103
+ ethereumSlotDuration,
104
+ aztecSlotDuration,
105
+ aztecEpochDuration,
106
+ aztecProofSubmissionEpochs,
107
+ };
99
108
  }
100
109
 
101
110
  public async setup(opts: EpochsTestOpts = {}) {
102
- const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs } =
103
- EpochsTestContext.getSlotDurations(opts);
111
+ const {
112
+ ethereumSlotDuration,
113
+ aztecSlotDuration,
114
+ aztecEpochDuration,
115
+ aztecProofSubmissionEpochs,
116
+ l1PublishingTime,
117
+ } = EpochsTestContext.getSlotDurations(opts);
104
118
 
105
119
  this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
106
120
  this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
@@ -112,8 +126,6 @@ export class EpochsTestContext {
112
126
  checkIntervalMs: 50,
113
127
  archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
114
128
  worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
115
- skipProtocolContracts: true,
116
- salt: 1,
117
129
  aztecEpochDuration,
118
130
  aztecSlotDuration,
119
131
  ethereumSlotDuration,
@@ -130,6 +142,7 @@ export class EpochsTestContext {
130
142
  worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
131
143
  exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
132
144
  slasherFlavor: 'none',
145
+ l1PublishingTime,
133
146
  ...opts,
134
147
  });
135
148
 
@@ -198,7 +211,7 @@ export class EpochsTestContext {
198
211
  ...opts,
199
212
  },
200
213
  this.context.aztecNode,
201
- undefined,
214
+ this.context.prefilledPublicData ?? [],
202
215
  { dateProvider: this.context.dateProvider },
203
216
  ),
204
217
  );
@@ -292,7 +305,7 @@ export class EpochsTestContext {
292
305
  }
293
306
 
294
307
  /** Waits until the given checkpoint number is mined. */
295
- public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 60) {
308
+ public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
296
309
  await retryUntil(
297
310
  () => Promise.resolve(target <= this.monitor.checkpointNumber),
298
311
  `Wait until checkpoint ${target}`,
@@ -302,7 +315,7 @@ export class EpochsTestContext {
302
315
  }
303
316
 
304
317
  /** Waits until the given checkpoint number is marked as proven. */
305
- public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 60) {
318
+ public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
306
319
  await retryUntil(
307
320
  () => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
308
321
  `Wait proven checkpoint ${target}`,
@@ -335,7 +348,7 @@ export class EpochsTestContext {
335
348
  ]);
336
349
  this.logger.info(`Wait for node synch ${blockNumber} ${type}`, { blockNumber, type, syncState, tips });
337
350
  if (type === 'proven') {
338
- synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
351
+ synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
339
352
  } else if (type === 'finalized') {
340
353
  synched = syncState.finalizedBlockNumber >= blockNumber;
341
354
  } else {
@@ -391,11 +404,11 @@ export class EpochsTestContext {
391
404
  const stateChanges: TrackedSequencerEvent[] = [];
392
405
  const failEvents: TrackedSequencerEvent[] = [];
393
406
 
394
- // Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
407
+ // Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
395
408
  // due to lack of txs available.
396
409
  const failEventsKeys: (keyof SequencerEvents)[] = [
397
410
  'block-build-failed',
398
- 'block-publish-failed',
411
+ 'checkpoint-publish-failed',
399
412
  'proposer-rollup-check-failed',
400
413
  ];
401
414
 
@@ -1,7 +1,7 @@
1
1
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
2
  import { Fr } from '@aztec/aztec.js/fields';
3
3
  import type { Logger } from '@aztec/aztec.js/log';
4
- import { Fq } from '@aztec/foundation/fields';
4
+ import { Fq } from '@aztec/foundation/curves/bn254';
5
5
  import { sleep } from '@aztec/foundation/sleep';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import type { TestWallet } from '@aztec/test-wallet/server';
@@ -26,11 +26,8 @@ describe('e2e_fees bridging_race', () => {
26
26
  });
27
27
 
28
28
  beforeAll(async () => {
29
- await t.applyInitialAccountsSnapshot();
30
- await t.applyPublicDeployAccountsSnapshot();
31
- await t.applySetupFeeJuiceSnapshot();
32
-
33
- ({ wallet, logger } = await t.setup());
29
+ await t.setup();
30
+ ({ wallet, logger } = t);
34
31
  });
35
32
 
36
33
  afterAll(async () => {