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

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 (190) 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 +123 -136
  7. package/dest/bench/client_flows/data_extractor.js +3 -1
  8. package/dest/bench/utils.d.ts +9 -8
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +27 -18
  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 +96 -112
  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 +16 -11
  23. package/dest/e2e_fees/bridging_race.notest.js +4 -6
  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 +2 -2
  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 +31 -39
  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 +120 -111
  40. package/dest/e2e_p2p/shared.d.ts +7 -7
  41. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  42. package/dest/e2e_p2p/shared.js +11 -18
  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 +89 -91
  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 +90 -102
  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 +218 -0
  57. package/dest/fixtures/setup.d.ts.map +1 -0
  58. package/dest/fixtures/setup.js +690 -0
  59. package/dest/fixtures/setup_p2p_test.js +3 -3
  60. package/dest/fixtures/token_utils.d.ts +1 -1
  61. package/dest/fixtures/token_utils.d.ts.map +1 -1
  62. package/dest/fixtures/token_utils.js +7 -4
  63. package/dest/fixtures/utils.d.ts +5 -638
  64. package/dest/fixtures/utils.d.ts.map +1 -1
  65. package/dest/fixtures/utils.js +4 -647
  66. package/dest/fixtures/web3signer.js +1 -1
  67. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  68. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  69. package/dest/fixtures/with_telemetry_utils.js +2 -2
  70. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  71. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  72. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  73. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  74. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  75. package/dest/quality_of_service/prometheus_client.js +67 -0
  76. package/dest/shared/cross_chain_test_harness.d.ts +18 -7
  77. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  78. package/dest/shared/cross_chain_test_harness.js +14 -14
  79. package/dest/shared/gas_portal_test_harness.d.ts +12 -2
  80. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  81. package/dest/shared/gas_portal_test_harness.js +1 -1
  82. package/dest/shared/index.d.ts +2 -2
  83. package/dest/shared/index.d.ts.map +1 -1
  84. package/dest/shared/submit-transactions.d.ts +3 -3
  85. package/dest/shared/submit-transactions.d.ts.map +1 -1
  86. package/dest/shared/submit-transactions.js +9 -11
  87. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  88. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  89. package/dest/shared/uniswap_l1_l2.js +55 -35
  90. package/dest/simulators/lending_simulator.d.ts +6 -2
  91. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  92. package/dest/simulators/lending_simulator.js +2 -2
  93. package/dest/spartan/setup_test_wallets.d.ts +4 -3
  94. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  95. package/dest/spartan/setup_test_wallets.js +63 -35
  96. package/dest/spartan/tx_metrics.d.ts +54 -0
  97. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  98. package/dest/spartan/tx_metrics.js +272 -0
  99. package/dest/spartan/utils/bot.d.ts +27 -0
  100. package/dest/spartan/utils/bot.d.ts.map +1 -0
  101. package/dest/spartan/utils/bot.js +141 -0
  102. package/dest/spartan/utils/chaos.d.ts +79 -0
  103. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  104. package/dest/spartan/utils/chaos.js +142 -0
  105. package/dest/spartan/utils/clients.d.ts +39 -0
  106. package/dest/spartan/utils/clients.d.ts.map +1 -0
  107. package/dest/spartan/utils/clients.js +90 -0
  108. package/dest/spartan/utils/config.d.ts +36 -0
  109. package/dest/spartan/utils/config.d.ts.map +1 -0
  110. package/dest/spartan/utils/config.js +20 -0
  111. package/dest/spartan/utils/health.d.ts +63 -0
  112. package/dest/spartan/utils/health.d.ts.map +1 -0
  113. package/dest/spartan/utils/health.js +202 -0
  114. package/dest/spartan/utils/helm.d.ts +15 -0
  115. package/dest/spartan/utils/helm.d.ts.map +1 -0
  116. package/dest/spartan/utils/helm.js +47 -0
  117. package/dest/spartan/utils/index.d.ts +9 -0
  118. package/dest/spartan/utils/index.d.ts.map +1 -0
  119. package/dest/spartan/utils/index.js +18 -0
  120. package/dest/spartan/utils/k8s.d.ts +98 -0
  121. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  122. package/dest/spartan/utils/k8s.js +257 -0
  123. package/dest/spartan/utils/nodes.d.ts +31 -0
  124. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  125. package/dest/spartan/utils/nodes.js +290 -0
  126. package/dest/spartan/utils/scripts.d.ts +16 -0
  127. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  128. package/dest/spartan/utils/scripts.js +66 -0
  129. package/dest/spartan/utils.d.ts +2 -221
  130. package/dest/spartan/utils.d.ts.map +1 -1
  131. package/dest/spartan/utils.js +1 -782
  132. package/package.json +40 -39
  133. package/src/bench/client_flows/benchmark.ts +24 -2
  134. package/src/bench/client_flows/client_flows_benchmark.ts +145 -208
  135. package/src/bench/client_flows/data_extractor.ts +1 -1
  136. package/src/bench/utils.ts +30 -20
  137. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +104 -142
  138. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -125
  139. package/src/e2e_deploy_contract/deploy_test.ts +21 -14
  140. package/src/e2e_epochs/epochs_test.ts +54 -36
  141. package/src/e2e_fees/bridging_race.notest.ts +4 -10
  142. package/src/e2e_fees/fees_test.ts +177 -220
  143. package/src/e2e_l1_publisher/write_json.ts +21 -16
  144. package/src/e2e_multi_validator/utils.ts +1 -1
  145. package/src/e2e_nested_contract/nested_contract_test.ts +33 -56
  146. package/src/e2e_p2p/inactivity_slash_test.ts +9 -12
  147. package/src/e2e_p2p/p2p_network.ts +180 -183
  148. package/src/e2e_p2p/shared.ts +21 -26
  149. package/src/e2e_token_contract/token_contract_test.ts +103 -118
  150. package/src/fixtures/e2e_prover_test.ts +103 -140
  151. package/src/fixtures/fixtures.ts +1 -3
  152. package/src/fixtures/get_acvm_config.ts +1 -1
  153. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  154. package/src/fixtures/setup.ts +1017 -0
  155. package/src/fixtures/setup_p2p_test.ts +3 -3
  156. package/src/fixtures/token_utils.ts +6 -5
  157. package/src/fixtures/utils.ts +27 -966
  158. package/src/fixtures/web3signer.ts +1 -1
  159. package/src/fixtures/with_telemetry_utils.ts +2 -2
  160. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  161. package/src/quality_of_service/prometheus_client.ts +113 -0
  162. package/src/shared/cross_chain_test_harness.ts +19 -37
  163. package/src/shared/gas_portal_test_harness.ts +2 -2
  164. package/src/shared/index.ts +1 -1
  165. package/src/shared/submit-transactions.ts +9 -15
  166. package/src/shared/uniswap_l1_l2.ts +65 -86
  167. package/src/simulators/lending_simulator.ts +3 -3
  168. package/src/spartan/setup_test_wallets.ts +81 -26
  169. package/src/spartan/tx_metrics.ts +250 -0
  170. package/src/spartan/utils/bot.ts +185 -0
  171. package/src/spartan/utils/chaos.ts +253 -0
  172. package/src/spartan/utils/clients.ts +100 -0
  173. package/src/spartan/utils/config.ts +26 -0
  174. package/src/spartan/utils/health.ts +255 -0
  175. package/src/spartan/utils/helm.ts +84 -0
  176. package/src/spartan/utils/index.ts +62 -0
  177. package/src/spartan/utils/k8s.ts +375 -0
  178. package/src/spartan/utils/nodes.ts +323 -0
  179. package/src/spartan/utils/scripts.ts +63 -0
  180. package/src/spartan/utils.ts +1 -983
  181. package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
  182. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  183. package/dest/fixtures/setup_l1_contracts.js +0 -17
  184. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  185. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  186. package/dest/fixtures/snapshot_manager.js +0 -505
  187. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  188. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  189. package/src/fixtures/setup_l1_contracts.ts +0 -26
  190. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -6,17 +6,15 @@ import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
