@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.c31f2472

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 (209) 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 +21 -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 +129 -119
  7. package/dest/bench/client_flows/config.d.ts +1 -1
  8. package/dest/bench/client_flows/data_extractor.d.ts +1 -1
  9. package/dest/bench/client_flows/data_extractor.js +7 -27
  10. package/dest/bench/utils.d.ts +8 -7
  11. package/dest/bench/utils.d.ts.map +1 -1
  12. package/dest/bench/utils.js +27 -18
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -7
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  15. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +96 -112
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +19 -13
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  18. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +91 -70
  19. package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
  20. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  21. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  22. package/dest/e2e_epochs/epochs_test.d.ts +17 -9
  23. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  24. package/dest/e2e_epochs/epochs_test.js +48 -23
  25. package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
  26. package/dest/e2e_fees/bridging_race.notest.js +5 -7
  27. package/dest/e2e_fees/fees_test.d.ts +20 -16
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +127 -139
  30. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  31. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  32. package/dest/e2e_l1_publisher/write_json.js +18 -19
  33. package/dest/e2e_multi_validator/utils.d.ts +1 -1
  34. package/dest/e2e_multi_validator/utils.js +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  36. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  37. package/dest/e2e_nested_contract/nested_contract_test.js +31 -38
  38. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  39. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  40. package/dest/e2e_p2p/inactivity_slash_test.js +7 -6
  41. package/dest/e2e_p2p/p2p_network.d.ts +225 -18
  42. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  43. package/dest/e2e_p2p/p2p_network.js +121 -110
  44. package/dest/e2e_p2p/shared.d.ts +11 -11
  45. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  46. package/dest/e2e_p2p/shared.js +15 -21
  47. package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
  48. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  49. package/dest/e2e_token_contract/token_contract_test.js +89 -91
  50. package/dest/fixtures/e2e_prover_test.d.ts +12 -18
  51. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  52. package/dest/fixtures/e2e_prover_test.js +101 -109
  53. package/dest/fixtures/fixtures.d.ts +2 -3
  54. package/dest/fixtures/fixtures.d.ts.map +1 -1
  55. package/dest/fixtures/fixtures.js +2 -3
  56. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  57. package/dest/fixtures/get_acvm_config.js +1 -1
  58. package/dest/fixtures/get_bb_config.d.ts +1 -1
  59. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  60. package/dest/fixtures/index.d.ts +1 -1
  61. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  62. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  63. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  64. package/dest/fixtures/logging.d.ts +1 -1
  65. package/dest/fixtures/setup.d.ts +218 -0
  66. package/dest/fixtures/setup.d.ts.map +1 -0
  67. package/dest/fixtures/setup.js +695 -0
  68. package/dest/fixtures/setup_p2p_test.d.ts +6 -7
  69. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  70. package/dest/fixtures/setup_p2p_test.js +41 -28
  71. package/dest/fixtures/token_utils.d.ts +5 -2
  72. package/dest/fixtures/token_utils.d.ts.map +1 -1
  73. package/dest/fixtures/token_utils.js +13 -7
  74. package/dest/fixtures/utils.d.ts +5 -192
  75. package/dest/fixtures/utils.d.ts.map +1 -1
  76. package/dest/fixtures/utils.js +4 -648
  77. package/dest/fixtures/web3signer.d.ts +1 -1
  78. package/dest/fixtures/web3signer.js +1 -1
  79. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  80. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  81. package/dest/fixtures/with_telemetry_utils.js +2 -2
  82. package/dest/index.d.ts +1 -1
  83. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  84. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  85. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  86. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  87. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  88. package/dest/quality_of_service/prometheus_client.js +67 -0
  89. package/dest/shared/cross_chain_test_harness.d.ts +7 -6
  90. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  91. package/dest/shared/cross_chain_test_harness.js +14 -14
  92. package/dest/shared/gas_portal_test_harness.d.ts +2 -2
  93. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  94. package/dest/shared/gas_portal_test_harness.js +2 -2
  95. package/dest/shared/index.d.ts +2 -2
  96. package/dest/shared/index.d.ts.map +1 -1
  97. package/dest/shared/jest_setup.d.ts +1 -1
  98. package/dest/shared/submit-transactions.d.ts +3 -3
  99. package/dest/shared/submit-transactions.d.ts.map +1 -1
  100. package/dest/shared/submit-transactions.js +9 -11
  101. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  102. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  103. package/dest/shared/uniswap_l1_l2.js +55 -35
  104. package/dest/simulators/index.d.ts +1 -1
  105. package/dest/simulators/lending_simulator.d.ts +2 -2
  106. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  107. package/dest/simulators/lending_simulator.js +6 -4
  108. package/dest/simulators/token_simulator.d.ts +1 -1
  109. package/dest/simulators/token_simulator.d.ts.map +1 -1
  110. package/dest/spartan/setup_test_wallets.d.ts +8 -5
  111. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  112. package/dest/spartan/setup_test_wallets.js +85 -23
  113. package/dest/spartan/tx_metrics.d.ts +88 -0
  114. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  115. package/dest/spartan/tx_metrics.js +422 -0
  116. package/dest/spartan/utils/bot.d.ts +27 -0
  117. package/dest/spartan/utils/bot.d.ts.map +1 -0
  118. package/dest/spartan/utils/bot.js +141 -0
  119. package/dest/spartan/utils/chaos.d.ts +79 -0
  120. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  121. package/dest/spartan/utils/chaos.js +142 -0
  122. package/dest/spartan/utils/clients.d.ts +39 -0
  123. package/dest/spartan/utils/clients.d.ts.map +1 -0
  124. package/dest/spartan/utils/clients.js +90 -0
  125. package/dest/spartan/utils/config.d.ts +36 -0
  126. package/dest/spartan/utils/config.d.ts.map +1 -0
  127. package/dest/spartan/utils/config.js +20 -0
  128. package/dest/spartan/utils/health.d.ts +63 -0
  129. package/dest/spartan/utils/health.d.ts.map +1 -0
  130. package/dest/spartan/utils/health.js +202 -0
  131. package/dest/spartan/utils/helm.d.ts +15 -0
  132. package/dest/spartan/utils/helm.d.ts.map +1 -0
  133. package/dest/spartan/utils/helm.js +47 -0
  134. package/dest/spartan/utils/index.d.ts +9 -0
  135. package/dest/spartan/utils/index.d.ts.map +1 -0
  136. package/dest/spartan/utils/index.js +18 -0
  137. package/dest/spartan/utils/k8s.d.ts +98 -0
  138. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  139. package/dest/spartan/utils/k8s.js +257 -0
  140. package/dest/spartan/utils/nodes.d.ts +31 -0
  141. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  142. package/dest/spartan/utils/nodes.js +290 -0
  143. package/dest/spartan/utils/scripts.d.ts +16 -0
  144. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  145. package/dest/spartan/utils/scripts.js +66 -0
  146. package/dest/spartan/utils.d.ts +2 -218
  147. package/dest/spartan/utils.d.ts.map +1 -1
  148. package/dest/spartan/utils.js +1 -749
  149. package/package.json +43 -40
  150. package/src/bench/client_flows/benchmark.ts +24 -2
  151. package/src/bench/client_flows/client_flows_benchmark.ts +152 -170
  152. package/src/bench/client_flows/data_extractor.ts +6 -28
  153. package/src/bench/utils.ts +30 -20
  154. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +104 -142
  155. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -124
  156. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  157. package/src/e2e_epochs/epochs_test.ts +96 -56
  158. package/src/e2e_fees/bridging_race.notest.ts +5 -11
  159. package/src/e2e_fees/fees_test.ts +180 -219
  160. package/src/e2e_l1_publisher/write_json.ts +20 -19
  161. package/src/e2e_multi_validator/utils.ts +1 -1
  162. package/src/e2e_nested_contract/nested_contract_test.ts +33 -55
  163. package/src/e2e_p2p/inactivity_slash_test.ts +10 -9
  164. package/src/e2e_p2p/p2p_network.ts +181 -180
  165. package/src/e2e_p2p/shared.ts +35 -29
  166. package/src/e2e_token_contract/token_contract_test.ts +103 -118
  167. package/src/fixtures/e2e_prover_test.ts +112 -150
  168. package/src/fixtures/fixtures.ts +2 -5
  169. package/src/fixtures/get_acvm_config.ts +1 -1
  170. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  171. package/src/fixtures/setup.ts +1017 -0
  172. package/src/fixtures/setup_p2p_test.ts +38 -29
  173. package/src/fixtures/token_utils.ts +8 -7
  174. package/src/fixtures/utils.ts +27 -947
  175. package/src/fixtures/web3signer.ts +1 -1
  176. package/src/fixtures/with_telemetry_utils.ts +2 -2
  177. package/src/guides/up_quick_start.sh +1 -1
  178. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  179. package/src/quality_of_service/prometheus_client.ts +113 -0
  180. package/src/shared/cross_chain_test_harness.ts +19 -36
  181. package/src/shared/gas_portal_test_harness.ts +3 -3
  182. package/src/shared/index.ts +1 -1
  183. package/src/shared/submit-transactions.ts +9 -15
  184. package/src/shared/uniswap_l1_l2.ts +65 -86
  185. package/src/simulators/lending_simulator.ts +7 -5
  186. package/src/spartan/DEVELOP.md +7 -0
  187. package/src/spartan/setup_test_wallets.ts +119 -28
  188. package/src/spartan/tx_metrics.ts +376 -0
  189. package/src/spartan/utils/bot.ts +185 -0
  190. package/src/spartan/utils/chaos.ts +253 -0
  191. package/src/spartan/utils/clients.ts +100 -0
  192. package/src/spartan/utils/config.ts +26 -0
  193. package/src/spartan/utils/health.ts +255 -0
  194. package/src/spartan/utils/helm.ts +84 -0
  195. package/src/spartan/utils/index.ts +62 -0
  196. package/src/spartan/utils/k8s.ts +375 -0
  197. package/src/spartan/utils/nodes.ts +323 -0
  198. package/src/spartan/utils/scripts.ts +63 -0
  199. package/src/spartan/utils.ts +1 -942
  200. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  201. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  202. package/dest/fixtures/setup_l1_contracts.js +0 -17
  203. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  204. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  205. package/dest/fixtures/snapshot_manager.js +0 -505
  206. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  207. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  208. package/src/fixtures/setup_l1_contracts.ts +0 -26
  209. 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,66 +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
