@aztec/end-to-end 0.0.1-commit.9b94fc1 → 0.0.1-commit.9ee6fcc6

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 (267) 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 +15 -16
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +136 -141
  7. package/dest/bench/client_flows/config.d.ts +2 -2
  8. package/dest/bench/client_flows/config.d.ts.map +1 -1
  9. package/dest/bench/client_flows/config.js +18 -0
  10. package/dest/bench/client_flows/data_extractor.js +3 -1
  11. package/dest/bench/utils.d.ts +9 -8
  12. package/dest/bench/utils.d.ts.map +1 -1
  13. package/dest/bench/utils.js +31 -19
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +9 -8
  15. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +107 -113
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +20 -14
  18. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +92 -71
  20. package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
  21. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  22. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  23. package/dest/e2e_epochs/epochs_test.d.ts +27 -15
  24. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  25. package/dest/e2e_epochs/epochs_test.js +104 -52
  26. package/dest/e2e_fees/bridging_race.notest.js +4 -6
  27. package/dest/e2e_fees/fees_test.d.ts +21 -17
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +137 -145
  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 +14 -16
  33. package/dest/e2e_multi_validator/utils.js +1 -1
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  35. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  36. package/dest/e2e_nested_contract/nested_contract_test.js +30 -40
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
  38. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  39. package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
  40. package/dest/e2e_p2p/p2p_network.d.ts +17 -14
  41. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  42. package/dest/e2e_p2p/p2p_network.js +141 -115
  43. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  44. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  45. package/dest/e2e_p2p/reqresp/utils.js +190 -0
  46. package/dest/e2e_p2p/shared.d.ts +27 -7
  47. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  48. package/dest/e2e_p2p/shared.js +50 -22
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  54. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  55. package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
  56. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  57. package/dest/e2e_token_contract/token_contract_test.js +100 -92
  58. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  59. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  60. package/dest/fixtures/authwit_proxy.js +30 -0
  61. package/dest/fixtures/e2e_prover_test.d.ts +16 -23
  62. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  63. package/dest/fixtures/e2e_prover_test.js +117 -138
  64. package/dest/fixtures/elu_monitor.d.ts +21 -0
  65. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  66. package/dest/fixtures/elu_monitor.js +102 -0
  67. package/dest/fixtures/fixtures.d.ts +6 -3
  68. package/dest/fixtures/fixtures.d.ts.map +1 -1
  69. package/dest/fixtures/fixtures.js +8 -3
  70. package/dest/fixtures/get_acvm_config.js +1 -1
  71. package/dest/fixtures/get_bb_config.d.ts +1 -1
  72. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  73. package/dest/fixtures/get_bb_config.js +5 -5
  74. package/dest/fixtures/ha_setup.d.ts +71 -0
  75. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  76. package/dest/fixtures/ha_setup.js +116 -0
  77. package/dest/fixtures/index.d.ts +2 -1
  78. package/dest/fixtures/index.d.ts.map +1 -1
  79. package/dest/fixtures/index.js +1 -0
  80. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  81. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  82. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  83. package/dest/fixtures/setup.d.ts +239 -0
  84. package/dest/fixtures/setup.d.ts.map +1 -0
  85. package/dest/fixtures/setup.js +608 -0
  86. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  87. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  88. package/dest/fixtures/setup_p2p_test.js +43 -32
  89. package/dest/fixtures/token_utils.d.ts +2 -2
  90. package/dest/fixtures/token_utils.d.ts.map +1 -1
  91. package/dest/fixtures/token_utils.js +12 -8
  92. package/dest/fixtures/utils.d.ts +5 -637
  93. package/dest/fixtures/utils.d.ts.map +1 -1
  94. package/dest/fixtures/utils.js +4 -647
  95. package/dest/fixtures/web3signer.js +1 -1
  96. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  97. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  98. package/dest/fixtures/with_telemetry_utils.js +2 -2
  99. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  100. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  101. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  102. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  103. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  104. package/dest/quality_of_service/prometheus_client.js +67 -0
  105. package/dest/shared/cross_chain_test_harness.d.ts +18 -6
  106. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  107. package/dest/shared/cross_chain_test_harness.js +27 -27
  108. package/dest/shared/gas_portal_test_harness.d.ts +12 -2
  109. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  110. package/dest/shared/gas_portal_test_harness.js +3 -3
  111. package/dest/shared/index.d.ts +3 -2
  112. package/dest/shared/index.d.ts.map +1 -1
  113. package/dest/shared/index.js +1 -0
  114. package/dest/shared/jest_setup.js +41 -1
  115. package/dest/shared/mock_state_view.d.ts +86 -0
  116. package/dest/shared/mock_state_view.d.ts.map +1 -0
  117. package/dest/shared/mock_state_view.js +186 -0
  118. package/dest/shared/submit-transactions.d.ts +4 -4
  119. package/dest/shared/submit-transactions.d.ts.map +1 -1
  120. package/dest/shared/submit-transactions.js +9 -11
  121. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  122. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  123. package/dest/shared/uniswap_l1_l2.js +58 -39
  124. package/dest/simulators/lending_simulator.d.ts +6 -2
  125. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  126. package/dest/simulators/lending_simulator.js +6 -6
  127. package/dest/simulators/token_simulator.d.ts +1 -1
  128. package/dest/simulators/token_simulator.d.ts.map +1 -1
  129. package/dest/simulators/token_simulator.js +3 -24
  130. package/dest/spartan/setup_test_wallets.d.ts +15 -5
  131. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  132. package/dest/spartan/setup_test_wallets.js +109 -38
  133. package/dest/spartan/tx_metrics.d.ts +88 -0
  134. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  135. package/dest/spartan/tx_metrics.js +422 -0
  136. package/dest/spartan/utils/bot.d.ts +28 -0
  137. package/dest/spartan/utils/bot.d.ts.map +1 -0
  138. package/dest/spartan/utils/bot.js +142 -0
  139. package/dest/spartan/utils/chaos.d.ts +79 -0
  140. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  141. package/dest/spartan/utils/chaos.js +142 -0
  142. package/dest/spartan/utils/clients.d.ts +39 -0
  143. package/dest/spartan/utils/clients.d.ts.map +1 -0
  144. package/dest/spartan/utils/clients.js +90 -0
  145. package/dest/spartan/utils/config.d.ts +45 -0
  146. package/dest/spartan/utils/config.d.ts.map +1 -0
  147. package/dest/spartan/utils/config.js +23 -0
  148. package/dest/spartan/utils/health.d.ts +63 -0
  149. package/dest/spartan/utils/health.d.ts.map +1 -0
  150. package/dest/spartan/utils/health.js +202 -0
  151. package/dest/spartan/utils/helm.d.ts +15 -0
  152. package/dest/spartan/utils/helm.d.ts.map +1 -0
  153. package/dest/spartan/utils/helm.js +47 -0
  154. package/dest/spartan/utils/index.d.ts +11 -0
  155. package/dest/spartan/utils/index.d.ts.map +1 -0
  156. package/dest/spartan/utils/index.js +22 -0
  157. package/dest/spartan/utils/k8s.d.ts +128 -0
  158. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  159. package/dest/spartan/utils/k8s.js +381 -0
  160. package/dest/spartan/utils/nodes.d.ts +40 -0
  161. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  162. package/dest/spartan/utils/nodes.js +461 -0
  163. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  164. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  165. package/dest/spartan/utils/pod_logs.js +74 -0
  166. package/dest/spartan/utils/scripts.d.ts +30 -0
  167. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  168. package/dest/spartan/utils/scripts.js +81 -0
  169. package/dest/spartan/utils.d.ts +2 -218
  170. package/dest/spartan/utils.d.ts.map +1 -1
  171. package/dest/spartan/utils.js +1 -749
  172. package/dest/test-wallet/test_wallet.d.ts +76 -0
  173. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  174. package/dest/test-wallet/test_wallet.js +214 -0
  175. package/dest/test-wallet/utils.d.ts +41 -0
  176. package/dest/test-wallet/utils.d.ts.map +1 -0
  177. package/dest/test-wallet/utils.js +71 -0
  178. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  179. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  180. package/dest/test-wallet/wallet_worker_script.js +48 -0
  181. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  182. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  183. package/dest/test-wallet/worker_wallet.js +151 -0
  184. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  185. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  186. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  187. package/package.json +48 -45
  188. package/src/bench/client_flows/benchmark.ts +24 -2
  189. package/src/bench/client_flows/client_flows_benchmark.ts +156 -215
  190. package/src/bench/client_flows/config.ts +9 -1
  191. package/src/bench/client_flows/data_extractor.ts +1 -1
  192. package/src/bench/utils.ts +36 -21
  193. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +120 -145
  194. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -126
  195. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  196. package/src/e2e_epochs/epochs_test.ts +172 -111
  197. package/src/e2e_fees/bridging_race.notest.ts +5 -11
  198. package/src/e2e_fees/fees_test.ts +178 -228
  199. package/src/e2e_l1_publisher/write_json.ts +16 -16
  200. package/src/e2e_multi_validator/utils.ts +1 -1
  201. package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
  202. package/src/e2e_p2p/inactivity_slash_test.ts +7 -10
  203. package/src/e2e_p2p/p2p_network.ts +204 -181
  204. package/src/e2e_p2p/reqresp/utils.ts +256 -0
  205. package/src/e2e_p2p/shared.ts +87 -29
  206. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  207. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  208. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  209. package/src/e2e_token_contract/token_contract_test.ts +121 -119
  210. package/src/fixtures/authwit_proxy.ts +50 -0
  211. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  212. package/src/fixtures/e2e_prover_test.ts +141 -188
  213. package/src/fixtures/elu_monitor.ts +126 -0
  214. package/src/fixtures/fixtures.ts +12 -5
  215. package/src/fixtures/get_acvm_config.ts +1 -1
  216. package/src/fixtures/get_bb_config.ts +7 -6
  217. package/src/fixtures/ha_setup.ts +186 -0
  218. package/src/fixtures/index.ts +1 -0
  219. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  220. package/src/fixtures/setup.ts +905 -0
  221. package/src/fixtures/setup_p2p_test.ts +43 -47
  222. package/src/fixtures/token_utils.ts +10 -6
  223. package/src/fixtures/utils.ts +27 -966
  224. package/src/fixtures/web3signer.ts +1 -1
  225. package/src/fixtures/with_telemetry_utils.ts +2 -2
  226. package/src/guides/up_quick_start.sh +3 -3
  227. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  228. package/src/quality_of_service/prometheus_client.ts +113 -0
  229. package/src/shared/cross_chain_test_harness.ts +30 -43
  230. package/src/shared/gas_portal_test_harness.ts +3 -3
  231. package/src/shared/index.ts +2 -1
  232. package/src/shared/jest_setup.ts +51 -1
  233. package/src/shared/mock_state_view.ts +188 -0
  234. package/src/shared/submit-transactions.ts +11 -16
  235. package/src/shared/uniswap_l1_l2.ts +86 -102
  236. package/src/simulators/lending_simulator.ts +11 -7
  237. package/src/simulators/token_simulator.ts +6 -30
  238. package/src/spartan/DEVELOP.md +7 -0
  239. package/src/spartan/setup_test_wallets.ts +167 -27
  240. package/src/spartan/tx_metrics.ts +376 -0
  241. package/src/spartan/utils/bot.ts +188 -0
  242. package/src/spartan/utils/chaos.ts +253 -0
  243. package/src/spartan/utils/clients.ts +100 -0
  244. package/src/spartan/utils/config.ts +29 -0
  245. package/src/spartan/utils/health.ts +255 -0
  246. package/src/spartan/utils/helm.ts +84 -0
  247. package/src/spartan/utils/index.ts +71 -0
  248. package/src/spartan/utils/k8s.ts +535 -0
  249. package/src/spartan/utils/nodes.ts +543 -0
  250. package/src/spartan/utils/pod_logs.ts +99 -0
  251. package/src/spartan/utils/scripts.ts +99 -0
  252. package/src/spartan/utils.ts +1 -942
  253. package/src/test-wallet/test_wallet.ts +294 -0
  254. package/src/test-wallet/utils.ts +112 -0
  255. package/src/test-wallet/wallet_worker_script.ts +60 -0
  256. package/src/test-wallet/worker_wallet.ts +213 -0
  257. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  258. package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
  259. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  260. package/dest/fixtures/setup_l1_contracts.js +0 -17
  261. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  262. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  263. package/dest/fixtures/snapshot_manager.js +0 -505
  264. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  265. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  266. package/src/fixtures/setup_l1_contracts.ts +0 -26
  267. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -8,14 +8,12 @@ import type { AztecNode } from '@aztec/aztec.js/node';