6
6
  import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
7
7
 
8
8
  import {
9
- type ISnapshotManager,
10
- type SubsystemsContext,
11
- createSnapshotManager,
9
+ type EndToEndContext,
12
10
  deployAccounts,
13
11
  publicDeployAccounts,
14
- } from '../fixtures/snapshot_manager.js';
15
-
16
- const { E2E_DATA_PATH: dataPath } = process.env;
12
+ setup,
13
+ teardown as teardownSubsystems,
14
+ } from '../fixtures/setup.js';
17
15
 
18
16
  export class NestedContractTest {
19
- private snapshotManager: ISnapshotManager;
17
+ context!: EndToEndContext;
20
18
  logger: Logger;
21
19
  wallet!: Wallet;
22
20
  defaultAccountAddress!: AztecAddress;
@@ -30,67 +28,46 @@ export class NestedContractTest {
30
28
  private numberOfAccounts = 1,
31
29
  ) {
32
30
  this.logger = createLogger(`e2e:e2e_nested_contract:${testName}`);
33
- this.snapshotManager = createSnapshotManager(`e2e_nested_contract/${testName}-${numberOfAccounts}`, dataPath);
34
31
  }
35
32
 
36
33
  /**
37
- * Adds two state shifts to snapshot manager.
38
- * 1. Add 3 accounts.
39
- * 2. Publicly deploy accounts
34
+ * Applies base setup by deploying accounts and publicly deploying them.
40
35
  */
41
- async applyBaseSnapshots() {
42
- await this.snapshotManager.snapshot(
43
- 'accounts',
44
- deployAccounts(this.numberOfAccounts, this.logger),
45
- ({ deployedAccounts }, { wallet, aztecNode }) => {
46
- this.wallet = wallet;
47
- [{ address: this.defaultAccountAddress }] = deployedAccounts;
48
- this.aztecNode = aztecNode;
49
- return Promise.resolve();
50
- },
51
- );
36
+ async applyBaseSetup() {
37
+ this.logger.info('Deploying accounts');
38
+ const { deployedAccounts } = await deployAccounts(
39
+ this.numberOfAccounts,
40
+ this.logger,
41
+ )({
42
+ wallet: this.context.wallet,
43
+ initialFundedAccounts: this.context.initialFundedAccounts,
44
+ });
45
+ this.wallet = this.context.wallet;
46
+ [{ address: this.defaultAccountAddress }] = deployedAccounts;
47
+ this.aztecNode = this.context.aztecNodeService!;
52
48
 
53
- await this.snapshotManager.snapshot(
54
- 'public_deploy',
55
- async () => {},
56
- async () => {
57
- this.logger.verbose(`Public deploy accounts...`);
58
- await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
59
- },
60
- );
49
+ this.logger.info('Public deploy accounts');
50
+ await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
61
51
  }
62
52
 
63
53
  async setup() {
64
- await this.snapshotManager.setup();
54
+ this.logger.info('Setting up fresh subsystems');
55
+ this.context = await setup(0, {
56
+ fundSponsoredFPC: true,
57
+ skipAccountDeployment: true,
58
+ });
59
+ await this.applyBaseSetup();
65
60
  }
66
61
 
67
62
  async teardown() {
68
- await this.snapshotManager.teardown();
63
+ await teardownSubsystems(this.context);
69
64
  }
70
65
 
71
- snapshot = <T>(
72
- name: string,
73
- apply: (context: SubsystemsContext) => Promise<T>,
74
- restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
75
- ): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
76
-
77
- async applyManualSnapshots() {
78
- await this.snapshotManager.snapshot(
79
- 'manual',
80
- async () => {
81
- const parentContract = await ParentContract.deploy(this.wallet)
82
- .send({ from: this.defaultAccountAddress })
83
- .deployed();
84
- const childContract = await ChildContract.deploy(this.wallet)
85
- .send({ from: this.defaultAccountAddress })
86
- .deployed();
87
- return { parentContractAddress: parentContract.address, childContractAddress: childContract.address };
88
- },
89
- ({ parentContractAddress, childContractAddress }) => {
90
- this.parentContract = ParentContract.at(parentContractAddress, this.wallet);
91
- this.childContract = ChildContract.at(childContractAddress, this.wallet);
92
- return Promise.resolve();
93
- },
94
- );
66
+ async applyManual() {
67
+ this.logger.info('Deploying parent and child contracts');
68
+ const parentContract = await ParentContract.deploy(this.wallet).send({ from: this.defaultAccountAddress });
69
+ const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress });
70
+ this.parentContract = parentContract;
71
+ this.childContract = childContract;
95
72
  }
96
73
  }
