@aztec/end-to-end 0.0.1-commit.7d4e6cd → 0.0.1-commit.858058eac

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 (193) 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 +13 -14
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +118 -133
  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/utils.d.ts +6 -5
  11. package/dest/bench/utils.d.ts.map +1 -1
  12. package/dest/bench/utils.js +9 -7
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -8
  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 +7 -8
  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 +68 -64
  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 +7 -1
  23. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  24. package/dest/e2e_epochs/epochs_test.js +39 -11
  25. package/dest/e2e_fees/bridging_race.notest.js +3 -5
  26. package/dest/e2e_fees/fees_test.d.ts +14 -14
  27. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  28. package/dest/e2e_fees/fees_test.js +122 -140
  29. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  30. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  31. package/dest/e2e_l1_publisher/write_json.js +14 -13
  32. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  33. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  34. package/dest/e2e_nested_contract/nested_contract_test.js +31 -39
  35. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  36. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  37. package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
  38. package/dest/e2e_p2p/p2p_network.d.ts +8 -7
  39. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  40. package/dest/e2e_p2p/p2p_network.js +110 -103
  41. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  42. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  43. package/dest/e2e_p2p/reqresp/utils.js +153 -0
  44. package/dest/e2e_p2p/shared.d.ts +6 -6
  45. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  46. package/dest/e2e_p2p/shared.js +14 -17
  47. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  48. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  53. package/dest/e2e_token_contract/token_contract_test.d.ts +17 -10
  54. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  55. package/dest/e2e_token_contract/token_contract_test.js +89 -91
  56. package/dest/fixtures/e2e_prover_test.d.ts +9 -15
  57. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  58. package/dest/fixtures/e2e_prover_test.js +85 -93
  59. package/dest/fixtures/ha_setup.d.ts +71 -0
  60. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  61. package/dest/fixtures/ha_setup.js +114 -0
  62. package/dest/fixtures/index.d.ts +2 -1
  63. package/dest/fixtures/index.d.ts.map +1 -1
  64. package/dest/fixtures/index.js +1 -0
  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 +631 -0
  68. package/dest/fixtures/setup_p2p_test.d.ts +12 -8
  69. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  70. package/dest/fixtures/setup_p2p_test.js +29 -21
  71. package/dest/fixtures/token_utils.d.ts +1 -1
  72. package/dest/fixtures/token_utils.d.ts.map +1 -1
  73. package/dest/fixtures/token_utils.js +7 -4
  74. package/dest/fixtures/utils.d.ts +5 -191
  75. package/dest/fixtures/utils.d.ts.map +1 -1
  76. package/dest/fixtures/utils.js +4 -615
  77. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  78. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  79. package/dest/quality_of_service/prometheus_client.js +67 -0
  80. package/dest/shared/cross_chain_test_harness.d.ts +14 -4
  81. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  82. package/dest/shared/cross_chain_test_harness.js +11 -11
  83. package/dest/shared/gas_portal_test_harness.d.ts +11 -1
  84. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  85. package/dest/shared/gas_portal_test_harness.js +1 -1
  86. package/dest/shared/submit-transactions.d.ts +4 -4
  87. package/dest/shared/submit-transactions.d.ts.map +1 -1
  88. package/dest/shared/submit-transactions.js +9 -11
  89. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  90. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  91. package/dest/shared/uniswap_l1_l2.js +20 -18
  92. package/dest/simulators/lending_simulator.d.ts +5 -1
  93. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  94. package/dest/simulators/lending_simulator.js +2 -2
  95. package/dest/spartan/setup_test_wallets.d.ts +2 -2
  96. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  97. package/dest/spartan/setup_test_wallets.js +64 -35
  98. package/dest/spartan/tx_metrics.d.ts +51 -2
  99. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  100. package/dest/spartan/tx_metrics.js +333 -6
  101. package/dest/spartan/utils/bot.d.ts +27 -0
  102. package/dest/spartan/utils/bot.d.ts.map +1 -0
  103. package/dest/spartan/utils/bot.js +141 -0
  104. package/dest/spartan/utils/chaos.d.ts +79 -0
  105. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  106. package/dest/spartan/utils/chaos.js +142 -0
  107. package/dest/spartan/utils/clients.d.ts +39 -0
  108. package/dest/spartan/utils/clients.d.ts.map +1 -0
  109. package/dest/spartan/utils/clients.js +90 -0
  110. package/dest/spartan/utils/config.d.ts +39 -0
  111. package/dest/spartan/utils/config.d.ts.map +1 -0
  112. package/dest/spartan/utils/config.js +21 -0
  113. package/dest/spartan/utils/health.d.ts +63 -0
  114. package/dest/spartan/utils/health.d.ts.map +1 -0
  115. package/dest/spartan/utils/health.js +202 -0
  116. package/dest/spartan/utils/helm.d.ts +15 -0
  117. package/dest/spartan/utils/helm.d.ts.map +1 -0
  118. package/dest/spartan/utils/helm.js +47 -0
  119. package/dest/spartan/utils/index.d.ts +9 -0
  120. package/dest/spartan/utils/index.d.ts.map +1 -0
  121. package/dest/spartan/utils/index.js +18 -0
  122. package/dest/spartan/utils/k8s.d.ts +126 -0
  123. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  124. package/dest/spartan/utils/k8s.js +375 -0
  125. package/dest/spartan/utils/nodes.d.ts +41 -0
  126. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  127. package/dest/spartan/utils/nodes.js +461 -0
  128. package/dest/spartan/utils/scripts.d.ts +30 -0
  129. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  130. package/dest/spartan/utils/scripts.js +81 -0
  131. package/dest/spartan/utils.d.ts +2 -253
  132. package/dest/spartan/utils.d.ts.map +1 -1
  133. package/dest/spartan/utils.js +1 -892
  134. package/dest/test-wallet/test_wallet.d.ts +82 -0
  135. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  136. package/dest/test-wallet/test_wallet.js +213 -0
  137. package/dest/test-wallet/utils.d.ts +41 -0
  138. package/dest/test-wallet/utils.d.ts.map +1 -0
  139. package/dest/test-wallet/utils.js +71 -0
  140. package/package.json +44 -39
  141. package/src/bench/client_flows/benchmark.ts +24 -2
  142. package/src/bench/client_flows/client_flows_benchmark.ts +138 -204
  143. package/src/bench/client_flows/config.ts +9 -1
  144. package/src/bench/utils.ts +10 -8
  145. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +105 -143
  146. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +103 -111
  147. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  148. package/src/e2e_epochs/epochs_test.ts +72 -36
  149. package/src/e2e_fees/bridging_race.notest.ts +4 -10
  150. package/src/e2e_fees/fees_test.ts +171 -217
  151. package/src/e2e_l1_publisher/write_json.ts +16 -13
  152. package/src/e2e_nested_contract/nested_contract_test.ts +33 -56
  153. package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
  154. package/src/e2e_p2p/p2p_network.ts +172 -168
  155. package/src/e2e_p2p/reqresp/utils.ts +207 -0
  156. package/src/e2e_p2p/shared.ts +22 -22
  157. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  158. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  159. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  160. package/src/e2e_token_contract/token_contract_test.ts +104 -119
  161. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  162. package/src/fixtures/e2e_prover_test.ts +98 -132
  163. package/src/fixtures/ha_setup.ts +184 -0
  164. package/src/fixtures/index.ts +1 -0
  165. package/src/fixtures/setup.ts +933 -0
  166. package/src/fixtures/setup_p2p_test.ts +31 -27
  167. package/src/fixtures/token_utils.ts +6 -5
  168. package/src/fixtures/utils.ts +27 -901
  169. package/src/quality_of_service/prometheus_client.ts +113 -0
  170. package/src/shared/cross_chain_test_harness.ts +13 -27
  171. package/src/shared/gas_portal_test_harness.ts +1 -1
  172. package/src/shared/submit-transactions.ts +11 -16
  173. package/src/shared/uniswap_l1_l2.ts +21 -30
  174. package/src/simulators/lending_simulator.ts +2 -2
  175. package/src/spartan/setup_test_wallets.ts +75 -25
  176. package/src/spartan/tx_metrics.ts +255 -9
  177. package/src/spartan/utils/bot.ts +185 -0
  178. package/src/spartan/utils/chaos.ts +253 -0
  179. package/src/spartan/utils/clients.ts +100 -0
  180. package/src/spartan/utils/config.ts +27 -0
  181. package/src/spartan/utils/health.ts +255 -0
  182. package/src/spartan/utils/helm.ts +84 -0
  183. package/src/spartan/utils/index.ts +64 -0
  184. package/src/spartan/utils/k8s.ts +527 -0
  185. package/src/spartan/utils/nodes.ts +538 -0
  186. package/src/spartan/utils/scripts.ts +99 -0
  187. package/src/spartan/utils.ts +1 -1158
  188. package/src/test-wallet/test_wallet.ts +296 -0
  189. package/src/test-wallet/utils.ts +112 -0
  190. package/dest/fixtures/snapshot_manager.d.ts +0 -93
  191. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  192. package/dest/fixtures/snapshot_manager.js +0 -488
  193. package/src/fixtures/snapshot_manager.ts +0 -646