- async ({ parentContractAddress, childContractAddress }) => {
90
- this.parentContract = await ParentContract.at(parentContractAddress, this.wallet);
91
- this.childContract = await ChildContract.at(childContractAddress, this.wallet);
92
- },
93
- );
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;
94
72
  }
95
73
  }
@@ -1,6 +1,7 @@
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
+ import { EpochNumber } from '@aztec/foundation/branded-types';
4
5
 
5
6
  import fs from 'fs';
6
7
  import 'jest-extended';
@@ -23,7 +24,7 @@ const SLASHING_UNIT = BigInt(1e18);
23
24
  const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
24
25
 
25
26
  // How many epochs it may take to set everything up, so we dont slash during this period
26
- const SETUP_EPOCH_DURATION = 5;
27
+ const SETUP_EPOCH_DURATION = 8;
27
28
 
28
29
  export class P2PInactivityTest {
29
30
  public nodes!: AztecNodeService[];
@@ -81,8 +82,8 @@ export class P2PInactivityTest {
81
82
  }
82
83
 
83
84
  public async setup() {
84
- await this.test.applyBaseSnapshots();
85
85
  await this.test.setup();
86
+ await this.test.applyBaseSetup();
86
87
 
87
88
  // Set slashing penalties for inactivity
88
89
  const { rollup } = await this.test.getContracts();
@@ -97,13 +98,13 @@ export class P2PInactivityTest {
97
98
  this.rollup = rollup;
98
99
 
99
100
  if (!this.keepInitialNode) {
100
- await this.test.ctx.aztecNode.stop();
101
+ await this.test.ctx.aztecNodeService!.stop();
101
102
  }
102
103
 
103
104
  // Create all active nodes
104
105
  this.activeNodes = await createNodes(
105
106
  this.test.ctx.aztecNodeConfig,
106
- this.test.ctx.dateProvider,
107
+ this.test.ctx.dateProvider!,
107
108
  this.test.bootstrapNodeEnr,
108
109
  NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
109
110
  BOOT_NODE_UDP_PORT,
@@ -117,7 +118,7 @@ export class P2PInactivityTest {
117
118
  const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
118
119
  this.inactiveNodes = await createNodes(
119
120
  inactiveConfig,
120
- this.test.ctx.dateProvider,
121
+ this.test.ctx.dateProvider!,
121
122
  this.test.bootstrapNodeEnr,
122
123
  this.inactiveNodeCount,
123
124
  BOOT_NODE_UDP_PORT,
@@ -128,7 +129,7 @@ export class P2PInactivityTest {
128
129
  );
129
130
 
130
131
  this.nodes = [
131
- ...(this.keepInitialNode ? [this.test.ctx.aztecNode] : []),
132
+ ...(this.keepInitialNode ? [this.test.ctx.aztecNodeService!] : []),
132
133
  ...this.activeNodes,
133
134
  ...this.inactiveNodes,
134
135
  ];
@@ -150,8 +151,8 @@ export class P2PInactivityTest {
150
151
  // This prevents race conditions where validators propose blocks before the network is ready
151
152
  await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
152
153
 
153
- this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
154
- await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
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));
155
156
 
156
157
  return this;
157
158
  }