8
8
  import type { Wallet } from '@aztec/aztec.js/wallet';
9
9
  import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
10
10
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
11
- import type { TestWallet } from '@aztec/test-wallet/server';
12
11
 
13
- import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
14
-
15
- const { E2E_DATA_PATH: dataPath } = process.env;
12
+ import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
13
+ import type { TestWallet } from '../test-wallet/test_wallet.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>(
@@ -1,3 +1,4 @@
1
+ import type { Archiver } from '@aztec/archiver';
1
2
  import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
2
3
  import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
3
4
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
@@ -6,29 +7,28 @@ import type { Logger } from '@aztec/aztec.js/log';
6
7
  import { MerkleTreeId } from '@aztec/aztec.js/trees';
7
8
  import type { Wallet } from '@aztec/aztec.js/wallet';
8
9
  import { EpochCache } from '@aztec/epoch-cache';
9
- import { DefaultL1ContractsConfig, type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
10
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
11
+ import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
10
12
  import { RollupContract } from '@aztec/ethereum/contracts';
11
- import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
12
- import { EpochNumber } from '@aztec/foundation/branded-types';
13
+ import { Delayer, createDelayer, waitUntilL1Timestamp, wrapClientWithDelayer } from '@aztec/ethereum/l1-tx-utils';
14
+ import { ChainMonitor } from '@aztec/ethereum/test';
15
+ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
16
+ import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
13
17
  import { SecretValue } from '@aztec/foundation/config';
14
- import { randomBytes } from '@aztec/foundation/crypto';
15
- import { withLogNameSuffix } from '@aztec/foundation/log';
18
+ import { randomBytes } from '@aztec/foundation/crypto/random';
19
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
16
20
  import { retryUntil } from '@aztec/foundation/retry';
17
21
  import { sleep } from '@aztec/foundation/sleep';
18
22
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
23
+ import { TestContract } from '@aztec/noir-test-contracts.js/Test';
19
24
  import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
20
- import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
21
- import type { TestProverNode } from '@aztec/prover-node/test';
22
- import {
23
- type SequencerClient,
24
- type SequencerEvents,
25
- type SequencerPublisher,
26
- SequencerState,
27
- } from '@aztec/sequencer-client';
28
- import type { TestSequencerClient } from '@aztec/sequencer-client/test';
29
- import { EthAddress, type L2BlockNumber } from '@aztec/stdlib/block';
25
+ import type { ProverNodeConfig } from '@aztec/prover-node';
26
+ import type { PXEConfig } from '@aztec/pxe/config';
27
+ import { type SequencerClient, type SequencerEvents, SequencerState } from '@aztec/sequencer-client';
28
+ import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
30
29
  import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
31
30
  import { tryStop } from '@aztec/stdlib/interfaces/server';
31
+ import type { SlashingProtectionDatabase } from '@aztec/validator-ha-signer/types';
32
32
 
33
33
  import { join } from 'path';
34
34
  import type { Hex } from 'viem';
@@ -42,12 +42,16 @@ import {
42
42
  setup,
43
43
  } from '../fixtures/utils.js';
44
44
 
45
- export const WORLD_STATE_BLOCK_HISTORY = 2;
45
+ export const WORLD_STATE_CHECKPOINT_HISTORY = 2;
46
46
  export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
47
47
  export const ARCHIVER_POLL_INTERVAL = 50;
48
48
  export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
49
49
 
50
- export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
50
+ export type EpochsTestOpts = Partial<SetupOptions> & {
51
+ numberOfAccounts?: number;
52
+ pxeOpts?: Partial<PXEConfig>;
53
+ aztecSlotDurationInL1Slots?: number;
54
+ };
51
55
 
52
56
  export type TrackedSequencerEvent = {
53
57
  [K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
@@ -73,7 +77,7 @@ export class EpochsTestContext {
73
77
  public proverDelayer!: Delayer;
74
78
  public sequencerDelayer!: Delayer;
75
79
 
76
- public proverNodes: ProverNode[] = [];
80
+ public proverNodes: AztecNodeService[] = [];
77
81
  public nodes: AztecNodeService[] = [];
78
82
 
79
83
  public epochDuration!: number;
@@ -92,46 +96,63 @@ export class EpochsTestContext {
92
96
  ? parseInt(process.env.L1_BLOCK_TIME)
93
97
  : DEFAULT_L1_BLOCK_TIME;
94
98
  const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
95
- const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
99
+ const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
96
100
  const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
97
101
  const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
98
- return { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs };
102
+ const l1PublishingTime = opts.l1PublishingTime ?? 1;
103
+ return {
104
+ l1PublishingTime,
105
+ ethereumSlotDuration,
106
+ aztecSlotDuration,
107
+ aztecEpochDuration,
108
+ aztecProofSubmissionEpochs,
109
+ };
99
110
  }
100
111
 
101
112
  public async setup(opts: EpochsTestOpts = {}) {
102
- const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs } =
103
- EpochsTestContext.getSlotDurations(opts);
113
+ const {
114
+ ethereumSlotDuration,
115
+ aztecSlotDuration,
116
+ aztecEpochDuration,
117
+ aztecProofSubmissionEpochs,
118
+ l1PublishingTime,
119
+ } = EpochsTestContext.getSlotDurations(opts);
104
120
 
105
121
  this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
106
122
  this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
107
123
 
108
124
  // Set up system without any account nor protocol contracts
109
125
  // and with faster block times and shorter epochs.
110
- const context = await setup(opts.numberOfAccounts ?? 0, {
111
- automineL1Setup: true,
112
- checkIntervalMs: 50,
113
- archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
114
- worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
115
- skipProtocolContracts: true,
116
- salt: 1,
117
- aztecEpochDuration,
118
- aztecSlotDuration,
119
- ethereumSlotDuration,
120
- aztecProofSubmissionEpochs,
121
- aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
122
- minTxsPerBlock: 0,
123
- realProofs: false,
124
- startProverNode: true,
125
- proverTestDelayMs: opts.proverTestDelayMs ?? 0,
126
- // We use numeric incremental prover ids for simplicity, but we can switch to
127
- // using the prover's eth address if the proverId is used for something in the rollup contract
128
- // Use numeric EthAddress for deterministic prover id
129
- proverId: EthAddress.fromNumber(1),
130
- worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
131
- exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
132
- slasherFlavor: 'none',
133
- ...opts,
134
- });
126
+ const context = await setup(
127
+ opts.numberOfAccounts ?? 0,
128
+ {
129
+ automineL1Setup: true,
130
+ checkIntervalMs: 50,
131
+ archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
132
+ worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
133
+ aztecEpochDuration,
134
+ aztecSlotDuration,
135
+ ethereumSlotDuration,
136
+ aztecProofSubmissionEpochs,
137
+ aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
138
+ minTxsPerBlock: 0,
139
+ realProofs: false,
140
+ startProverNode: true,
141
+ proverTestDelayMs: opts.proverTestDelayMs ?? 0,
142
+ // We use numeric incremental prover ids for simplicity, but we can switch to
143
+ // using the prover's eth address if the proverId is used for something in the rollup contract
144
+ // Use numeric EthAddress for deterministic prover id
145
+ proverId: EthAddress.fromNumber(1),
146
+ worldStateCheckpointHistory: WORLD_STATE_CHECKPOINT_HISTORY,
147
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
148
+ slasherFlavor: 'none',
149
+ l1PublishingTime,
150
+ ...opts,
151
+ },
152
+ // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
153
+ // Can be overridden via opts.pxeOpts.
154
+ { syncChainTip: 'checkpointed', ...opts.pxeOpts },
155
+ );
135
156
 
136
157
  this.context = context;
137
158
  this.proverNodes = context.proverNode ? [context.proverNode] : [];
@@ -144,17 +165,8 @@ export class EpochsTestContext {
144
165
  // Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
145
166
  this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
146
167
 
147
- // This is hideous.
148
- // We ought to have a definite reference to the l1TxUtils that we're using in both places, provided by the test context.
149
- this.proverDelayer = context.proverNode
150
- ? (((context.proverNode as TestProverNode).publisher as ProverNodePublisher).l1TxUtils as DelayedTxUtils).delayer!
151
- : undefined!;
152
- this.sequencerDelayer = context.sequencer
153
- ? (
154
- ((context.sequencer as TestSequencerClient).sequencer.publisher as SequencerPublisher)
155
- .l1TxUtils as DelayedTxUtils
156
- ).delayer!
157
- : undefined!;
168
+ this.proverDelayer = context.proverDelayer!;
169
+ this.sequencerDelayer = context.sequencerDelayer!;
158
170
 
159
171
  if ((context.proverNode && !this.proverDelayer) || (context.sequencer && !this.sequencerDelayer)) {
160
172
  throw new Error(`Could not find prover or sequencer delayer`);
@@ -169,6 +181,8 @@ export class EpochsTestContext {
169
181
  l1GenesisTime: await this.rollup.getL1GenesisTime(),
170
182
  ethereumSlotDuration,
171
183
  proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
184
+ targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
185
+ rollupManaLimit: Number(await this.rollup.getManaLimit()),
172
186
  };
173
187
 
174
188
  this.logger.info(
@@ -186,20 +200,32 @@ export class EpochsTestContext {
186
200
  public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
187
201
  this.logger.warn('Creating and syncing a simulated prover node...');
188
202
  const proverNodePrivateKey = this.getNextPrivateKey();
189
- const suffix = (this.proverNodes.length + 1).toString();
190
- const proverNode = await withLogNameSuffix(suffix, () =>
203
+ const proverIndex = this.proverNodes.length + 1;
204
+ const { mockGossipSubNetwork } = this.context;
205
+ const { proverNode } = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
191
206
  createAndSyncProverNode(
192
207
  proverNodePrivateKey,
193
- { ...this.context.config },
194
208
  {
195
- dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
196
- proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
209
+ ...this.context.config,
210
+ p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
211
+ proverId: EthAddress.fromNumber(proverIndex),
197
212
  dontStart: opts.dontStart,
198
213
  ...opts,
199
214
  },
200
- this.context.aztecNode,
201
- undefined,
202
- { dateProvider: this.context.dateProvider },
215
+ {
216
+ dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
217
+ },
218
+ {
219
+ dateProvider: this.context.dateProvider,
220
+ p2pClientDeps: {
221
+ p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
222
+ rpcTxProviders: [this.context.aztecNode],
223
+ },
224
+ },
225
+ {
226
+ prefilledPublicData: this.context.prefilledPublicData ?? [],
227
+ dontStart: opts.dontStart,
228
+ },
203
229
  ),
204
230
  );
205
231
  this.proverNodes.push(proverNode);
@@ -213,26 +239,34 @@ export class EpochsTestContext {
213
239
 
214
240
  public createValidatorNode(
215
241
  privateKeys: `0x${string}`[],
216
- opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
242
+ opts: Partial<AztecNodeConfig> & {
243
+ dontStartSequencer?: boolean;
244
+ slashingProtectionDb?: SlashingProtectionDatabase;
245
+ } = {},
217
246
  ) {
218
247
  this.logger.warn('Creating and syncing a validator node...');
219
248
  return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
220
249
  }
221
250
 
222
251
  private async createNode(
223
- opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
252
+ opts: Partial<AztecNodeConfig> & {
253
+ dontStartSequencer?: boolean;
254
+ slashingProtectionDb?: SlashingProtectionDatabase;
255
+ } = {},
224
256
  ) {
225
- const suffix = (this.nodes.length + 1).toString();
257
+ const nodeIndex = this.nodes.length + 1;
258
+ const actorPrefix = opts.disableValidator ? 'node' : 'validator';
226
259
  const { mockGossipSubNetwork } = this.context;
227
260
  const resolvedConfig = { ...this.context.config, ...opts };
228
261
  const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
229
262
  const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
230
- const node = await withLogNameSuffix(suffix, () =>
263
+ const node = await withLoggerBindings({ actor: `${actorPrefix}-${nodeIndex}` }, () =>
231
264
  AztecNodeService.createAndSync(
232
265
  {
233
266
  ...resolvedConfig,
234
267
  dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
235
268
  validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
269
+ nodeId: resolvedConfig.nodeId || `${actorPrefix}-${nodeIndex}`,
236
270
  p2pEnabled,
237
271
  p2pIp,
238
272
  },
@@ -241,6 +275,7 @@ export class EpochsTestContext {
241
275
  p2pClientDeps: {
242
276
  p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined,
243
277
  },
278
+ slashingProtectionDb: opts.slashingProtectionDb,
244
279
  },
245
280
  {
246
281
  prefilledPublicData: this.context.prefilledPublicData,
@@ -249,26 +284,6 @@ export class EpochsTestContext {
249
284
  ),
250
285
  );
251
286
 
252
- // REFACTOR: We're getting too much into the internals of the sequencer here.
253
- // We should have a single method for constructing an aztec node that returns a TestAztecNodeService
254
- // which directly exposes the delayer and sets any test config.
255
- if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
256
- this.logger.info(
257
- `Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`,
258
- );
259
- // Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
260
- // The delayer needs a wallet (a client that can sign), so we have to create one here.
261
- const l1Client = createExtendedL1Client(
262
- resolvedConfig.l1RpcUrls!,
263
- resolvedConfig.publisherPrivateKeys![0]!.getValue(),
264
- );
265
- const sequencer = node.getSequencer() as TestSequencerClient;
266
- const publisher = sequencer.sequencer.publisher;
267
- const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
268
- delayed.delayer!.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
269
- publisher.l1TxUtils = delayed;
270
- }
271
-
272
287
  this.nodes.push(node);
273
288
  return node;
274
289
  }
@@ -291,21 +306,21 @@ export class EpochsTestContext {
291
306
  return start;
292
307
  }
293
308
 
294
- /** Waits until the given L2 block number is mined. */
295
- public async waitUntilL2BlockNumber(target: number, timeout = 60) {
309
+ /** Waits until the given checkpoint number is mined. */
310
+ public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 120) {
296
311
  await retryUntil(
297
312
  () => Promise.resolve(target <= this.monitor.checkpointNumber),
298
- `Wait until L2 block ${target}`,
313
+ `Wait until checkpoint ${target}`,
299
314
  timeout,
300
315
  0.1,
301
316
  );
302
317
  }
303
318
 
304
- /** Waits until the given L2 block number is marked as proven. */
305
- public async waitUntilProvenL2BlockNumber(t: number, timeout = 60) {
319
+ /** Waits until the given checkpoint number is marked as proven. */
320
+ public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 120) {
306
321
  await retryUntil(
307
- () => Promise.resolve(t <= this.monitor.provenCheckpointNumber),
308
- `Wait proven L2 block ${t}`,
322
+ () => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
323
+ `Wait proven checkpoint ${target}`,
309
324
  timeout,
310
325
  0.1,
311
326
  );
@@ -320,11 +335,14 @@ export class EpochsTestContext {
320
335
  this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
321
336
  oneSlotBefore,
322
337
  });
323
- await waitUntilL1Timestamp(this.l1Client, oneSlotBefore);
338
+ // Use a timeout that accounts for the full proof submission window
339
+ const proofSubmissionWindowDuration =
340
+ this.constants.proofSubmissionEpochs * this.epochDuration * this.L2_SLOT_DURATION_IN_S;
341
+ await waitUntilL1Timestamp(this.l1Client, oneSlotBefore, undefined, proofSubmissionWindowDuration * 2);
324
342
  }
325
343
 
326
344
  /** Waits for the aztec node to sync to the target block number. */
327
- public async waitForNodeToSync(blockNumber: number, type: 'proven' | 'finalized' | 'historic') {
345
+ public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
328
346
  const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
329
347
  let synched = false;
330
348
  while (!synched) {
@@ -335,7 +353,7 @@ export class EpochsTestContext {
335
353
  ]);
336
354
  this.logger.info(`Wait for node synch ${blockNumber} ${type}`, { blockNumber, type, syncState, tips });
337
355
  if (type === 'proven') {
338
- synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
356
+ synched = tips.proven.block.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
339
357
  } else if (type === 'finalized') {
340
358
  synched = syncState.finalizedBlockNumber >= blockNumber;
341
359
  } else {
@@ -357,23 +375,34 @@ export class EpochsTestContext {
357
375
  return SpamContract.at(instance.address, wallet);
358
376
  }
359
377
 
378
+ /** Registers the TestContract on the given wallet. */
379
+ public async registerTestContract(wallet: Wallet, salt = Fr.ZERO) {
380
+ const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
381
+ constructorArgs: [],
382
+ constructorArtifact: undefined,
383
+ salt,
384
+ publicKeys: undefined,
385
+ deployer: undefined,
386
+ });
387
+ await wallet.registerContract(instance, TestContract.artifact);
388
+ return TestContract.at(instance.address, wallet);
389
+ }
390
+
360
391
  /** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
361
392
  public async createL1Client() {
362
- const { client, delayer } = withDelayer(
363
- createExtendedL1Client(
364
- [...this.l1Client.chain.rpcUrls.default.http],
365
- privateKeyToAccount(this.getNextPrivateKey()),
366
- this.l1Client.chain,
367
- ),
368
- this.context.dateProvider!,
369
- { ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
393
+ const rawClient = createExtendedL1Client(
394
+ [...this.l1Client.chain.rpcUrls.default.http],
395
+ privateKeyToAccount(this.getNextPrivateKey()),
396
+ this.l1Client.chain,
370
397
  );
398
+ const delayer = createDelayer(this.context.dateProvider, { ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S }, {});
399
+ const client = wrapClientWithDelayer(rawClient, delayer);
371
400
  expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
372
401
  return { client, delayer };
373
402
  }
374
403
 
375
404
  /** Verifies whether the given block number is found on the aztec node. */
376
- public async verifyHistoricBlock(blockNumber: L2BlockNumber, expectedSuccess: boolean) {
405
+ public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
377
406
  // We use `findLeavesIndexes` here, but could use any function that queries the world-state
378
407
  // at a particular block, so we know whether that historic block is available or has been
379
408
  // pruned. Note that `getBlock` would not work here, since it only hits the archiver.
@@ -384,6 +413,38 @@ export class EpochsTestContext {
384
413
  expect(result).toBe(expectedSuccess);
385
414
  }
386
415
 
416
+ /** Verifies at least one checkpoint has the target number of blocks (for MBPS validation). */
417
+ public async assertMultipleBlocksPerSlot(targetBlockCount: number) {
418
+ const archiver = (this.context.aztecNode as AztecNodeService).getBlockSource() as Archiver;
419
+ const checkpoints = await archiver.getCheckpoints(CheckpointNumber(1), 50);
420
+
421
+ this.logger.warn(`Retrieved ${checkpoints.length} checkpoints from archiver`, {
422
+ checkpoints: checkpoints.map(pc => pc.checkpoint.getStats()),
423
+ });
424
+
425
+ let expectedBlockNumber = checkpoints[0].checkpoint.blocks[0].number;
426
+ let targetFound = false;
427
+
428
+ for (const checkpoint of checkpoints) {
429
+ const blockCount = checkpoint.checkpoint.blocks.length;
430
+ targetFound = targetFound || blockCount >= targetBlockCount;
431
+
432
+ this.logger.verbose(`Checkpoint ${checkpoint.checkpoint.number} has ${blockCount} blocks`, {
433
+ checkpoint: checkpoint.checkpoint.getStats(),
434
+ });
435
+
436
+ for (let i = 0; i < blockCount; i++) {
437
+ const block = checkpoint.checkpoint.blocks[i];
438
+ expect(block.indexWithinCheckpoint).toBe(i);
439
+ expect(block.checkpointNumber).toBe(checkpoint.checkpoint.number);
440
+ expect(block.number).toBe(expectedBlockNumber);
441
+ expectedBlockNumber++;
442
+ }
443
+ }
444
+
445
+ expect(targetFound).toBe(true);
446
+ }
447
+
387
448
  public watchSequencerEvents(
388
449
  sequencers: SequencerClient[],
389
450
  getMetadata: (i: number) => Record<string, any> = () => ({}),
@@ -391,11 +452,11 @@ export class EpochsTestContext {
391
452
  const stateChanges: TrackedSequencerEvent[] = [];
392
453
  const failEvents: TrackedSequencerEvent[] = [];
393
454
 
394
- // Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
455
+ // Note we do not include the 'block-tx-count-check-failed' event here, since it is fine if we dont build
395
456
  // due to lack of txs available.
396
457
  const failEventsKeys: (keyof SequencerEvents)[] = [
397
458
  'block-build-failed',
398
- 'block-publish-failed',
459
+ 'checkpoint-publish-failed',
399
460
  'proposer-rollup-check-failed',
400
461
  ];
401
462
 
@@ -1,14 +1,14 @@
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
- import type { TestWallet } from '@aztec/test-wallet/server';
8
7
 
9
8
  import { jest } from '@jest/globals';
10
9
  import type { Hex } from 'viem';
11
10
 
11
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
12
12
  import { FeesTest } from './fees_test.js';
13
13
 
14
14
  jest.setTimeout(300_000);
@@ -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 () => {
@@ -70,10 +67,7 @@ describe('e2e_fees bridging_race', () => {
70
67
  // Yes, we need to REFACTOR it at some point
71
68
  const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
72
69
  const { claimSecret: secret, messageLeafIndex: index } = claim;
73
- await t.feeJuiceContract.methods
74
- .claim(bobsAddress, claim.claimAmount, secret, index)
75
- .send({ from: bobsAddress })
76
- .wait();
70
+ await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({ from: bobsAddress });
77
71
  const [balance] = await t.getGasBalanceFn(bobsAddress);
78
72
  expect(balance).toEqual(claim.claimAmount);
79
73
  });