@@ -0,0 +1,631 @@
1
+ import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
2
+ import { generateSchnorrAccounts } from '@aztec/accounts/testing';
3
+ import { createArchiver } from '@aztec/archiver';
4
+ import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
5
+ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
6
+ import { BatchCall, getContractClassFromArtifact, waitForProven } from '@aztec/aztec.js/contracts';
7
+ import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
8
+ import { Fr } from '@aztec/aztec.js/fields';
9
+ import { createLogger } from '@aztec/aztec.js/log';
10
+ import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
11
+ import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
12
+ import { SPONSORED_FPC_SALT } from '@aztec/constants';
13
+ import { isAnvilTestChain } from '@aztec/ethereum/chain';
14
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
15
+ import { getL1ContractsConfigEnvVars } from '@aztec/ethereum/config';
16
+ import { NULL_KEY } from '@aztec/ethereum/constants';
17
+ import { deployMulticall3 } from '@aztec/ethereum/contracts';
18
+ import { deployAztecL1Contracts } from '@aztec/ethereum/deploy-aztec-l1-contracts';
19
+ import { DelayedTxUtils, EthCheatCodesWithState, createDelayedL1TxUtilsFromViemWallet, startAnvil } from '@aztec/ethereum/test';
20
+ import { EpochNumber } from '@aztec/foundation/branded-types';
21
+ import { SecretValue } from '@aztec/foundation/config';
22
+ import { randomBytes } from '@aztec/foundation/crypto/random';
23
+ import { tryRmDir } from '@aztec/foundation/fs';
24
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
25
+ import { retryUntil } from '@aztec/foundation/retry';
26
+ import { sleep } from '@aztec/foundation/sleep';
27
+ import { TestDateProvider } from '@aztec/foundation/timer';
28
+ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
29
+ import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
30
+ import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
31
+ import { protocolContractsHash } from '@aztec/protocol-contracts';
32
+ import { createProverNode } from '@aztec/prover-node';
33
+ import { getPXEConfig } from '@aztec/pxe/server';
34
+ import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
35
+ import { tryStop } from '@aztec/stdlib/interfaces/server';
36
+ import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
37
+ import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
38
+ import { deployFundedSchnorrAccounts } from '@aztec/wallets/testing';
39
+ import { getGenesisValues } from '@aztec/world-state/testing';
40
+ import fs from 'fs/promises';
41
+ import { tmpdir } from 'os';
42
+ import path from 'path';
43
+ import { generatePrivateKey, mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
44
+ import { foundry } from 'viem/chains';
45
+ import { TestWallet } from '../test-wallet/test_wallet.js';
46
+ import { MNEMONIC, TEST_MAX_PENDING_TX_POOL_COUNT, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
47
+ import { getACVMConfig } from './get_acvm_config.js';
48
+ import { getBBConfig } from './get_bb_config.js';
49
+ import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
50
+ import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
51
+ export { startAnvil };
52
+ let telemetry = undefined;
53
+ async function getTelemetryClient(partialConfig = {}) {
54
+ if (!telemetry) {
55
+ const config = {
56
+ ...getTelemetryConfig(),
57
+ ...partialConfig
58
+ };
59
+ telemetry = config.benchmark ? new BenchmarkTelemetryClient() : await initTelemetryClient(config);
60
+ }
61
+ return telemetry;
62
+ }
63
+ export const getPrivateKeyFromIndex = (index)=>{
64
+ const hdAccount = mnemonicToAccount(MNEMONIC, {
65
+ addressIndex: index
66
+ });
67
+ const privKeyRaw = hdAccount.getHdKey().privateKey;
68
+ return privKeyRaw === null ? null : Buffer.from(privKeyRaw);
69
+ };
70
+ /**
71
+ * Sets up shared blob storage using FileStore in the data directory.
72
+ */ export async function setupSharedBlobStorage(config) {
73
+ const sharedBlobPath = path.join(config.dataDirectory, 'shared-blobs');
74
+ await fs.mkdir(sharedBlobPath, {
75
+ recursive: true
76
+ });
77
+ config.blobFileStoreUrls = [
78
+ `file://${sharedBlobPath}`
79
+ ];
80
+ config.blobFileStoreUploadUrl = `file://${sharedBlobPath}`;
81
+ }
82
+ /**
83
+ * Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
84
+ * @param aztecNode - An instance of Aztec Node.
85
+ * @param opts - Partial configuration for the PXE.
86
+ * @param logger - The logger to be used.
87
+ * @param actor - Actor label to include in log output (e.g., 'pxe-test').
88
+ * @returns A test wallet, logger and teardown function.
89
+ */ export async function setupPXEAndGetWallet(aztecNode, opts = {}, logger = getLogger(), actor) {
90
+ const PXEConfig = {
91
+ ...getPXEConfig(),
92
+ ...opts
93
+ };
94
+ // For tests we only want proving enabled if specifically requested
95
+ PXEConfig.proverEnabled = !!opts.proverEnabled;
96
+ // If no data directory provided, create a temp directory and clean up afterwards
97
+ const configuredDataDirectory = PXEConfig.dataDirectory;
98
+ if (!configuredDataDirectory) {
99
+ PXEConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
100
+ }
101
+ const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(PXEConfig.dataDirectory);
102
+ const wallet = await TestWallet.create(aztecNode, PXEConfig, {
103
+ loggerActorLabel: actor
104
+ });
105
+ return {
106
+ wallet,
107
+ logger,
108
+ teardown
109
+ };
110
+ }
111
+ /**
112
+ * Sets up the environment for the end-to-end tests.
113
+ * @param numberOfAccounts - The number of new accounts to be created once the PXE is initiated.
114
+ * @param opts - Options to pass to the node initialization and to the setup script.
115
+ * @param pxeOpts - Options to pass to the PXE initialization.
116
+ */ export async function setup(numberOfAccounts = 1, opts = {}, pxeOpts = {}, chain = foundry) {
117
+ let anvil;
118
+ try {
119
+ opts.aztecTargetCommitteeSize ??= 0;
120
+ opts.slasherFlavor ??= 'none';
121
+ const config = {
122
+ ...getConfigEnvVars(),
123
+ ...opts
124
+ };
125
+ // use initialValidators for the node config
126
+ config.validatorPrivateKeys = new SecretValue(opts.initialValidators?.map((v)=>v.privateKey) ?? []);
127
+ config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
128
+ config.maxPendingTxCount = opts.maxPendingTxCount ?? TEST_MAX_PENDING_TX_POOL_COUNT;
129
+ // For tests we only want proving enabled if specifically requested
130
+ config.realProofs = !!opts.realProofs;
131
+ // Only enforce the time table if requested
132
+ config.enforceTimeTable = !!opts.enforceTimeTable;
133
+ config.listenAddress = '127.0.0.1';
134
+ const logger = getLogger();
135
+ // Create a temp directory for any services that need it and cleanup later
136
+ const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
137
+ await fs.mkdir(directoryToCleanup, {
138
+ recursive: true
139
+ });
140
+ if (!config.dataDirectory) {
141
+ config.dataDirectory = directoryToCleanup;
142
+ }
143
+ if (!config.l1RpcUrls?.length) {
144
+ if (!isAnvilTestChain(chain.id)) {
145
+ throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
146
+ }
147
+ const res = await startAnvil({
148
+ l1BlockTime: opts.ethereumSlotDuration,
149
+ accounts: opts.anvilAccounts,
150
+ port: opts.anvilPort ?? (process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT) : undefined)
151
+ });
152
+ anvil = res.anvil;
153
+ config.l1RpcUrls = [
154
+ res.rpcUrl
155
+ ];
156
+ }
157
+ // Enable logging metrics to a local file named after the test suite
158
+ if (isMetricsLoggingRequested()) {
159
+ const filename = path.join('log', getJobName() + '.jsonl');
160
+ logger.info(`Logging metrics to ${filename}`);
161
+ setupMetricsLogger(filename);
162
+ }
163
+ const dateProvider = new TestDateProvider();
164
+ const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls, dateProvider);
165
+ if (opts.stateLoad) {
166
+ await ethCheatCodes.loadChainState(opts.stateLoad);
167
+ }
168
+ if (opts.l1StartTime) {
169
+ await ethCheatCodes.warp(opts.l1StartTime, {
170
+ resetBlockInterval: true
171
+ });
172
+ }
173
+ let publisherPrivKeyHex = undefined;
174
+ let publisherHdAccount = undefined;
175
+ if (opts.l1PublisherKey && opts.l1PublisherKey.getValue() && opts.l1PublisherKey.getValue() != NULL_KEY) {
176
+ publisherPrivKeyHex = opts.l1PublisherKey.getValue();
177
+ publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
178
+ } else if (config.publisherPrivateKeys && config.publisherPrivateKeys.length > 0 && config.publisherPrivateKeys[0].getValue() != NULL_KEY) {
179
+ publisherPrivKeyHex = config.publisherPrivateKeys[0].getValue();
180
+ publisherHdAccount = privateKeyToAccount(publisherPrivKeyHex);
181
+ } else if (!MNEMONIC) {
182
+ throw new Error(`Mnemonic not provided and no publisher private key`);
183
+ } else {
184
+ publisherHdAccount = mnemonicToAccount(MNEMONIC, {
185
+ addressIndex: 0
186
+ });
187
+ const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
188
+ const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
189
+ publisherPrivKeyHex = `0x${publisherPrivKey.toString('hex')}`;
190
+ config.publisherPrivateKeys = [
191
+ new SecretValue(publisherPrivKeyHex)
192
+ ];
193
+ }
194
+ if (config.coinbase === undefined) {
195
+ config.coinbase = EthAddress.fromString(publisherHdAccount.address);
196
+ }
197
+ // Determine which addresses to fund in genesis
198
+ const initialFundedAccounts = opts.initialFundedAccounts ?? await generateSchnorrAccounts(opts.numberOfInitialFundedAccounts ?? Math.max(numberOfAccounts, 10));
199
+ const addressesToFund = initialFundedAccounts.map((a)=>a.address);
200
+ // Optionally fund the sponsored FPC
201
+ if (opts.fundSponsoredFPC) {
202
+ const sponsoredFPCAddress = await getSponsoredFPCAddress();
203
+ addressesToFund.push(sponsoredFPCAddress);
204
+ }
205
+ const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(addressesToFund, opts.initialAccountFeeJuice, opts.genesisPublicData);
206
+ const wasAutomining = await ethCheatCodes.isAutoMining();
207
+ const enableAutomine = opts.automineL1Setup && !wasAutomining && isAnvilTestChain(chain.id);
208
+ if (enableAutomine) {
209
+ await ethCheatCodes.setAutomine(true);
210
+ }
211
+ const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount, chain);
212
+ // Deploy Multicall3 if running locally
213
+ await deployMulticall3(l1Client, logger);
214
+ // Force viem to refresh its nonce cache to avoid "nonce too low" errors in subsequent transactions
215
+ // This is necessary because deployMulticall3 sends multiple transactions and viem may cache a stale nonce
216
+ await l1Client.getTransactionCount({
217
+ address: l1Client.account.address
218
+ });
219
+ const deployL1ContractsValues = await deployAztecL1Contracts(config.l1RpcUrls[0], publisherPrivKeyHex, chain.id, {
220
+ ...getL1ContractsConfigEnvVars(),
221
+ ...opts,
222
+ ...opts.l1ContractsArgs,
223
+ vkTreeRoot: getVKTreeRoot(),
224
+ protocolContractsHash,
225
+ genesisArchiveRoot,
226
+ initialValidators: opts.initialValidators,
227
+ feeJuicePortalInitialBalance: fundingNeeded,
228
+ realVerifier: false
229
+ });
230
+ config.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
231
+ config.rollupVersion = deployL1ContractsValues.rollupVersion;
232
+ if (enableAutomine) {
233
+ await ethCheatCodes.setAutomine(false);
234
+ await ethCheatCodes.setIntervalMining(config.ethereumSlotDuration);
235
+ dateProvider.setTime(await ethCheatCodes.timestamp() * 1000);
236
+ }
237
+ if (opts.l2StartTime) {
238
+ await ethCheatCodes.warp(opts.l2StartTime, {
239
+ resetBlockInterval: true
240
+ });
241
+ }
242
+ const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls, dateProvider), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
243
+ if (!opts.disableAnvilTestWatcher) {
244
+ await watcher.start();
245
+ }
246
+ // Use metricsPort-based telemetry if provided, otherwise use the regular telemetry client
247
+ const telemetryClient = opts.metricsPort ? await getEndToEndTestTelemetryClient(opts.metricsPort) : await getTelemetryClient(opts.telemetryConfig);
248
+ await setupSharedBlobStorage(config);
249
+ logger.verbose('Creating and synching an aztec node', config);
250
+ const acvmConfig = await getACVMConfig(logger);
251
+ if (acvmConfig) {
252
+ config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
253
+ config.acvmBinaryPath = acvmConfig.acvmBinaryPath;
254
+ }
255
+ const bbConfig = await getBBConfig(logger);
256
+ if (bbConfig) {
257
+ config.bbBinaryPath = bbConfig.bbBinaryPath;
258
+ config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
259
+ }
260
+ let mockGossipSubNetwork;
261
+ let p2pClientDeps = undefined;
262
+ if (opts.mockGossipSubNetwork) {
263
+ mockGossipSubNetwork = new MockGossipSubNetwork();
264
+ p2pClientDeps = {
265
+ p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork)
266
+ };
267
+ }
268
+ // Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
269
+ // To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
270
+ // For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
271
+ // If no accounts need deployment, we await an empty block to confirm network progression.
272
+ const originalMinTxsPerBlock = config.minTxsPerBlock;
273
+ if (originalMinTxsPerBlock === undefined) {
274
+ throw new Error('minTxsPerBlock is undefined in e2e test setup');
275
+ }
276
+ // Only set minTxsPerBlock=1 if we're going to deploy accounts and need reliable block inclusion
277
+ const shouldDeployAccounts = numberOfAccounts > 0 && !opts.skipAccountDeployment;
278
+ // Only set minTxsPerBlock=0 if we need an empty block (no accounts at all, not skipped deployment)
279
+ const needsEmptyBlock = numberOfAccounts === 0 && !opts.skipAccountDeployment;
280
+ config.minTxsPerBlock = shouldDeployAccounts ? 1 : needsEmptyBlock ? 0 : originalMinTxsPerBlock;
281
+ config.p2pEnabled = opts.mockGossipSubNetwork || config.p2pEnabled;
282
+ config.p2pIp = opts.p2pIp ?? config.p2pIp ?? '127.0.0.1';
283
+ if (!config.disableValidator) {
284
+ if ((config.validatorPrivateKeys?.getValue().length ?? 0) === 0) {
285
+ config.validatorPrivateKeys = new SecretValue([
286
+ generatePrivateKey()
287
+ ]);
288
+ }
289
+ }
290
+ const aztecNodeService = await withLoggerBindings({
291
+ actor: 'node-0'
292
+ }, ()=>AztecNodeService.createAndSync(config, {
293
+ dateProvider,
294
+ telemetry: telemetryClient,
295
+ p2pClientDeps
296
+ }, {
297
+ prefilledPublicData
298
+ }));
299
+ const sequencerClient = aztecNodeService.getSequencer();
300
+ if (sequencerClient) {
301
+ const publisher = sequencerClient.sequencer.publisher;
302
+ publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration, l1Client);
303
+ }
304
+ let proverNode = undefined;
305
+ if (opts.startProverNode) {
306
+ logger.verbose('Creating and syncing a simulated prover node...');
307
+ const proverNodePrivateKey = getPrivateKeyFromIndex(2);
308
+ const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
309
+ const proverNodeDataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
310
+ const proverNodeConfig = {
311
+ ...config.proverNodeConfig,
312
+ dataDirectory: proverNodeDataDirectory,
313
+ p2pEnabled: !!mockGossipSubNetwork
314
+ };
315
+ proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, proverNodeConfig, aztecNodeService, prefilledPublicData, {
316
+ p2pClientDeps: mockGossipSubNetwork ? {
317
+ p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork)
318
+ } : undefined
319
+ });
320
+ }
321
+ logger.verbose('Creating a pxe...');
322
+ const pxeConfig = {
323
+ ...getPXEConfig(),
324
+ ...pxeOpts
325
+ };
326
+ pxeConfig.dataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
327
+ // For tests we only want proving enabled if specifically requested
328
+ pxeConfig.proverEnabled = !!pxeOpts.proverEnabled;
329
+ const wallet = await TestWallet.create(aztecNodeService, pxeConfig, {
330
+ loggerActorLabel: 'pxe-0'
331
+ });
332
+ if (opts.walletMinFeePadding !== undefined) {
333
+ wallet.setMinFeePadding(opts.walletMinFeePadding);
334
+ }
335
+ const cheatCodes = await CheatCodes.create(config.l1RpcUrls, aztecNodeService, dateProvider);
336
+ if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
337
+ // We need to advance such that the committee is set up.
338
+ await cheatCodes.rollup.advanceToEpoch(EpochNumber.fromBigInt(BigInt(await cheatCodes.rollup.getEpoch()) + BigInt(config.lagInEpochsForValidatorSet + 1)));
339
+ await cheatCodes.rollup.setupEpoch();
340
+ await cheatCodes.rollup.debugRollup();
341
+ }
342
+ let accounts = [];
343
+ if (shouldDeployAccounts) {
344
+ logger.info(`${numberOfAccounts} accounts are being deployed. Reliably progressing past genesis by setting minTxsPerBlock to 1 and waiting for the accounts to be deployed`);
345
+ const accountsData = initialFundedAccounts.slice(0, numberOfAccounts);
346
+ const accountManagers = await deployFundedSchnorrAccounts(wallet, accountsData);
347
+ accounts = accountManagers.map((accountManager)=>accountManager.address);
348
+ } else if (needsEmptyBlock) {
349
+ logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
350
+ while(await aztecNodeService.getBlockNumber() === 0){
351
+ await sleep(2000);
352
+ }
353
+ }
354
+ // If skipAccountDeployment is true, we don't deploy or wait - tests will handle account deployment later
355
+ // Now we restore the original minTxsPerBlock setting if we changed it.
356
+ if (sequencerClient && config.minTxsPerBlock !== originalMinTxsPerBlock) {
357
+ sequencerClient.getSequencer().updateConfig({
358
+ minTxsPerBlock: originalMinTxsPerBlock
359
+ });
360
+ }
361
+ if (initialFundedAccounts.length < numberOfAccounts) {
362
+ throw new Error(`Unable to deploy ${numberOfAccounts} accounts. Only ${initialFundedAccounts.length} accounts were funded.`);
363
+ }
364
+ const teardown = async ()=>{
365
+ try {
366
+ await tryStop(wallet, logger);
367
+ await tryStop(aztecNodeService, logger);
368
+ await tryStop(proverNode, logger);
369
+ if (acvmConfig?.cleanup) {
370
+ await acvmConfig.cleanup();
371
+ }
372
+ if (bbConfig?.cleanup) {
373
+ await bbConfig.cleanup();
374
+ }
375
+ await tryStop(watcher, logger);
376
+ await tryStop(anvil, logger);
377
+ await tryRmDir(directoryToCleanup, logger);
378
+ } catch (err) {
379
+ logger.error(`Error during e2e test teardown`, err);
380
+ } finally{
381
+ try {
382
+ await telemetryClient.stop();
383
+ } catch (err) {
384
+ logger.error(`Error during telemetry client stop`, err);
385
+ }
386
+ }
387
+ };
388
+ return {
389
+ anvil,
390
+ aztecNode: aztecNodeService,
391
+ aztecNodeService,
392
+ aztecNodeAdmin: aztecNodeService,
393
+ cheatCodes,
394
+ ethCheatCodes,
395
+ config,
396
+ aztecNodeConfig: config,
397
+ dateProvider,
398
+ deployL1ContractsValues,
399
+ initialFundedAccounts,
400
+ logger,
401
+ mockGossipSubNetwork,
402
+ prefilledPublicData,
403
+ proverNode,
404
+ sequencer: sequencerClient,
405
+ teardown,
406
+ telemetryClient,
407
+ wallet,
408
+ accounts,
409
+ watcher,
410
+ acvmConfig,
411
+ bbConfig,
412
+ directoryToCleanup
413
+ };
414
+ } catch (err) {
415
+ await anvil?.stop();
416
+ throw err;
417
+ }
418
+ }
419
+ /** Returns the job name for the current test. */ function getJobName() {
420
+ return process.env.JOB_NAME ?? expect.getState().currentTestName?.split(' ')[0].replaceAll('/', '_') ?? 'unknown';
421
+ }
422
+ /**
423
+ * Returns a logger instance for the current test.
424
+ */ export function getLogger() {
425
+ const describeBlockName = expect.getState().currentTestName?.split(' ')[0].replaceAll('/', ':');
426
+ if (!describeBlockName) {
427
+ const name = expect.getState().testPath?.split('/').pop()?.split('.')[0] ?? 'unknown';
428
+ return createLogger('e2e:' + name);
429
+ }
430
+ return createLogger('e2e:' + describeBlockName);
431
+ }
432
+ /**
433
+ * Computes the address of the "canonical" SponsoredFPCContract.
434
+ */ export function getSponsoredFPCInstance() {
435
+ return Promise.resolve(getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
436
+ salt: new Fr(SPONSORED_FPC_SALT)
437
+ }));
438
+ }
439
+ /**
440
+ * Computes the address of the "canonical" SponsoredFPCContract.
441
+ */ export async function getSponsoredFPCAddress() {
442
+ const sponsoredFPCInstance = await getSponsoredFPCInstance();
443
+ return sponsoredFPCInstance.address;
444
+ }
445
+ /**
446
+ * Deploy a sponsored FPC contract to a running instance.
447
+ */ export async function setupSponsoredFPC(wallet) {
448
+ const instance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
449
+ salt: new Fr(SPONSORED_FPC_SALT)
450
+ });
451
+ await wallet.registerContract(instance, SponsoredFPCContract.artifact);
452
+ getLogger().info(`SponsoredFPC: ${instance.address}`);
453
+ return instance;
454
+ }
455
+ /**
456
+ * Registers the SponsoredFPC in this PXE instance.
457
+ */ export async function registerSponsoredFPC(wallet) {
458
+ await wallet.registerContract(await getSponsoredFPCInstance(), SponsoredFPCContract.artifact);
459
+ }
460
+ export async function waitForProvenChain(node, targetBlock, timeoutSec = 60, intervalSec = 1) {
461
+ targetBlock ??= await node.getBlockNumber();
462
+ await retryUntil(async ()=>await node.getProvenBlockNumber() >= targetBlock, 'proven chain status', timeoutSec, intervalSec);
463
+ }
464
+ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, proverNodeConfig, aztecNode, prefilledPublicData = [], proverNodeDeps = {}) {
465
+ return withLoggerBindings({
466
+ actor: 'prover-0'
467
+ }, async ()=>{
468
+ const aztecNodeTxProvider = aztecNode && {
469
+ getTxByHash: aztecNode.getTxByHash.bind(aztecNode),
470
+ getTxsByHash: aztecNode.getTxsByHash.bind(aztecNode),
471
+ stop: ()=>Promise.resolve()
472
+ };
473
+ const blobClient = await createBlobClientWithFileStores(aztecNodeConfig, createLogger('blob-client:prover-node'));
474
+ const archiverConfig = {
475
+ ...aztecNodeConfig,
476
+ dataDirectory: proverNodeConfig.dataDirectory
477
+ };
478
+ const archiver = await createArchiver(archiverConfig, {
479
+ blobClient,
480
+ dateProvider: proverNodeDeps.dateProvider
481
+ }, {
482
+ blockUntilSync: true
483
+ });
484
+ const proverConfig = {
485
+ ...aztecNodeConfig,
486
+ txCollectionNodeRpcUrls: [],
487
+ realProofs: false,
488
+ proverAgentCount: 2,
489
+ publisherPrivateKeys: [
490
+ new SecretValue(proverNodePrivateKey)
491
+ ],
492
+ proverNodeMaxPendingJobs: 10,
493
+ proverNodeMaxParallelBlocksPerEpoch: 32,
494
+ proverNodePollingIntervalMs: 200,
495
+ txGatheringIntervalMs: 1000,
496
+ txGatheringBatchSize: 10,
497
+ txGatheringMaxParallelRequestsPerNode: 10,
498
+ txGatheringTimeoutMs: 24_000,
499
+ proverNodeFailedEpochStore: undefined,
500
+ proverId: EthAddress.fromNumber(1),
501
+ proverNodeEpochProvingDelayMs: undefined,
502
+ ...proverNodeConfig
503
+ };
504
+ const l1TxUtils = createDelayedL1TxUtils(aztecNodeConfig, proverNodePrivateKey, 'prover-node', proverNodeDeps.dateProvider);
505
+ const proverNode = await createProverNode(proverConfig, {
506
+ ...proverNodeDeps,
507
+ aztecNodeTxProvider,
508
+ archiver: archiver,
509
+ l1TxUtils
510
+ }, {
511
+ prefilledPublicData
512
+ });
513
+ getLogger().info(`Created and synced prover node`, {
514
+ publisherAddress: l1TxUtils.client.account.address
515
+ });
516
+ if (!proverNodeConfig.dontStart) {
517
+ await proverNode.start();
518
+ }
519
+ return proverNode;
520
+ });
521
+ }
522
+ function createDelayedL1TxUtils(aztecNodeConfig, privateKey, logName, dateProvider) {
523
+ const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
524
+ const log = createLogger(logName);
525
+ const l1TxUtils = createDelayedL1TxUtilsFromViemWallet(l1Client, log, dateProvider, aztecNodeConfig);
526
+ l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
527
+ return l1TxUtils;
528
+ }
529
+ export function getBalancesFn(symbol, method, from, logger) {
530
+ const balances = async (...addressLikes)=>{
531
+ const addresses = addressLikes.map((addressLike)=>'address' in addressLike ? addressLike.address : addressLike);
532
+ const b = await Promise.all(addresses.map((address)=>method(address).simulate({
533
+ from
534
+ })));
535
+ const debugString = `${symbol} balances: ${addresses.map((address, i)=>`${address}: ${b[i]}`).join(', ')}`;
536
+ logger.verbose(debugString);
537
+ return b;
538
+ };
539
+ return balances;
540
+ }
541
+ export async function expectMapping(fn, inputs, expectedOutputs) {
542
+ expect(inputs.length).toBe(expectedOutputs.length);
543
+ const outputs = await fn(...inputs);
544
+ expect(outputs).toEqual(expectedOutputs);
545
+ }
546
+ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiffs) {
547
+ expect(inputs.length).toBe(expectedDiffs.length);
548
+ const outputs = await fn(...inputs);
549
+ const diffs = outputs.map((output, i)=>output - initialValues[i]);
550
+ expect(diffs).toEqual(expectedDiffs);
551
+ }
552
+ /**
553
+ * Registers the contract class used for test accounts and publicly deploys the instances requested.
554
+ * Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
555
+ */ export async function ensureAccountContractsPublished(wallet, accountsToDeploy) {
556
+ const accountsAndAddresses = await Promise.all(accountsToDeploy.map(async (address)=>{
557
+ return {
558
+ address,
559
+ deployed: (await wallet.getContractMetadata(address)).isContractPublished
560
+ };
561
+ }));
562
+ const instances = (await Promise.all(accountsAndAddresses.filter(({ deployed })=>!deployed).map(({ address })=>wallet.getContractMetadata(address)))).map((contractMetadata)=>contractMetadata.instance);
563
+ const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
564
+ if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
565
+ await (await publishContractClass(wallet, SchnorrAccountContractArtifact)).send({
566
+ from: accountsToDeploy[0]
567
+ });
568
+ }
569
+ const requests = instances.map((instance)=>publishInstance(wallet, instance));
570
+ const batch = new BatchCall(wallet, requests);
571
+ await batch.send({
572
+ from: accountsToDeploy[0]
573
+ });
574
+ }
575
+ /**
576
+ * Helper function to deploy accounts.
577
+ * Returns deployed account data that can be used by tests.
578
+ */ export const deployAccounts = (numberOfAccounts, logger)=>async ({ wallet, initialFundedAccounts })=>{
579
+ if (initialFundedAccounts.length < numberOfAccounts) {
580
+ throw new Error(`Cannot deploy more than ${initialFundedAccounts.length} initial accounts.`);
581
+ }
582
+ logger.verbose('Deploying accounts funded with fee juice...');
583
+ const deployedAccounts = initialFundedAccounts.slice(0, numberOfAccounts);
584
+ // Serial due to https://github.com/AztecProtocol/aztec-packages/issues/12045
585
+ for(let i = 0; i < deployedAccounts.length; i++){
586
+ const accountManager = await wallet.createSchnorrAccount(deployedAccounts[i].secret, deployedAccounts[i].salt, deployedAccounts[i].signingKey);
587
+ const deployMethod = await accountManager.getDeployMethod();
588
+ await deployMethod.send({
589
+ from: AztecAddress.ZERO,
590
+ skipClassPublication: i !== 0
591
+ });
592
+ }
593
+ return {
594
+ deployedAccounts
595
+ };
596
+ };
597
+ /**
598
+ * Registers the contract class used for test accounts and publicly deploys the instances requested.
599
+ * Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
600
+ */ export async function publicDeployAccounts(wallet, accountsToDeploy, waitUntilProven = false, node) {
601
+ const instances = (await Promise.all(accountsToDeploy.map((account)=>wallet.getContractMetadata(account)))).map((metadata)=>metadata.instance);
602
+ const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
603
+ const alreadyRegistered = (await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered;
604
+ const calls = await Promise.all([
605
+ ...!alreadyRegistered ? [
606
+ publishContractClass(wallet, SchnorrAccountContractArtifact)
607
+ ] : [],
608
+ ...instances.map((instance)=>publishInstance(wallet, instance))
609
+ ]);
610
+ const batch = new BatchCall(wallet, calls);
611
+ const txReceipt = await batch.send({
612
+ from: accountsToDeploy[0]
613
+ });
614
+ if (waitUntilProven) {
615
+ if (!node) {
616
+ throw new Error('Need to provide an AztecNode to wait for proven.');
617
+ } else {
618
+ await waitForProven(node, txReceipt);
619
+ }
620
+ }
621
+ }
622
+ /**
623
+ * Destroys the current context.
624
+ */ export async function teardown(context) {
625
+ if (!context) {
626
+ return;
627
+ }
628
+ await context.teardown();
629
+ }
630
+ // Re-export for backward compatibility
631
+ export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';