@@ -1,6 +1,6 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { EthAddress } from '@aztec/aztec.js/addresses';
3
- import { RollupContract } from '@aztec/ethereum';
3
+ import { RollupContract } from '@aztec/ethereum/contracts';
4
4
  import { EpochNumber } from '@aztec/foundation/branded-types';
5
5
 
6
6
  import fs from 'fs';
@@ -24,7 +24,7 @@ const SLASHING_UNIT = BigInt(1e18);
24
24
  const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
25
25
 
26
26
  // How many epochs it may take to set everything up, so we dont slash during this period
27
- const SETUP_EPOCH_DURATION = 5;
27
+ const SETUP_EPOCH_DURATION = 8;
28
28
 
29
29
  export class P2PInactivityTest {
30
30
  public nodes!: AztecNodeService[];
@@ -82,8 +82,8 @@ export class P2PInactivityTest {
82
82
  }
83
83
 
84
84
  public async setup() {
85
- await this.test.applyBaseSnapshots();
86
85
  await this.test.setup();
86
+ await this.test.applyBaseSetup();
87
87
 
88
88
  // Set slashing penalties for inactivity
89
89
  const { rollup } = await this.test.getContracts();
@@ -98,13 +98,13 @@ export class P2PInactivityTest {
98
98
  this.rollup = rollup;
99
99
 
100
100
  if (!this.keepInitialNode) {
101
- await this.test.ctx.aztecNode.stop();
101
+ await this.test.ctx.aztecNodeService!.stop();
102
102
  }
103
103
 
104
104
  // Create all active nodes
105
105
  this.activeNodes = await createNodes(
106
106
  this.test.ctx.aztecNodeConfig,
107
- this.test.ctx.dateProvider,
107
+ this.test.ctx.dateProvider!,
108
108
  this.test.bootstrapNodeEnr,
109
109
  NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
110
110
  BOOT_NODE_UDP_PORT,
@@ -118,7 +118,7 @@ export class P2PInactivityTest {
118
118
  const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
119
119
  this.inactiveNodes = await createNodes(
120
120
  inactiveConfig,
121
- this.test.ctx.dateProvider,
121
+ this.test.ctx.dateProvider!,
122
122
  this.test.bootstrapNodeEnr,
123
123
  this.inactiveNodeCount,
124
124
  BOOT_NODE_UDP_PORT,
@@ -129,7 +129,7 @@ export class P2PInactivityTest {
129
129
  );
130
130
 
131
131
  this.nodes = [
132
- ...(this.keepInitialNode ? [this.test.ctx.aztecNode] : []),
132
+ ...(this.keepInitialNode ? [this.test.ctx.aztecNodeService!] : []),
133
133
  ...this.activeNodes,
134
134
  ...this.inactiveNodes,
135
135
  ];
@@ -151,11 +151,8 @@ export class P2PInactivityTest {
151
151
  // This prevents race conditions where validators propose blocks before the network is ready
152
152
  await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
153
153
 
154
- const ethereumSlotDuration = this.test.ctx.aztecNodeConfig.ethereumSlotDuration!;
155
- this.test.logger.warn(`Advancing to the L1 slot before epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
156
- await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION + 1), {
157
- offset: -ethereumSlotDuration,
158
- });
154
+ this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION - 1} (slashing will start after it is completed)`);
155
+ await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION - 1));
159
156
 
160
157
  return this;
161
158
  }