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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +21 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +21 -15
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +129 -119
  7. package/dest/bench/client_flows/config.d.ts +1 -1
  8. package/dest/bench/client_flows/data_extractor.d.ts +1 -1
  9. package/dest/bench/client_flows/data_extractor.js +7 -27
  10. package/dest/bench/utils.d.ts +8 -7
  11. package/dest/bench/utils.d.ts.map +1 -1
  12. package/dest/bench/utils.js +27 -18
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -7
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  15. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +96 -112
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +19 -13
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  18. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +91 -70
  19. package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
  20. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  21. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  22. package/dest/e2e_epochs/epochs_test.d.ts +11 -9
  23. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  24. package/dest/e2e_epochs/epochs_test.js +22 -16
  25. package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
  26. package/dest/e2e_fees/bridging_race.notest.js +5 -7
  27. package/dest/e2e_fees/fees_test.d.ts +20 -16
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +127 -139
  30. package/dest/e2e_l1_publisher/write_json.d.ts +2 -2
  31. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  32. package/dest/e2e_l1_publisher/write_json.js +23 -18
  33. package/dest/e2e_multi_validator/utils.d.ts +1 -1
  34. package/dest/e2e_multi_validator/utils.js +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  36. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  37. package/dest/e2e_nested_contract/nested_contract_test.js +31 -38
  38. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  39. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  40. package/dest/e2e_p2p/inactivity_slash_test.js +7 -6
  41. package/dest/e2e_p2p/p2p_network.d.ts +225 -18
  42. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  43. package/dest/e2e_p2p/p2p_network.js +121 -110
  44. package/dest/e2e_p2p/shared.d.ts +11 -11
  45. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  46. package/dest/e2e_p2p/shared.js +13 -19
  47. package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
  48. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  49. package/dest/e2e_token_contract/token_contract_test.js +89 -91
  50. package/dest/fixtures/e2e_prover_test.d.ts +12 -18
  51. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  52. package/dest/fixtures/e2e_prover_test.js +100 -108
  53. package/dest/fixtures/fixtures.d.ts +2 -3
  54. package/dest/fixtures/fixtures.d.ts.map +1 -1
  55. package/dest/fixtures/fixtures.js +2 -3
  56. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  57. package/dest/fixtures/get_acvm_config.js +1 -1
  58. package/dest/fixtures/get_bb_config.d.ts +1 -1
  59. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  60. package/dest/fixtures/index.d.ts +1 -1
  61. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  62. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  63. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  64. package/dest/fixtures/logging.d.ts +1 -1
  65. package/dest/fixtures/setup.d.ts +218 -0
  66. package/dest/fixtures/setup.d.ts.map +1 -0
  67. package/dest/fixtures/setup.js +690 -0
  68. package/dest/fixtures/setup_p2p_test.d.ts +4 -4
  69. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  70. package/dest/fixtures/setup_p2p_test.js +18 -10
  71. package/dest/fixtures/token_utils.d.ts +5 -2
  72. package/dest/fixtures/token_utils.d.ts.map +1 -1
  73. package/dest/fixtures/token_utils.js +13 -7
  74. package/dest/fixtures/utils.d.ts +5 -192
  75. package/dest/fixtures/utils.d.ts.map +1 -1
  76. package/dest/fixtures/utils.js +4 -648
  77. package/dest/fixtures/web3signer.d.ts +1 -1
  78. package/dest/fixtures/web3signer.js +1 -1
  79. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  80. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  81. package/dest/fixtures/with_telemetry_utils.js +2 -2
  82. package/dest/index.d.ts +1 -1
  83. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  84. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  85. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  86. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  87. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  88. package/dest/quality_of_service/prometheus_client.js +67 -0
  89. package/dest/shared/cross_chain_test_harness.d.ts +7 -6
  90. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  91. package/dest/shared/cross_chain_test_harness.js +14 -14
  92. package/dest/shared/gas_portal_test_harness.d.ts +2 -2
  93. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  94. package/dest/shared/gas_portal_test_harness.js +2 -2
  95. package/dest/shared/index.d.ts +2 -2
  96. package/dest/shared/index.d.ts.map +1 -1
  97. package/dest/shared/jest_setup.d.ts +1 -1
  98. package/dest/shared/submit-transactions.d.ts +3 -3
  99. package/dest/shared/submit-transactions.d.ts.map +1 -1
  100. package/dest/shared/submit-transactions.js +9 -11
  101. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  102. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  103. package/dest/shared/uniswap_l1_l2.js +55 -35
  104. package/dest/simulators/index.d.ts +1 -1
  105. package/dest/simulators/lending_simulator.d.ts +2 -2
  106. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  107. package/dest/simulators/lending_simulator.js +6 -4
  108. package/dest/simulators/token_simulator.d.ts +1 -1
  109. package/dest/simulators/token_simulator.d.ts.map +1 -1
  110. package/dest/spartan/setup_test_wallets.d.ts +8 -5
  111. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  112. package/dest/spartan/setup_test_wallets.js +85 -23
  113. package/dest/spartan/tx_metrics.d.ts +54 -0
  114. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  115. package/dest/spartan/tx_metrics.js +272 -0
  116. package/dest/spartan/utils/bot.d.ts +27 -0
  117. package/dest/spartan/utils/bot.d.ts.map +1 -0
  118. package/dest/spartan/utils/bot.js +141 -0
  119. package/dest/spartan/utils/chaos.d.ts +79 -0
  120. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  121. package/dest/spartan/utils/chaos.js +142 -0
  122. package/dest/spartan/utils/clients.d.ts +39 -0
  123. package/dest/spartan/utils/clients.d.ts.map +1 -0
  124. package/dest/spartan/utils/clients.js +90 -0
  125. package/dest/spartan/utils/config.d.ts +36 -0
  126. package/dest/spartan/utils/config.d.ts.map +1 -0
  127. package/dest/spartan/utils/config.js +20 -0
  128. package/dest/spartan/utils/health.d.ts +63 -0
  129. package/dest/spartan/utils/health.d.ts.map +1 -0
  130. package/dest/spartan/utils/health.js +202 -0
  131. package/dest/spartan/utils/helm.d.ts +15 -0
  132. package/dest/spartan/utils/helm.d.ts.map +1 -0
  133. package/dest/spartan/utils/helm.js +47 -0
  134. package/dest/spartan/utils/index.d.ts +9 -0
  135. package/dest/spartan/utils/index.d.ts.map +1 -0
  136. package/dest/spartan/utils/index.js +18 -0
  137. package/dest/spartan/utils/k8s.d.ts +98 -0
  138. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  139. package/dest/spartan/utils/k8s.js +257 -0
  140. package/dest/spartan/utils/nodes.d.ts +31 -0
  141. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  142. package/dest/spartan/utils/nodes.js +290 -0
  143. package/dest/spartan/utils/scripts.d.ts +16 -0
  144. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  145. package/dest/spartan/utils/scripts.js +66 -0
  146. package/dest/spartan/utils.d.ts +2 -218
  147. package/dest/spartan/utils.d.ts.map +1 -1
  148. package/dest/spartan/utils.js +1 -749
  149. package/package.json +43 -40
  150. package/src/bench/client_flows/benchmark.ts +24 -2
  151. package/src/bench/client_flows/client_flows_benchmark.ts +152 -170
  152. package/src/bench/client_flows/data_extractor.ts +6 -28
  153. package/src/bench/utils.ts +30 -20
  154. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +104 -142
  155. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -124
  156. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  157. package/src/e2e_epochs/epochs_test.ts +67 -48
  158. package/src/e2e_fees/bridging_race.notest.ts +5 -11
  159. package/src/e2e_fees/fees_test.ts +180 -219
  160. package/src/e2e_l1_publisher/write_json.ts +25 -19
  161. package/src/e2e_multi_validator/utils.ts +1 -1
  162. package/src/e2e_nested_contract/nested_contract_test.ts +33 -55
  163. package/src/e2e_p2p/inactivity_slash_test.ts +10 -9
  164. package/src/e2e_p2p/p2p_network.ts +181 -180
  165. package/src/e2e_p2p/shared.ts +25 -27
  166. package/src/e2e_token_contract/token_contract_test.ts +103 -118
  167. package/src/fixtures/e2e_prover_test.ts +111 -149
  168. package/src/fixtures/fixtures.ts +2 -5
  169. package/src/fixtures/get_acvm_config.ts +1 -1
  170. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  171. package/src/fixtures/setup.ts +1017 -0
  172. package/src/fixtures/setup_p2p_test.ts +23 -9
  173. package/src/fixtures/token_utils.ts +8 -7
  174. package/src/fixtures/utils.ts +27 -947
  175. package/src/fixtures/web3signer.ts +1 -1
  176. package/src/fixtures/with_telemetry_utils.ts +2 -2
  177. package/src/guides/up_quick_start.sh +1 -1
  178. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  179. package/src/quality_of_service/prometheus_client.ts +113 -0
  180. package/src/shared/cross_chain_test_harness.ts +19 -36
  181. package/src/shared/gas_portal_test_harness.ts +3 -3
  182. package/src/shared/index.ts +1 -1
  183. package/src/shared/submit-transactions.ts +9 -15
  184. package/src/shared/uniswap_l1_l2.ts +65 -86
  185. package/src/simulators/lending_simulator.ts +7 -5
  186. package/src/spartan/DEVELOP.md +7 -0
  187. package/src/spartan/setup_test_wallets.ts +119 -28
  188. package/src/spartan/tx_metrics.ts +250 -0
  189. package/src/spartan/utils/bot.ts +185 -0
  190. package/src/spartan/utils/chaos.ts +253 -0
  191. package/src/spartan/utils/clients.ts +100 -0
  192. package/src/spartan/utils/config.ts +26 -0
  193. package/src/spartan/utils/health.ts +255 -0
  194. package/src/spartan/utils/helm.ts +84 -0
  195. package/src/spartan/utils/index.ts +62 -0
  196. package/src/spartan/utils/k8s.ts +375 -0
  197. package/src/spartan/utils/nodes.ts +323 -0
  198. package/src/spartan/utils/scripts.ts +63 -0
  199. package/src/spartan/utils.ts +1 -942
  200. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  201. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  202. package/dest/fixtures/setup_l1_contracts.js +0 -17
  203. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  204. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  205. package/dest/fixtures/snapshot_manager.js +0 -505
  206. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  207. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  208. package/src/fixtures/setup_l1_contracts.ts +0 -26
  209. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -0,0 +1,290 @@
