@aztec/end-to-end 0.0.1-commit.fcb71a6 → 0.0.1-commit.ff7989d6c

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 (234) 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 +121 -136
  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 +17 -12
  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 +106 -112
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +16 -11
  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 +90 -70
  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 +15 -7
  24. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  25. package/dest/e2e_epochs/epochs_test.js +87 -40
  26. package/dest/e2e_fees/bridging_race.notest.js +3 -5
  27. package/dest/e2e_fees/fees_test.d.ts +14 -14
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +125 -143
  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_nested_contract/nested_contract_test.d.ts +6 -9
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.js +31 -39
  36. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  38. package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
  39. package/dest/e2e_p2p/p2p_network.d.ts +8 -7
  40. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  41. package/dest/e2e_p2p/p2p_network.js +127 -106
  42. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  43. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  44. package/dest/e2e_p2p/reqresp/utils.js +177 -0
  45. package/dest/e2e_p2p/shared.d.ts +6 -6
  46. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  47. package/dest/e2e_p2p/shared.js +18 -21
  48. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  54. package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
  55. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  56. package/dest/e2e_token_contract/token_contract_test.js +99 -91
  57. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  58. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  59. package/dest/fixtures/authwit_proxy.js +30 -0
  60. package/dest/fixtures/e2e_prover_test.d.ts +11 -17
  61. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  62. package/dest/fixtures/e2e_prover_test.js +112 -128
  63. package/dest/fixtures/fixtures.d.ts +5 -1
  64. package/dest/fixtures/fixtures.d.ts.map +1 -1
  65. package/dest/fixtures/fixtures.js +6 -0
  66. package/dest/fixtures/ha_setup.d.ts +71 -0
  67. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  68. package/dest/fixtures/ha_setup.js +116 -0
  69. package/dest/fixtures/index.d.ts +2 -1
  70. package/dest/fixtures/index.d.ts.map +1 -1
  71. package/dest/fixtures/index.js +1 -0
  72. package/dest/fixtures/setup.d.ts +235 -0
  73. package/dest/fixtures/setup.d.ts.map +1 -0
  74. package/dest/fixtures/setup.js +605 -0
  75. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  76. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  77. package/dest/fixtures/setup_p2p_test.js +40 -29
  78. package/dest/fixtures/token_utils.d.ts +2 -2
  79. package/dest/fixtures/token_utils.d.ts.map +1 -1
  80. package/dest/fixtures/token_utils.js +10 -6
  81. package/dest/fixtures/utils.d.ts +5 -194
  82. package/dest/fixtures/utils.d.ts.map +1 -1
  83. package/dest/fixtures/utils.js +4 -619
  84. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  85. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  86. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  87. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  88. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  89. package/dest/quality_of_service/prometheus_client.js +67 -0
  90. package/dest/shared/cross_chain_test_harness.d.ts +16 -6
  91. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  92. package/dest/shared/cross_chain_test_harness.js +13 -13
  93. package/dest/shared/gas_portal_test_harness.d.ts +11 -1
  94. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  95. package/dest/shared/gas_portal_test_harness.js +1 -1
  96. package/dest/shared/index.d.ts +3 -2
  97. package/dest/shared/index.d.ts.map +1 -1
  98. package/dest/shared/index.js +1 -0
  99. package/dest/shared/mock_state_view.d.ts +86 -0
  100. package/dest/shared/mock_state_view.d.ts.map +1 -0
  101. package/dest/shared/mock_state_view.js +186 -0
  102. package/dest/shared/submit-transactions.d.ts +4 -4
  103. package/dest/shared/submit-transactions.d.ts.map +1 -1
  104. package/dest/shared/submit-transactions.js +9 -11
  105. package/dest/shared/uniswap_l1_l2.d.ts +3 -28
  106. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  107. package/dest/shared/uniswap_l1_l2.js +53 -33
  108. package/dest/simulators/lending_simulator.d.ts +5 -1
  109. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  110. package/dest/simulators/lending_simulator.js +2 -2
  111. package/dest/simulators/token_simulator.d.ts +1 -1
  112. package/dest/simulators/token_simulator.d.ts.map +1 -1
  113. package/dest/simulators/token_simulator.js +2 -23
  114. package/dest/spartan/setup_test_wallets.d.ts +12 -4
  115. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  116. package/dest/spartan/setup_test_wallets.js +92 -35
  117. package/dest/spartan/tx_metrics.d.ts +51 -2
  118. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  119. package/dest/spartan/tx_metrics.js +333 -6
  120. package/dest/spartan/utils/bot.d.ts +28 -0
  121. package/dest/spartan/utils/bot.d.ts.map +1 -0
  122. package/dest/spartan/utils/bot.js +142 -0
  123. package/dest/spartan/utils/chaos.d.ts +79 -0
  124. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  125. package/dest/spartan/utils/chaos.js +142 -0
  126. package/dest/spartan/utils/clients.d.ts +39 -0
  127. package/dest/spartan/utils/clients.d.ts.map +1 -0
  128. package/dest/spartan/utils/clients.js +90 -0
  129. package/dest/spartan/utils/config.d.ts +39 -0
  130. package/dest/spartan/utils/config.d.ts.map +1 -0
  131. package/dest/spartan/utils/config.js +21 -0
  132. package/dest/spartan/utils/health.d.ts +63 -0
  133. package/dest/spartan/utils/health.d.ts.map +1 -0
  134. package/dest/spartan/utils/health.js +202 -0
  135. package/dest/spartan/utils/helm.d.ts +15 -0
  136. package/dest/spartan/utils/helm.d.ts.map +1 -0
  137. package/dest/spartan/utils/helm.js +47 -0
  138. package/dest/spartan/utils/index.d.ts +9 -0
  139. package/dest/spartan/utils/index.d.ts.map +1 -0
  140. package/dest/spartan/utils/index.js +18 -0
  141. package/dest/spartan/utils/k8s.d.ts +128 -0
  142. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  143. package/dest/spartan/utils/k8s.js +381 -0
  144. package/dest/spartan/utils/nodes.d.ts +40 -0
  145. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  146. package/dest/spartan/utils/nodes.js +460 -0
  147. package/dest/spartan/utils/scripts.d.ts +30 -0
  148. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  149. package/dest/spartan/utils/scripts.js +81 -0
  150. package/dest/spartan/utils.d.ts +2 -253
  151. package/dest/spartan/utils.d.ts.map +1 -1
  152. package/dest/spartan/utils.js +1 -892
  153. package/dest/test-wallet/test_wallet.d.ts +83 -0
  154. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  155. package/dest/test-wallet/test_wallet.js +214 -0
  156. package/dest/test-wallet/utils.d.ts +41 -0
  157. package/dest/test-wallet/utils.d.ts.map +1 -0
  158. package/dest/test-wallet/utils.js +71 -0
  159. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  160. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  161. package/dest/test-wallet/wallet_worker_script.js +40 -0
  162. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  163. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  164. package/dest/test-wallet/worker_wallet.js +103 -0
  165. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  166. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  167. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  168. package/package.json +44 -39
  169. package/src/bench/client_flows/benchmark.ts +24 -2
  170. package/src/bench/client_flows/client_flows_benchmark.ts +141 -211
  171. package/src/bench/client_flows/config.ts +9 -1
  172. package/src/bench/client_flows/data_extractor.ts +1 -1
  173. package/src/bench/utils.ts +21 -15
  174. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +114 -143
  175. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +127 -117
  176. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  177. package/src/e2e_epochs/epochs_test.ts +130 -94
  178. package/src/e2e_fees/bridging_race.notest.ts +4 -10
  179. package/src/e2e_fees/fees_test.ts +164 -227
  180. package/src/e2e_l1_publisher/write_json.ts +16 -16
  181. package/src/e2e_nested_contract/nested_contract_test.ts +33 -56
  182. package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
  183. package/src/e2e_p2p/p2p_network.ts +197 -171
  184. package/src/e2e_p2p/reqresp/utils.ts +235 -0
  185. package/src/e2e_p2p/shared.ts +28 -27
  186. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  187. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  188. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  189. package/src/e2e_token_contract/token_contract_test.ts +113 -119
  190. package/src/fixtures/authwit_proxy.ts +50 -0
  191. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  192. package/src/fixtures/e2e_prover_test.ts +127 -172
  193. package/src/fixtures/fixtures.ts +10 -0
  194. package/src/fixtures/ha_setup.ts +186 -0
  195. package/src/fixtures/index.ts +1 -0
  196. package/src/fixtures/setup.ts +896 -0
  197. package/src/fixtures/setup_p2p_test.ts +40 -44
  198. package/src/fixtures/token_utils.ts +7 -5
  199. package/src/fixtures/utils.ts +27 -907
  200. package/src/guides/up_quick_start.sh +3 -3
  201. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  202. package/src/quality_of_service/prometheus_client.ts +113 -0
  203. package/src/shared/cross_chain_test_harness.ts +16 -36
  204. package/src/shared/gas_portal_test_harness.ts +1 -1
  205. package/src/shared/index.ts +2 -1
  206. package/src/shared/mock_state_view.ts +188 -0
  207. package/src/shared/submit-transactions.ts +14 -16
  208. package/src/shared/uniswap_l1_l2.ts +59 -80
  209. package/src/simulators/lending_simulator.ts +2 -2
  210. package/src/simulators/token_simulator.ts +1 -29
  211. package/src/spartan/setup_test_wallets.ts +134 -26
  212. package/src/spartan/tx_metrics.ts +255 -9
  213. package/src/spartan/utils/bot.ts +188 -0
  214. package/src/spartan/utils/chaos.ts +253 -0
  215. package/src/spartan/utils/clients.ts +100 -0
  216. package/src/spartan/utils/config.ts +27 -0
  217. package/src/spartan/utils/health.ts +255 -0
  218. package/src/spartan/utils/helm.ts +84 -0
  219. package/src/spartan/utils/index.ts +65 -0
  220. package/src/spartan/utils/k8s.ts +535 -0
  221. package/src/spartan/utils/nodes.ts +535 -0
  222. package/src/spartan/utils/scripts.ts +99 -0
  223. package/src/spartan/utils.ts +1 -1158
  224. package/src/test-wallet/test_wallet.ts +306 -0
  225. package/src/test-wallet/utils.ts +112 -0
  226. package/src/test-wallet/wallet_worker_script.ts +43 -0
  227. package/src/test-wallet/worker_wallet.ts +165 -0
  228. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  229. package/dest/fixtures/snapshot_manager.d.ts +0 -93
  230. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  231. package/dest/fixtures/snapshot_manager.js +0 -493
  232. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  233. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  234. package/src/fixtures/snapshot_manager.ts +0 -651
@@ -4,14 +4,12 @@
4
4
  import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
5
5
  import { range } from '@aztec/foundation/array';
6
6
  import { SecretValue } from '@aztec/foundation/config';
7
- import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
7
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
8
8
  import { bufferToHex } from '@aztec/foundation/string';
9
9
  import type { DateProvider } from '@aztec/foundation/timer';
10
- import type { ProverNodeConfig, ProverNodeDeps } from '@aztec/prover-node';
11
10
  import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
12
11
 
13
12
  import getPort from 'get-port';
14
- import { AsyncLocalStorage } from 'node:async_hooks';
15
13
 
16
14
  import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
17
15
  import { createAndSyncProverNode, getPrivateKeyFromIndex } from './utils.js';
@@ -22,6 +20,11 @@ import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
22
20
  // to avoid running validators with the same key
23
21
  export const ATTESTER_PRIVATE_KEYS_START_INDEX = 3;
24
22
 
23
+ // Global counters for actor naming (start at 1)
24
+ let validatorCounter = 1;
25
+ let nodeCounter = 1;
26
+ let proverCounter = 1;
27
+
25
28
  export function generatePrivateKeys(startIndex: number, numberOfKeys: number): `0x${string}`[] {
26
29
  const privateKeys: `0x${string}`[] = [];
27
30
  // Do not start from 0 as it is used during setup
@@ -44,10 +47,6 @@ export async function createNodes(
44
47
  validatorsPerNode = 1,
45
48
  ): Promise<AztecNodeService[]> {
46
49
  const nodePromises: Promise<AztecNodeService>[] = [];
47
- const loggerIdStorage = new AsyncLocalStorage<string>();
48
- const logNameHandler = (module: string) =>
49
- loggerIdStorage.getStore() ? `${module}:${loggerIdStorage.getStore()}` : module;
50
- addLogNameHandler(logNameHandler);
51
50
 
52
51
  for (let i = 0; i < numNodes; i++) {
53
52
  const index = indexOffset + i;
@@ -69,7 +68,6 @@ export async function createNodes(
69
68
  prefilledPublicData,
70
69
  dataDir,
71
70
  metricsPort,
72
- loggerIdStorage,
73
71
  );
74
72
  nodePromises.push(nodePromise);
75
73
  }
@@ -81,13 +79,20 @@ export async function createNodes(
81
79
  throw new Error('Sequencer not found');
82
80
  }
83
81
 
84
- removeLogNameHandler(logNameHandler);
85
82
  return nodes;
86
83
  }
87
84
 
88
- /** Creates a P2P enabled instance of Aztec Node Service with a validator */
85
+ /** Extended config type for createNode with test-specific overrides. */
86
+ export type CreateNodeConfig = AztecNodeConfig & {
87
+ /** Whether to skip starting the sequencer. */
88
+ dontStartSequencer?: boolean;
89
+ /** Override the private key (instead of deriving from addressIndex). */
90
+ validatorPrivateKey?: `0x${string}`;
91
+ };
92
+
93
+ /** Creates a P2P enabled instance of Aztec Node Service with a validator. */
89
94
  export async function createNode(
90
- config: AztecNodeConfig & { dontStartSequencer?: boolean },
95
+ config: CreateNodeConfig,
91
96
  dateProvider: DateProvider,
92
97
  tcpPort: number,
93
98
  bootstrapNode: string | undefined,
@@ -95,9 +100,9 @@ export async function createNode(
95
100
  prefilledPublicData?: PublicDataTreeLeaf[],
96
101
  dataDirectory?: string,
97
102
  metricsPort?: number,
98
- loggerIdStorage?: AsyncLocalStorage<string>,
99
103
  ) {
100
- const createNode = async () => {
104
+ const actorIndex = validatorCounter++;
105
+ return await withLoggerBindings({ actor: `validator-${actorIndex}` }, async () => {
101
106
  const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
102
107
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
103
108
  return await AztecNodeService.createAndSync(
@@ -105,8 +110,7 @@ export async function createNode(
105
110
  { telemetry, dateProvider },
106
111
  { prefilledPublicData, dontStartSequencer: config.dontStartSequencer },
107
112
  );
108
- };
109
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
113
+ });
110
114
  }
111
115
 
112
116
  /** Creates a P2P enabled instance of Aztec Node Service without a validator */
@@ -118,20 +122,19 @@ export async function createNonValidatorNode(
118
122
  prefilledPublicData?: PublicDataTreeLeaf[],
119
123
  dataDirectory?: string,
120
124
  metricsPort?: number,
121
- loggerIdStorage?: AsyncLocalStorage<string>,
122
125
  ) {
123
- const createNode = async () => {
126
+ const actorIndex = nodeCounter++;
127
+ return await withLoggerBindings({ actor: `node-${actorIndex}` }, async () => {
124
128
  const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
125
129
  const config: AztecNodeConfig = {
126
130
  ...p2pConfig,
127
131
  disableValidator: true,
128
132
  validatorPrivateKeys: undefined,
129
- publisherPrivateKeys: [],
133
+ sequencerPublisherPrivateKeys: [],
130
134
  };
131
135
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
132
136
  return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
133
- };
134
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
137
+ });
135
138
  }
136
139
 
137
140
  export async function createProverNode(
@@ -139,34 +142,26 @@ export async function createProverNode(
139
142
  tcpPort: number,
140
143
  bootstrapNode: string | undefined,
141
144
  addressIndex: number,
142
- proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>,
145
+ deps: { dateProvider: DateProvider },
143
146
  prefilledPublicData?: PublicDataTreeLeaf[],
144
147
  dataDirectory?: string,
145
148
  metricsPort?: number,
146
- loggerIdStorage?: AsyncLocalStorage<string>,
147
- ) {
148
- const createProverNode = async () => {
149
+ ): Promise<{ proverNode: AztecNodeService }> {
150
+ const actorIndex = proverCounter++;
151
+ return await withLoggerBindings({ actor: `prover-${actorIndex}` }, async () => {
149
152
  const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
150
153
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
151
154
 
152
- const proverConfig: Partial<ProverNodeConfig> = await createP2PConfig(
153
- config,
154
- bootstrapNode,
155
- tcpPort,
156
- dataDirectory,
157
- );
155
+ const p2pConfig = await createP2PConfig(config, bootstrapNode, tcpPort, dataDirectory);
158
156
 
159
- const aztecNodeRpcTxProvider = undefined;
160
157
  return await createAndSyncProverNode(
161
158
  bufferToHex(proverNodePrivateKey),
162
- config,
163
- { ...proverConfig, dataDirectory },
164
- aztecNodeRpcTxProvider,
165
- prefilledPublicData,
166
- { ...proverNodeDeps, telemetry },
159
+ { ...config, ...p2pConfig },
160
+ { dataDirectory },
161
+ { ...deps, telemetry },
162
+ { prefilledPublicData: prefilledPublicData ?? [] },
167
163
  );
168
- };
169
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
164
+ });
170
165
  }
171
166
 
172
167
  export async function createP2PConfig(
@@ -192,26 +187,27 @@ export async function createP2PConfig(
192
187
  }
193
188
 
194
189
  export async function createValidatorConfig(
195
- config: AztecNodeConfig,
190
+ config: CreateNodeConfig,
196
191
  bootstrapNodeEnr?: string,
197
192
  port?: number,
198
193
  addressIndex: number | number[] = 1,
199
194
  dataDirectory?: string,
200
195
  ) {
201
196
  const addressIndices = Array.isArray(addressIndex) ? addressIndex : [addressIndex];
202
- if (addressIndices.length === 0) {
197
+ if (addressIndices.length === 0 && !config.validatorPrivateKey) {
203
198
  throw new Error('At least one address index must be provided to create a validator config');
204
199
  }
205
200
 
206
- const attesterPrivateKeys = addressIndices.map(index =>
207
- bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + index)!),
208
- );
201
+ // Use override private key if provided, otherwise derive from address indices
202
+ const attesterPrivateKeys = config.validatorPrivateKey
203
+ ? [config.validatorPrivateKey]
204
+ : addressIndices.map(index => bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + index)!));
209
205
  const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
210
206
  const nodeConfig: AztecNodeConfig = {
211
207
  ...config,
212
208
  ...p2pConfig,
213
209
  validatorPrivateKeys: new SecretValue(attesterPrivateKeys),
214
- publisherPrivateKeys: [new SecretValue(attesterPrivateKeys[0])],
210
+ sequencerPublisherPrivateKeys: [new SecretValue(attesterPrivateKeys[0])],
215
211
  };
216
212
 
217
213
  return nodeConfig;
@@ -6,9 +6,10 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token';
6
6
 
7
7
  export async function deployToken(wallet: Wallet, admin: AztecAddress, initialAdminBalance: bigint, logger: Logger) {
8
8
  logger.info(`Deploying Token contract...`);
9
- const { contract, instance } = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18)
10
- .send({ from: admin })
11
- .wait();
9
+ const { contract, instance } = await TokenContract.deploy(wallet, admin, 'TokenName', 'TokenSymbol', 18).send({
10
+ from: admin,
11
+ wait: { returnReceipt: true },
12
+ });
12
13
 
13
14
  if (initialAdminBalance > 0n) {
14
15
  await mintTokensToPrivate(contract, admin, admin, initialAdminBalance);
@@ -24,8 +25,9 @@ export async function mintTokensToPrivate(
24
25
  minter: AztecAddress,
25
26
  recipient: AztecAddress,
26
27
  amount: bigint,
28
+ additionalScopes?: AztecAddress[],
27
29
  ) {
28
- await token.methods.mint_to_private(recipient, amount).send({ from: minter }).wait();
30
+ await token.methods.mint_to_private(recipient, amount).send({ from: minter, additionalScopes });
29
31
  }
30
32
 
31
33
  export async function expectTokenBalance(
@@ -55,7 +57,7 @@ export async function mintNotes(
55
57
  for (let mintedNotes = 0; mintedNotes < noteAmounts.length; mintedNotes += notesPerIteration) {
56
58
  const toMint = noteAmounts.slice(mintedNotes, mintedNotes + notesPerIteration);
57
59
  const actions = toMint.map(amt => asset.methods.mint_to_private(recipient, amt));
58
- await new BatchCall(wallet, actions).send({ from: minter }).wait();
60
+ await new BatchCall(wallet, actions).send({ from: minter });
59
61
  }
60
62
 
61
63
  return noteAmounts.reduce((prev, curr) => prev + curr, 0n);