1
+ import { createLogger } from '@aztec/aztec.js/log';
2
+ import { makeBackoff, retry } from '@aztec/foundation/retry';
3
+ import { sleep } from '@aztec/foundation/sleep';
4
+ import { createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
5
+ import { exec } from 'child_process';
6
+ import { promisify } from 'util';
7
+ import { execHelmCommand } from './helm.js';
8
+ import { deleteResourceByLabel, getChartDir, startPortForward, waitForResourceByLabel } from './k8s.js';
9
+ const execAsync = promisify(exec);
10
+ const logger = createLogger('e2e:k8s-utils');
11
+ export async function awaitCheckpointNumber(rollupCheatCodes, checkpointNumber, timeoutSeconds, log) {
12
+ log.info(`Waiting for checkpoint ${checkpointNumber}`);
13
+ let tips = await rollupCheatCodes.getTips();
14
+ const endTime = Date.now() + timeoutSeconds * 1000;
15
+ while(tips.pending < checkpointNumber && Date.now() < endTime){
16
+ log.info(`At checkpoint ${tips.pending}`);
17
+ await sleep(1000);
18
+ tips = await rollupCheatCodes.getTips();
19
+ }
20
+ if (tips.pending < checkpointNumber) {
21
+ throw new Error(`Timeout waiting for checkpoint ${checkpointNumber}, only reached ${tips.pending}`);
22
+ } else {
23
+ log.info(`Reached checkpoint ${tips.pending}`);
24
+ }
25
+ }
26
+ export async function getSequencers(namespace) {
27
+ const selectors = [
28
+ 'app.kubernetes.io/name=validator',
29
+ 'app.kubernetes.io/component=validator',
30
+ 'app.kubernetes.io/component=sequencer-node',
31
+ 'app=validator'
32
+ ];
33
+ for (const selector of selectors){
34
+ try {
35
+ const command = `kubectl get pods -l ${selector} -n ${namespace} -o jsonpath='{.items[*].metadata.name}'`;
36
+ const { stdout } = await execAsync(command);
37
+ const sequencers = stdout.split(' ').map((s)=>s.trim()).filter(Boolean);
38
+ if (sequencers.length > 0) {
39
+ logger.verbose(`Found sequencer pods ${sequencers.join(', ')} (selector=${selector})`);
40
+ return sequencers;
41
+ }
42
+ } catch {
43
+ // try next selector
44
+ }
45
+ }
46
+ // Fail fast instead of returning [''] which leads to attempts to port-forward `pod/`.
47
+ throw new Error(`No sequencer/validator pods found in namespace ${namespace}. Tried selectors: ${selectors.join(', ')}`);
48
+ }
49
+ export function updateSequencersConfig(env, config) {
50
+ return withSequencersAdmin(env, async (client)=>{
51
+ await client.setConfig(config);
52
+ return client.getConfig();
53
+ });
54
+ }
55
+ export function getSequencersConfig(env) {
56
+ return withSequencersAdmin(env, (client)=>client.getConfig());
57
+ }
58
+ export async function withSequencersAdmin(env, fn) {
59
+ const adminContainerPort = 8880;
60
+ const namespace = env.NAMESPACE;
61
+ const sequencers = await getSequencers(namespace);
62
+ const results = [];
63
+ for (const sequencer of sequencers){
64
+ // Wrap port-forward + fetch in a retry to handle flaky port-forwards
65
+ const result = await retry(async ()=>{
66
+ const { process, port } = await startPortForward({
67
+ resource: `pod/${sequencer}`,
68
+ namespace,
69
+ containerPort: adminContainerPort
70
+ });
71
+ try {
72
+ const url = `http://localhost:${port}`;
73
+ // Quick health check before using the connection
74
+ const statusRes = await fetch(`${url}/status`);
75
+ if (statusRes.status !== 200) {
76
+ throw new Error(`Admin endpoint returned status ${statusRes.status}`);
77
+ }
78
+ const client = createAztecNodeAdminClient(url);
79
+ return {
80
+ result: await fn(client),
81
+ process
82
+ };
83
+ } catch (err) {
84
+ // Kill the port-forward before retrying
85
+ process.kill();
86
+ throw err;
87
+ }
88
+ }, 'connect to node admin', makeBackoff([
89
+ 1,
90
+ 2,
91
+ 4,
92
+ 8
93
+ ]), logger, true);
94
+ results.push(result.result);
95
+ result.process.kill();
96
+ }
97
+ return results;
98
+ }
99
+ /**
100
+ * Enables or disables probabilistic transaction dropping on validators and waits for rollout.
101
+ * Wired to env vars P2P_DROP_TX and P2P_DROP_TX_CHANCE via Helm values.
102
+ */ export async function setValidatorTxDrop({ namespace, enabled, probability, logger: log }) {
103
+ const drop = enabled ? 'true' : 'false';
104
+ const prob = String(probability);
105
+ const selectors = [
106
+ 'app.kubernetes.io/name=validator',
107
+ 'app.kubernetes.io/component=validator',
108
+ 'app=validator'
109
+ ];
110
+ let updated = false;
111
+ for (const selector of selectors){
112
+ try {
113
+ const list = await execAsync(`kubectl get statefulset -l ${selector} -n ${namespace} --no-headers -o name | cat`);
114
+ const names = list.stdout.split('\n').map((s)=>s.trim()).filter(Boolean);
115
+ if (names.length === 0) {
116
+ continue;
117
+ }
118
+ const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace} P2P_DROP_TX=${drop} P2P_DROP_TX_CHANCE=${prob}`;
119
+ log.info(`command: ${cmd}`);
120
+ await execAsync(cmd);
121
+ updated = true;
122
+ } catch (e) {
123
+ log.warn(`Failed to update validators with selector ${selector}: ${String(e)}`);
124
+ }
125
+ }
126
+ if (!updated) {
127
+ log.warn(`No validator StatefulSets found in ${namespace}. Skipping tx drop toggle.`);
128
+ return;
129
+ }
130
+ // Restart validator pods to ensure env vars take effect and wait for readiness
131
+ await restartValidators(namespace, log);
132
+ }
133
+ export async function restartValidators(namespace, log) {
134
+ const selectors = [
135
+ 'app.kubernetes.io/name=validator',
136
+ 'app.kubernetes.io/component=validator',
137
+ 'app=validator'
138
+ ];
139
+ let any = false;
140
+ for (const selector of selectors){
141
+ try {
142
+ const { stdout } = await execAsync(`kubectl get pods -l ${selector} -n ${namespace} --no-headers -o name | cat`);
143
+ if (!stdout || stdout.trim().length === 0) {
144
+ continue;
145
+ }
146
+ any = true;
147
+ await deleteResourceByLabel({
148
+ resource: 'pods',
149
+ namespace,
150
+ label: selector
151
+ });
152
+ } catch (e) {
153
+ log.warn(`Error restarting validator pods with selector ${selector}: ${String(e)}`);
154
+ }
155
+ }
156
+ if (!any) {
157
+ log.warn(`No validator pods found to restart in ${namespace}.`);
158
+ return;
159
+ }
160
+ // Wait for either label to be Ready
161
+ for (const selector of selectors){
162
+ try {
163
+ await waitForResourceByLabel({
164
+ resource: 'pods',
165
+ namespace,
166
+ label: selector
167
+ });
168
+ return;
169
+ } catch {
170
+ // try next
171
+ }
172
+ }
173
+ log.warn(`Validator pods did not report Ready; continuing.`);
174
+ }
175
+ export async function enableValidatorDynamicBootNode(instanceName, namespace, spartanDir, log) {
176
+ log.info(`Enabling validator dynamic boot node`);
177
+ await execHelmCommand({
178
+ instanceName,
179
+ namespace,
180
+ helmChartDir: getChartDir(spartanDir, 'aztec-network'),
181
+ values: {
182
+ 'validator.dynamicBootNode': 'true'
183
+ },
184
+ valuesFile: undefined,
185
+ timeout: '15m',
186
+ reuseValues: true
187
+ });
188
+ log.info(`Validator dynamic boot node enabled`);
189
+ }
190
+ /**
191
+ * Rolls the Aztec pods in the given namespace.
192
+ * @param namespace - The namespace to roll the Aztec pods in.
193
+ * @param clearState - If true, also deletes the underlying PVCs to clear persistent storage.
194
+ * This is required for rollup upgrades where the old state is incompatible with the new rollup.
195
+ * Defaults to false, which preserves the existing storage.
196
+ */ export async function rollAztecPods(namespace, clearState = false) {
197
+ // Pod components use 'validator', but StatefulSets and PVCs use 'sequencer-node' for validators
198
+ const podComponents = [
199
+ 'p2p-bootstrap',
200
+ 'prover-node',
201
+ 'prover-broker',
202
+ 'prover-agent',
203
+ 'sequencer-node',
204
+ 'rpc'
205
+ ];
206
+ const pvcComponents = [
207
+ 'p2p-bootstrap',
208
+ 'prover-node',
209
+ 'prover-broker',
210
+ 'sequencer-node',
211
+ 'rpc'
212
+ ];
213
+ // StatefulSet components that need to be scaled down before PVC deletion
214
+ // Note: validators use 'sequencer-node' as component label, not 'validator'
215
+ const statefulSetComponents = [
216
+ 'p2p-bootstrap',
217
+ 'prover-node',
218
+ 'prover-broker',
219
+ 'sequencer-node',
220
+ 'rpc'
221
+ ];
222
+ if (clearState) {
223
+ // To delete PVCs, we must first scale down StatefulSets so pods release the volumes
224
+ // Otherwise PVC deletion will hang waiting for pods to terminate
225
+ // First, save original replica counts
226
+ const originalReplicas = new Map();
227
+ for (const component of statefulSetComponents){
228
+ try {
229
+ const getCmd = `kubectl get statefulset -l app.kubernetes.io/component=${component} -n ${namespace} -o jsonpath='{.items[0].spec.replicas}'`;
230
+ const { stdout } = await execAsync(getCmd);
231
+ const replicas = parseInt(stdout.replace(/'/g, '').trim(), 10);
232
+ if (!isNaN(replicas) && replicas > 0) {
233
+ originalReplicas.set(component, replicas);
234
+ }
235
+ } catch {
236
+ // Component might not exist, continue
237
+ }
238
+ }
239
+ // Scale down to 0
240
+ for (const component of statefulSetComponents){
241
+ try {
242
+ const scaleCmd = `kubectl scale statefulset -l app.kubernetes.io/component=${component} -n ${namespace} --replicas=0 --timeout=2m`;
243
+ logger.info(`command: ${scaleCmd}`);
244
+ await execAsync(scaleCmd);
245
+ } catch (e) {
246
+ // Component might not exist or might be a Deployment, continue
247
+ logger.verbose(`Scale down ${component} skipped: ${e}`);
248
+ }
249
+ }
250
+ // Wait for pods to terminate
251
+ await sleep(15 * 1000);
252
+ // Now delete PVCs (they should no longer be in use)
253
+ for (const component of pvcComponents){
254
+ await deleteResourceByLabel({
255
+ resource: 'persistentvolumeclaims',
256
+ namespace: namespace,
257
+ label: `app.kubernetes.io/component=${component}`
258
+ });
259
+ }
260
+ // Scale StatefulSets back up to original replica counts
261
+ for (const component of statefulSetComponents){
262
+ const replicas = originalReplicas.get(component) ?? 1;
263
+ try {
264
+ const scaleCmd = `kubectl scale statefulset -l app.kubernetes.io/component=${component} -n ${namespace} --replicas=${replicas} --timeout=2m`;
265
+ logger.info(`command: ${scaleCmd}`);
266
+ await execAsync(scaleCmd);
267
+ } catch (e) {
268
+ logger.verbose(`Scale up ${component} skipped: ${e}`);
269
+ }
270
+ }
271
+ } else {
272
+ // Just delete pods (no state clearing)
273
+ for (const component of podComponents){
274
+ await deleteResourceByLabel({
275
+ resource: 'pods',
276
+ namespace: namespace,
277
+ label: `app.kubernetes.io/component=${component}`
278
+ });
279
+ }
280
+ }
281
+ await sleep(10 * 1000);
282
+ // Wait for pods to come back
283
+ for (const component of podComponents){
284
+ await waitForResourceByLabel({
285
+ resource: 'pods',
286
+ namespace: namespace,
287
+ label: `app.kubernetes.io/component=${component}`
288
+ });
289
+ }
290
+ }
@@ -0,0 +1,16 @@
1
+ import type { Logger } from '@aztec/foundation/log';
2
+ /**
3
+ * Returns the absolute path to the git repository root
4
+ */
5
+ export declare function getGitProjectRoot(): string;
6
+ export declare function getAztecBin(): string;
7
+ /**
8
+ * Runs the Aztec binary
9
+ * @param args - The arguments to pass to the Aztec binary
10
+ * @param logger - The logger to use
11
+ * @param env - Optional environment variables to set for the process
12
+ * @returns The exit code of the Aztec binary
13
+ */
14
+ export declare function runAztecBin(args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
15
+ export declare function runProjectScript(script: string, args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyaXB0cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NwYXJ0YW4vdXRpbHMvc2NyaXB0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQTRCcEQ7O0dBRUc7QUFDSCx3QkFBZ0IsaUJBQWlCLElBQUksTUFBTSxDQVcxQztBQUVELHdCQUFnQixXQUFXLFdBRTFCO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLFdBQVcsQ0FBQyxJQUFJLEVBQUUsTUFBTSxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxtQkFFdkY7QUFFRCx3QkFBZ0IsZ0JBQWdCLENBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxtQkFHNUcifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../src/spartan/utils/scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AA4BpD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C;AAED,wBAAgB,WAAW,WAE1B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,mBAEvF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,mBAG5G"}
@@ -0,0 +1,66 @@
1
+ import { execSync, spawn } from 'child_process';
2
+ import path from 'path';
3
+ /**
4
+ * @param scriptPath - The path to the script, relative to the project root
5
+ * @param args - The arguments to pass to the script
6
+ * @param logger - The logger to use
7
+ * @returns The exit code of the script
8
+ */ function runScript(scriptPath, args, logger, env) {
9
+ const childProcess = spawn(scriptPath, args, {
10
+ stdio: [
11
+ 'ignore',
12
+ 'pipe',
13
+ 'pipe'
14
+ ],
15
+ env: env ? {
16
+ ...process.env,
17
+ ...env
18
+ } : process.env
19
+ });
20
+ return new Promise((resolve, reject)=>{
21
+ childProcess.on('close', (code)=>resolve(code ?? 0));
22
+ childProcess.on('error', reject);
23
+ childProcess.stdout?.on('data', (data)=>{
24
+ logger.info(data.toString());
25
+ });
26
+ childProcess.stderr?.on('data', (data)=>{
27
+ logger.error(data.toString());
28
+ });
29
+ });
30
+ }
31
+ /**
32
+ * Returns the absolute path to the git repository root
33
+ */ export function getGitProjectRoot() {
34
+ try {
35
+ const rootDir = execSync('git rev-parse --show-toplevel', {
36
+ encoding: 'utf-8',
37
+ stdio: [
38
+ 'ignore',
39
+ 'pipe',
40
+ 'ignore'
41
+ ]
42
+ }).trim();
43
+ return rootDir;
44
+ } catch (error) {
45
+ throw new Error(`Failed to determine git project root: ${error}`);
46
+ }
47
+ }
48
+ export function getAztecBin() {
49
+ return path.join(getGitProjectRoot(), 'yarn-project/aztec/dest/bin/index.js');
50
+ }
51
+ /**
52
+ * Runs the Aztec binary
53
+ * @param args - The arguments to pass to the Aztec binary
54
+ * @param logger - The logger to use
55
+ * @param env - Optional environment variables to set for the process
56
+ * @returns The exit code of the Aztec binary
57
+ */ export function runAztecBin(args, logger, env) {
58
+ return runScript('node', [
59
+ getAztecBin(),
60
+ ...args
61
+ ], logger, env);
62
+ }
63
+ export function runProjectScript(script, args, logger, env) {
64
+ const scriptPath = script.startsWith('/') ? script : path.join(getGitProjectRoot(), script);
65
+ return runScript(scriptPath, args, logger, env);
66
+ }
@@ -1,218 +1,2 @@
1
- import type { RollupCheatCodes } from '@aztec/aztec/testing';
2
- import type { L1ContractAddresses, ViemPublicClient } from '@aztec/ethereum';
3
- import type { Logger } from '@aztec/foundation/log';
4
- import { type AztecNodeAdmin, type AztecNodeAdminConfig, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
5
- import { ChildProcess } from 'child_process';
6
- import { z } from 'zod';
7
- declare const testConfigSchema: z.ZodObject<{
8
- NAMESPACE: z.ZodDefault<z.ZodString>;
9
- REAL_VERIFIER: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, boolean, number>, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, boolean, string>]>>>;
10
- CREATE_ETH_DEVNET: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, boolean, number>, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, boolean, string>]>>>;
11
- L1_RPC_URLS_JSON: z.ZodOptional<z.ZodString>;
12
- L1_ACCOUNT_MNEMONIC: z.ZodOptional<z.ZodString>;
13
- AZTEC_SLOT_DURATION: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
14
- AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15
- }, "strip", z.ZodTypeAny, {
16
- AZTEC_SLOT_DURATION: number;
17
- NAMESPACE: string;
18
- REAL_VERIFIER: boolean;
19
- CREATE_ETH_DEVNET: boolean;
20
- AZTEC_PROOF_SUBMISSION_WINDOW: number;
21
- L1_RPC_URLS_JSON?: string | undefined;
22
- L1_ACCOUNT_MNEMONIC?: string | undefined;
23
- }, {
24
- AZTEC_SLOT_DURATION?: number | undefined;
25
- NAMESPACE?: string | undefined;
26
- REAL_VERIFIER?: string | number | boolean | undefined;
27
- CREATE_ETH_DEVNET?: string | number | boolean | undefined;
28
- L1_RPC_URLS_JSON?: string | undefined;
29
- L1_ACCOUNT_MNEMONIC?: string | undefined;
30
- AZTEC_PROOF_SUBMISSION_WINDOW?: number | undefined;
31
- }>;
32
- export type TestConfig = z.infer<typeof testConfigSchema>;
33
- export declare function setupEnvironment(env: unknown): TestConfig;
34
- export declare function getAztecBin(): string;
35
- /**
36
- * Runs the Aztec binary
37
- * @param args - The arguments to pass to the Aztec binary
38
- * @param logger - The logger to use
39
- * @param env - Optional environment variables to set for the process
40
- * @returns The exit code of the Aztec binary
41
- */
42
- export declare function runAztecBin(args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
43
- export declare function runProjectScript(script: string, args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
44
- export declare function startPortForward({ resource, namespace, containerPort, hostPort, }: {
45
- resource: string;
46
- namespace: string;
47
- containerPort: number;
48
- hostPort?: number;
49
- }): Promise<{
50
- process: ChildProcess;
51
- port: number;
52
- }>;
53
- export declare function startPortForwardForRPC(namespace: string): Promise<{
54
- process: ChildProcess;
55
- port: number;
56
- }>;
57
- export declare function startPortForwardForEthereum(namespace: string): Promise<{
58
- process: ChildProcess;
59
- port: number;
60
- }>;
61
- export declare function deleteResourceByName({ resource, namespace, name, force, }: {
62
- resource: string;
63
- namespace: string;
64
- name: string;
65
- force?: boolean;
66
- }): Promise<string>;
67
- export declare function deleteResourceByLabel({ resource, namespace, label, timeout, force, }: {
68
- resource: string;
69
- namespace: string;
70
- label: string;
71
- timeout?: string;
72
- force?: boolean;
73
- }): Promise<string>;
74
- export declare function waitForResourceByLabel({ resource, label, namespace, condition, timeout, }: {
75
- resource: string;
76
- label: string;
77
- namespace: string;
78
- condition?: string;
79
- timeout?: string;
80
- }): Promise<string>;
81
- export declare function getChartDir(spartanDir: string, chartName: string): string;
82
- /**
83
- * Installs a Helm chart with the given parameters.
84
- * @param instanceName - The name of the Helm chart instance.
85
- * @param targetNamespace - The namespace with the resources to be affected by the Helm chart.
86
- * @param valuesFile - The values file to use for the Helm chart.
87
- * @param chaosMeshNamespace - The namespace to install the Helm chart in.
88
- * @param timeout - The timeout for the Helm command.
89
- * @param clean - Whether to clean up the Helm chart before installing it.
90
- * @returns The stdout of the Helm command.
91
- * @throws If the Helm command fails.
92
- *
93
- * Example usage:
94
- * ```typescript
95
- * const stdout = await installChaosMeshChart({ instanceName: 'force-reorg', targetNamespace: 'smoke', valuesFile: 'prover-failure.yaml'});
96
- * console.log(stdout);
97
- * ```
98
- */
99
- export declare function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace, timeout, clean, values, logger, }: {
100
- instanceName: string;
101
- targetNamespace: string;
102
- valuesFile: string;
103
- helmChartDir: string;
104
- chaosMeshNamespace?: string;
105
- timeout?: string;
106
- clean?: boolean;
107
- values?: Record<string, string | number>;
108
- logger: Logger;
109
- }): Promise<string>;
110
- export declare function applyProverFailure({ namespace, spartanDir, durationSeconds, logger, }: {
111
- namespace: string;
112
- spartanDir: string;
113
- durationSeconds: number;
114
- logger: Logger;
115
- }): Promise<string>;
116
- export declare function applyProverKill({ namespace, spartanDir, logger, }: {
117
- namespace: string;
118
- spartanDir: string;
119
- logger: Logger;
120
- }): Promise<string>;
121
- export declare function applyProverBrokerKill({ namespace, spartanDir, logger, }: {
122
- namespace: string;
123
- spartanDir: string;
124
- logger: Logger;
125
- }): Promise<string>;
126
- export declare function applyBootNodeFailure({ namespace, spartanDir, durationSeconds, logger, }: {
127
- namespace: string;
128
- spartanDir: string;
129
- durationSeconds: number;
130
- logger: Logger;
131
- }): Promise<string>;
132
- export declare function applyValidatorKill({ namespace, spartanDir, logger, values, }: {
133
- namespace: string;
134
- spartanDir: string;
135
- logger: Logger;
136
- values?: Record<string, string | number>;
137
- }): Promise<string>;
138
- export declare function applyNetworkShaping({ valuesFile, namespace, spartanDir, logger, }: {
139
- valuesFile: string;
140
- namespace: string;
141
- spartanDir: string;
142
- logger: Logger;
143
- }): Promise<string>;
144
- export declare function awaitL2BlockNumber(rollupCheatCodes: RollupCheatCodes, blockNumber: bigint, timeoutSeconds: number, logger: Logger): Promise<void>;
145
- export declare function restartBot(namespace: string, logger: Logger): Promise<void>;
146
- /**
147
- * Installs or upgrades the transfer bot Helm release for the given namespace.
148
- * Intended for test setup to enable L2 traffic generation only when needed.
149
- */
150
- export declare function installTransferBot({ namespace, spartanDir, logger, replicas, txIntervalSeconds, followChain, mnemonic, mnemonicStartIndex, botPrivateKey, nodeUrl, timeout, reuseValues, aztecSlotDuration, }: {
151
- namespace: string;
152
- spartanDir: string;
153
- logger: Logger;
154
- replicas?: number;
155
- txIntervalSeconds?: number;
156
- followChain?: string;
157
- mnemonic?: string;
158
- mnemonicStartIndex?: number | string;
159
- botPrivateKey?: string;
160
- nodeUrl?: string;
161
- timeout?: string;
162
- reuseValues?: boolean;
163
- aztecSlotDuration?: number;
164
- }): Promise<void>;
165
- /**
166
- * Uninstalls the transfer bot Helm release from the given namespace.
167
- * Intended for test teardown to clean up bot resources.
168
- */
169
- export declare function uninstallTransferBot(namespace: string, logger: Logger): Promise<void>;
170
- /**
171
- * Enables or disables probabilistic transaction dropping on validators and waits for rollout.
172
- * Wired to env vars P2P_DROP_TX and P2P_DROP_TX_CHANCE via Helm values.
173
- */
174
- export declare function setValidatorTxDrop({ namespace, enabled, probability, logger, }: {
175
- namespace: string;
176
- enabled: boolean;
177
- probability: number;
178
- logger: Logger;
179
- }): Promise<void>;
180
- export declare function restartValidators(namespace: string, logger: Logger): Promise<void>;
181
- export declare function enableValidatorDynamicBootNode(instanceName: string, namespace: string, spartanDir: string, logger: Logger): Promise<void>;
182
- export declare function getSequencers(namespace: string): Promise<string[]>;
183
- export declare function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>): Promise<AztecNodeAdminConfig[]>;
184
- export declare function getSequencersConfig(env: TestConfig): Promise<AztecNodeAdminConfig[]>;
185
- export declare function withSequencersAdmin<T>(env: TestConfig, fn: (node: AztecNodeAdmin) => Promise<T>): Promise<T[]>;
186
- /**
187
- * Returns a public viem client to the eth execution node. If it was part of a local eth devnet,
188
- * it first port-forwards the service and points to it. Otherwise, just uses the external RPC url.
189
- */
190
- export declare function getPublicViemClient(env: TestConfig,
191
- /** If set, will push the new process into it */
192
- processes?: ChildProcess[]): Promise<{
193
- url: string;
194
- client: ViemPublicClient;
195
- process?: ChildProcess;
196
- }>;
197
- /** Queries an Aztec node for the L1 deployment addresses */
198
- export declare function getL1DeploymentAddresses(env: TestConfig): Promise<L1ContractAddresses>;
199
- /**
200
- * Rolls the Aztec pods in the given namespace.
201
- * @param namespace - The namespace to roll the Aztec pods in.
202
- * @dev - IMPORTANT: This function DOES NOT delete the underlying PVCs.
203
- * This means that the pods will be restarted with the same persistent storage.
204
- * This is useful for testing, but you should be aware of the implications.
205
- */
206
- export declare function rollAztecPods(namespace: string): Promise<void>;
207
- /**
208
- * Returns the absolute path to the git repository root
209
- */
210
- export declare function getGitProjectRoot(): string;
211
- /** Returns a client to the RPC of the given sequencer (defaults to first) */
212
- export declare function getNodeClient(env: TestConfig, index?: number): Promise<{
213
- node: ReturnType<typeof createAztecNodeClient>;
214
- port: number;
215
- process: ChildProcess;
216
- }>;
217
- export {};
218
- //# sourceMappingURL=utils.d.ts.map
1
+ export * from './utils/index.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zcGFydGFuL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0JBQWtCLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAIpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,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