@aztec/end-to-end 0.0.1-fake-c83136db25 → 0.0.1-fake-ceab37513c
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.
- package/dest/bench/client_flows/benchmark.d.ts +2 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +12 -16
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +58 -54
- package/dest/bench/client_flows/data_extractor.js +3 -3
- package/dest/bench/utils.d.ts +11 -2
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +34 -10
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -7
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +8 -10
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +33 -31
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -10
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +18 -9
- package/dest/e2e_epochs/epochs_test.d.ts +1 -3
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +9 -10
- package/dest/e2e_fees/bridging_race.notest.js +9 -12
- package/dest/e2e_fees/fees_test.d.ts +5 -5
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +31 -23
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +5 -5
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -6
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +9 -7
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +2 -2
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +2 -5
- package/dest/e2e_p2p/p2p_network.d.ts +2 -14
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +10 -32
- package/dest/e2e_p2p/shared.d.ts +13 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +45 -49
- package/dest/e2e_token_contract/token_contract_test.d.ts +4 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +17 -14
- package/dest/fixtures/e2e_prover_test.d.ts +6 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +50 -40
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +2 -2
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +2 -2
- package/dest/fixtures/setup_p2p_test.d.ts +7 -0
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +7 -10
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +32 -42
- package/dest/fixtures/token_utils.d.ts +4 -6
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +15 -11
- package/dest/fixtures/utils.d.ts +27 -23
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +100 -75
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/web3signer.d.ts.map +1 -1
- package/dest/fixtures/web3signer.js +5 -16
- package/dest/quality_of_service/alert_checker.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +10 -16
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +15 -13
- package/dest/shared/gas_portal_test_harness.d.ts +6 -9
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +7 -10
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +3 -5
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +7 -8
- package/dest/shared/uniswap_l1_l2.d.ts +6 -9
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +45 -29
- package/dest/simulators/lending_simulator.d.ts +1 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +2 -3
- package/dest/simulators/token_simulator.d.ts +1 -3
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +13 -19
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +84 -107
- package/dest/spartan/utils.d.ts +0 -44
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +20 -212
- package/package.json +36 -37
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +82 -62
- package/src/bench/client_flows/data_extractor.ts +4 -4
- package/src/bench/utils.ts +37 -9
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +63 -46
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +47 -33
- package/src/e2e_deploy_contract/deploy_test.ts +35 -17
- package/src/e2e_epochs/epochs_test.ts +14 -12
- package/src/e2e_fees/bridging_race.notest.ts +9 -14
- package/src/e2e_fees/fees_test.ts +38 -26
- package/src/e2e_l1_publisher/write_json.ts +6 -8
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +10 -11
- package/src/e2e_p2p/inactivity_slash_test.ts +3 -7
- package/src/e2e_p2p/p2p_network.ts +67 -105
- package/src/e2e_p2p/shared.ts +55 -50
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +88 -51
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +2 -3
- package/src/fixtures/setup_l1_contracts.ts +3 -3
- package/src/fixtures/setup_p2p_test.ts +8 -0
- package/src/fixtures/snapshot_manager.ts +59 -59
- package/src/fixtures/token_utils.ts +21 -13
- package/src/fixtures/utils.ts +137 -86
- package/src/fixtures/web3signer.ts +5 -22
- package/src/guides/up_quick_start.sh +10 -2
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +29 -18
- package/src/shared/gas_portal_test_harness.ts +19 -12
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +8 -12
- package/src/shared/uniswap_l1_l2.ts +67 -61
- package/src/simulators/lending_simulator.ts +2 -3
- package/src/simulators/token_simulator.ts +2 -5
- package/src/spartan/DEVELOP.md +3 -8
- package/src/spartan/setup_test_wallets.ts +125 -132
- package/src/spartan/utils.ts +18 -268
package/dest/spartan/utils.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/aztec.js
|
|
1
|
+
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
2
2
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
3
3
|
import { schemas } from '@aztec/foundation/schemas';
|
|
4
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
5
4
|
import { createAztecNodeAdminClient, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
6
5
|
import { exec, execSync, spawn } from 'child_process';
|
|
7
6
|
import path from 'path';
|
|
@@ -14,10 +13,7 @@ const testConfigSchema = z.object({
|
|
|
14
13
|
NAMESPACE: z.string().default('scenario'),
|
|
15
14
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
16
15
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
17
|
-
L1_RPC_URLS_JSON: z.string().optional()
|
|
18
|
-
L1_ACCOUNT_MNEMONIC: z.string().optional(),
|
|
19
|
-
AZTEC_SLOT_DURATION: z.coerce.number().optional().default(24),
|
|
20
|
-
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5)
|
|
16
|
+
L1_RPC_URLS_JSON: z.string().optional()
|
|
21
17
|
});
|
|
22
18
|
export function setupEnvironment(env) {
|
|
23
19
|
const config = testConfigSchema.parse(env);
|
|
@@ -158,13 +154,6 @@ export async function deleteResourceByName({ resource, namespace, name, force =
|
|
|
158
154
|
return stdout;
|
|
159
155
|
}
|
|
160
156
|
export async function deleteResourceByLabel({ resource, namespace, label, timeout = '5m', force = false }) {
|
|
161
|
-
// Check if the resource type exists before attempting to delete
|
|
162
|
-
try {
|
|
163
|
-
await execAsync(`kubectl api-resources --api-group="" --no-headers -o name | grep -q "^${resource}$" || kubectl api-resources --no-headers -o name | grep -q "^${resource}$"`);
|
|
164
|
-
} catch (error) {
|
|
165
|
-
logger.warn(`Resource type '${resource}' not found in cluster, skipping deletion ${error}`);
|
|
166
|
-
return '';
|
|
167
|
-
}
|
|
168
157
|
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout} ${force ? '--force' : ''}`;
|
|
169
158
|
logger.info(`command: ${command}`);
|
|
170
159
|
const { stdout } = await execAsync(command);
|
|
@@ -179,12 +168,8 @@ export async function waitForResourceByLabel({ resource, label, namespace, condi
|
|
|
179
168
|
export function getChartDir(spartanDir, chartName) {
|
|
180
169
|
return path.join(spartanDir.trim(), chartName);
|
|
181
170
|
}
|
|
182
|
-
function shellQuote(value) {
|
|
183
|
-
// Single-quote safe shell escaping: ' -> '\''
|
|
184
|
-
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
185
|
-
}
|
|
186
171
|
function valuesToArgs(values) {
|
|
187
|
-
return Object.entries(values).map(([key, value])
|
|
172
|
+
return Object.entries(values).map(([key, value])=>`--set ${key}=${value}`).join(' ');
|
|
188
173
|
}
|
|
189
174
|
function createHelmCommand({ instanceName, helmChartDir, namespace, valuesFile, timeout, values, reuseValues = false }) {
|
|
190
175
|
const valuesFileArgs = valuesFile ? `--values ${helmChartDir}/values/${valuesFile}` : '';
|
|
@@ -213,30 +198,26 @@ async function execHelmCommand(args) {
|
|
|
213
198
|
* const stdout = await installChaosMeshChart({ instanceName: 'force-reorg', targetNamespace: 'smoke', valuesFile: 'prover-failure.yaml'});
|
|
214
199
|
* console.log(stdout);
|
|
215
200
|
* ```
|
|
216
|
-
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '
|
|
201
|
+
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '5m', clean = true, values = {}, logger }) {
|
|
217
202
|
if (clean) {
|
|
218
203
|
// uninstall the helm chart if it exists
|
|
219
204
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
220
205
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
221
|
-
// and delete the
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
label: `app.kubernetes.io/instance=${instanceName}`
|
|
227
|
-
};
|
|
228
|
-
logger.info(`Deleting ${resource} resources for release ${instanceName}`);
|
|
229
|
-
await deleteResourceByLabel(args).catch((e)=>{
|
|
230
|
-
logger.error(`Error deleting ${resource}: ${e}`);
|
|
231
|
-
logger.info(`Force deleting ${resource}`);
|
|
232
|
-
return deleteResourceByLabel({
|
|
233
|
-
...args,
|
|
234
|
-
force: true
|
|
235
|
-
});
|
|
236
|
-
});
|
|
206
|
+
// and delete the podchaos resource
|
|
207
|
+
const deleteArgs = {
|
|
208
|
+
resource: 'podchaos',
|
|
209
|
+
namespace: chaosMeshNamespace,
|
|
210
|
+
label: `app.kubernetes.io/instance=${instanceName}`
|
|
237
211
|
};
|
|
238
|
-
|
|
239
|
-
await
|
|
212
|
+
logger.info(`Deleting podchaos resource`);
|
|
213
|
+
await deleteResourceByLabel(deleteArgs).catch((e)=>{
|
|
214
|
+
logger.error(`Error deleting podchaos resource: ${e}`);
|
|
215
|
+
logger.info(`Force deleting podchaos resource`);
|
|
216
|
+
return deleteResourceByLabel({
|
|
217
|
+
...deleteArgs,
|
|
218
|
+
force: true
|
|
219
|
+
});
|
|
220
|
+
});
|
|
240
221
|
}
|
|
241
222
|
return execHelmCommand({
|
|
242
223
|
instanceName,
|
|
@@ -333,189 +314,16 @@ export async function restartBot(namespace, logger) {
|
|
|
333
314
|
await deleteResourceByLabel({
|
|
334
315
|
resource: 'pods',
|
|
335
316
|
namespace,
|
|
336
|
-
label: 'app
|
|
317
|
+
label: 'app=bot'
|
|
337
318
|
});
|
|
338
319
|
await sleep(10 * 1000);
|
|
339
|
-
// Some bot images may take time to report Ready due to heavy boot-time proving.
|
|
340
|
-
// Waiting for PodReadyToStartContainers ensures the pod is scheduled and starting without blocking on full readiness.
|
|
341
320
|
await waitForResourceByLabel({
|
|
342
321
|
resource: 'pods',
|
|
343
322
|
namespace,
|
|
344
|
-
label: 'app
|
|
345
|
-
condition: 'PodReadyToStartContainers'
|
|
323
|
+
label: 'app=bot'
|
|
346
324
|
});
|
|
347
325
|
logger.info(`Bot restarted`);
|
|
348
326
|
}
|
|
349
|
-
/**
|
|
350
|
-
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
351
|
-
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
352
|
-
*/ export async function installTransferBot({ namespace, spartanDir, logger, replicas = 1, txIntervalSeconds = 10, followChain = 'PENDING', mnemonic = process.env.LABS_INFRA_MNEMONIC ?? 'test test test test test test test test test test test junk', mnemonicStartIndex, botPrivateKey = process.env.BOT_TRANSFERS_L2_PRIVATE_KEY ?? '0xcafe01', nodeUrl, timeout = '15m', reuseValues = true, aztecSlotDuration = Number(process.env.AZTEC_SLOT_DURATION ?? 12) }) {
|
|
353
|
-
const instanceName = `${namespace}-bot-transfers`;
|
|
354
|
-
const helmChartDir = getChartDir(spartanDir, 'aztec-bot');
|
|
355
|
-
const resolvedNodeUrl = nodeUrl ?? `http://${namespace}-rpc-aztec-node.${namespace}.svc.cluster.local:8080`;
|
|
356
|
-
logger.info(`Installing/upgrading transfer bot: replicas=${replicas}, followChain=${followChain}`);
|
|
357
|
-
const values = {
|
|
358
|
-
'bot.replicaCount': replicas,
|
|
359
|
-
'bot.txIntervalSeconds': txIntervalSeconds,
|
|
360
|
-
'bot.followChain': followChain,
|
|
361
|
-
'bot.botPrivateKey': botPrivateKey,
|
|
362
|
-
'bot.nodeUrl': resolvedNodeUrl,
|
|
363
|
-
'bot.mnemonic': mnemonic,
|
|
364
|
-
'bot.feePaymentMethod': 'fee_juice',
|
|
365
|
-
'aztec.slotDuration': aztecSlotDuration,
|
|
366
|
-
// Ensure bot can reach its own PXE started in-process (default rpc.port is 8080)
|
|
367
|
-
// Note: since aztec-bot depends on aztec-node with alias `bot`, env vars go under `bot.node.env`.
|
|
368
|
-
'bot.node.env.BOT_PXE_URL': 'http://127.0.0.1:8080',
|
|
369
|
-
// Provide L1 execution RPC for bridging fee juice
|
|
370
|
-
'bot.node.env.ETHEREUM_HOSTS': `http://${namespace}-eth-execution.${namespace}.svc.cluster.local:8545`,
|
|
371
|
-
// Provide L1 mnemonic for bridging (falls back to labs mnemonic)
|
|
372
|
-
'bot.node.env.BOT_L1_MNEMONIC': mnemonic
|
|
373
|
-
};
|
|
374
|
-
// Ensure we derive a funded L1 key (index 0 is funded on anvil default mnemonic)
|
|
375
|
-
if (mnemonicStartIndex === undefined) {
|
|
376
|
-
values['bot.mnemonicStartIndex'] = 0;
|
|
377
|
-
}
|
|
378
|
-
// Also pass a funded private key directly if available
|
|
379
|
-
if (process.env.FUNDING_PRIVATE_KEY) {
|
|
380
|
-
values['bot.node.env.BOT_L1_PRIVATE_KEY'] = process.env.FUNDING_PRIVATE_KEY;
|
|
381
|
-
}
|
|
382
|
-
// Align bot image with the running network image: prefer env var, else detect from a validator pod
|
|
383
|
-
let repositoryFromEnv;
|
|
384
|
-
let tagFromEnv;
|
|
385
|
-
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
386
|
-
if (aztecDockerImage && aztecDockerImage.includes(':')) {
|
|
387
|
-
const lastColon = aztecDockerImage.lastIndexOf(':');
|
|
388
|
-
repositoryFromEnv = aztecDockerImage.slice(0, lastColon);
|
|
389
|
-
tagFromEnv = aztecDockerImage.slice(lastColon + 1);
|
|
390
|
-
}
|
|
391
|
-
let repository = repositoryFromEnv;
|
|
392
|
-
let tag = tagFromEnv;
|
|
393
|
-
if (!repository || !tag) {
|
|
394
|
-
try {
|
|
395
|
-
const { stdout } = await execAsync(`kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[0].spec.containers[?(@.name=="aztec")].image}' | cat`);
|
|
396
|
-
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
397
|
-
if (image && image.includes(':')) {
|
|
398
|
-
const lastColon = image.lastIndexOf(':');
|
|
399
|
-
repository = image.slice(0, lastColon);
|
|
400
|
-
tag = image.slice(lastColon + 1);
|
|
401
|
-
}
|
|
402
|
-
} catch (err) {
|
|
403
|
-
logger.warn(`Could not detect aztec image from validator pod: ${String(err)}`);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (repository && tag) {
|
|
407
|
-
values['global.aztecImage.repository'] = repository;
|
|
408
|
-
values['global.aztecImage.tag'] = tag;
|
|
409
|
-
}
|
|
410
|
-
if (mnemonicStartIndex !== undefined) {
|
|
411
|
-
values['bot.mnemonicStartIndex'] = typeof mnemonicStartIndex === 'string' ? mnemonicStartIndex : Number(mnemonicStartIndex);
|
|
412
|
-
}
|
|
413
|
-
await execHelmCommand({
|
|
414
|
-
instanceName,
|
|
415
|
-
helmChartDir,
|
|
416
|
-
namespace,
|
|
417
|
-
valuesFile: undefined,
|
|
418
|
-
timeout,
|
|
419
|
-
values: values,
|
|
420
|
-
reuseValues
|
|
421
|
-
});
|
|
422
|
-
if (replicas > 0) {
|
|
423
|
-
await waitForResourceByLabel({
|
|
424
|
-
resource: 'pods',
|
|
425
|
-
namespace,
|
|
426
|
-
label: 'app.kubernetes.io/name=bot',
|
|
427
|
-
condition: 'PodReadyToStartContainers'
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
433
|
-
* Intended for test teardown to clean up bot resources.
|
|
434
|
-
*/ export async function uninstallTransferBot(namespace, logger) {
|
|
435
|
-
const instanceName = `${namespace}-bot-transfers`;
|
|
436
|
-
logger.info(`Uninstalling transfer bot release ${instanceName}`);
|
|
437
|
-
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
438
|
-
// Ensure any leftover pods are removed
|
|
439
|
-
await deleteResourceByLabel({
|
|
440
|
-
resource: 'pods',
|
|
441
|
-
namespace,
|
|
442
|
-
label: 'app.kubernetes.io/name=bot'
|
|
443
|
-
}).catch(()=>undefined);
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Enables or disables probabilistic transaction dropping on validators and waits for rollout.
|
|
447
|
-
* Wired to env vars P2P_DROP_TX and P2P_DROP_TX_CHANCE via Helm values.
|
|
448
|
-
*/ export async function setValidatorTxDrop({ namespace, enabled, probability, logger }) {
|
|
449
|
-
const drop = enabled ? 'true' : 'false';
|
|
450
|
-
const prob = String(probability);
|
|
451
|
-
const selectors = [
|
|
452
|
-
'app=validator',
|
|
453
|
-
'app.kubernetes.io/component=validator'
|
|
454
|
-
];
|
|
455
|
-
let updated = false;
|
|
456
|
-
for (const selector of selectors){
|
|
457
|
-
try {
|
|
458
|
-
const list = await execAsync(`kubectl get statefulset -l ${selector} -n ${namespace} --no-headers -o name | cat`);
|
|
459
|
-
const names = list.stdout.split('\n').map((s)=>s.trim()).filter(Boolean);
|
|
460
|
-
if (names.length === 0) {
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace} P2P_DROP_TX=${drop} P2P_DROP_TX_CHANCE=${prob}`;
|
|
464
|
-
logger.info(`command: ${cmd}`);
|
|
465
|
-
await execAsync(cmd);
|
|
466
|
-
updated = true;
|
|
467
|
-
} catch (e) {
|
|
468
|
-
logger.warn(`Failed to update validators with selector ${selector}: ${String(e)}`);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
if (!updated) {
|
|
472
|
-
logger.warn(`No validator StatefulSets found in ${namespace}. Skipping tx drop toggle.`);
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
// Restart validator pods to ensure env vars take effect and wait for readiness
|
|
476
|
-
await restartValidators(namespace, logger);
|
|
477
|
-
}
|
|
478
|
-
export async function restartValidators(namespace, logger) {
|
|
479
|
-
const selectors = [
|
|
480
|
-
'app=validator',
|
|
481
|
-
'app.kubernetes.io/component=validator'
|
|
482
|
-
];
|
|
483
|
-
let any = false;
|
|
484
|
-
for (const selector of selectors){
|
|
485
|
-
try {
|
|
486
|
-
const { stdout } = await execAsync(`kubectl get pods -l ${selector} -n ${namespace} --no-headers -o name | cat`);
|
|
487
|
-
if (!stdout || stdout.trim().length === 0) {
|
|
488
|
-
continue;
|
|
489
|
-
}
|
|
490
|
-
any = true;
|
|
491
|
-
await deleteResourceByLabel({
|
|
492
|
-
resource: 'pods',
|
|
493
|
-
namespace,
|
|
494
|
-
label: selector
|
|
495
|
-
});
|
|
496
|
-
} catch (e) {
|
|
497
|
-
logger.warn(`Error restarting validator pods with selector ${selector}: ${String(e)}`);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
if (!any) {
|
|
501
|
-
logger.warn(`No validator pods found to restart in ${namespace}.`);
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
// Wait for either label to be Ready
|
|
505
|
-
for (const selector of selectors){
|
|
506
|
-
try {
|
|
507
|
-
await waitForResourceByLabel({
|
|
508
|
-
resource: 'pods',
|
|
509
|
-
namespace,
|
|
510
|
-
label: selector
|
|
511
|
-
});
|
|
512
|
-
return;
|
|
513
|
-
} catch {
|
|
514
|
-
// try next
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
logger.warn(`Validator pods did not report Ready; continuing.`);
|
|
518
|
-
}
|
|
519
327
|
export async function enableValidatorDynamicBootNode(instanceName, namespace, spartanDir, logger) {
|
|
520
328
|
logger.info(`Enabling validator dynamic boot node`);
|
|
521
329
|
await execHelmCommand({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-fake-
|
|
3
|
+
"version": "0.0.1-fake-ceab37513c",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,41 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.0.1-fake-
|
|
29
|
-
"@aztec/archiver": "0.0.1-fake-
|
|
30
|
-
"@aztec/aztec": "0.0.1-fake-
|
|
31
|
-
"@aztec/aztec-node": "0.0.1-fake-
|
|
32
|
-
"@aztec/aztec.js": "0.0.1-fake-
|
|
33
|
-
"@aztec/bb-prover": "0.0.1-fake-
|
|
34
|
-
"@aztec/blob-lib": "0.0.1-fake-
|
|
35
|
-
"@aztec/blob-sink": "0.0.1-fake-
|
|
36
|
-
"@aztec/bot": "0.0.1-fake-
|
|
37
|
-
"@aztec/cli": "0.0.1-fake-
|
|
38
|
-
"@aztec/constants": "0.0.1-fake-
|
|
39
|
-
"@aztec/entrypoints": "0.0.1-fake-
|
|
40
|
-
"@aztec/epoch-cache": "0.0.1-fake-
|
|
41
|
-
"@aztec/ethereum": "0.0.1-fake-
|
|
42
|
-
"@aztec/foundation": "0.0.1-fake-
|
|
43
|
-
"@aztec/kv-store": "0.0.1-fake-
|
|
44
|
-
"@aztec/l1-artifacts": "0.0.1-fake-
|
|
45
|
-
"@aztec/merkle-tree": "0.0.1-fake-
|
|
46
|
-
"@aztec/node-keystore": "0.0.1-fake-
|
|
47
|
-
"@aztec/noir-contracts.js": "0.0.1-fake-
|
|
48
|
-
"@aztec/noir-noirc_abi": "0.0.1-fake-
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-fake-
|
|
50
|
-
"@aztec/noir-test-contracts.js": "0.0.1-fake-
|
|
51
|
-
"@aztec/p2p": "0.0.1-fake-
|
|
52
|
-
"@aztec/protocol-contracts": "0.0.1-fake-
|
|
53
|
-
"@aztec/prover-client": "0.0.1-fake-
|
|
54
|
-
"@aztec/prover-node": "0.0.1-fake-
|
|
55
|
-
"@aztec/pxe": "0.0.1-fake-
|
|
56
|
-
"@aztec/sequencer-client": "0.0.1-fake-
|
|
57
|
-
"@aztec/simulator": "0.0.1-fake-
|
|
58
|
-
"@aztec/slasher": "0.0.1-fake-
|
|
59
|
-
"@aztec/stdlib": "0.0.1-fake-
|
|
60
|
-
"@aztec/telemetry-client": "0.0.1-fake-
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/world-state": "0.0.1-fake-c83136db25",
|
|
28
|
+
"@aztec/accounts": "0.0.1-fake-ceab37513c",
|
|
29
|
+
"@aztec/archiver": "0.0.1-fake-ceab37513c",
|
|
30
|
+
"@aztec/aztec": "0.0.1-fake-ceab37513c",
|
|
31
|
+
"@aztec/aztec-node": "0.0.1-fake-ceab37513c",
|
|
32
|
+
"@aztec/aztec.js": "0.0.1-fake-ceab37513c",
|
|
33
|
+
"@aztec/bb-prover": "0.0.1-fake-ceab37513c",
|
|
34
|
+
"@aztec/blob-lib": "0.0.1-fake-ceab37513c",
|
|
35
|
+
"@aztec/blob-sink": "0.0.1-fake-ceab37513c",
|
|
36
|
+
"@aztec/bot": "0.0.1-fake-ceab37513c",
|
|
37
|
+
"@aztec/cli": "0.0.1-fake-ceab37513c",
|
|
38
|
+
"@aztec/constants": "0.0.1-fake-ceab37513c",
|
|
39
|
+
"@aztec/entrypoints": "0.0.1-fake-ceab37513c",
|
|
40
|
+
"@aztec/epoch-cache": "0.0.1-fake-ceab37513c",
|
|
41
|
+
"@aztec/ethereum": "0.0.1-fake-ceab37513c",
|
|
42
|
+
"@aztec/foundation": "0.0.1-fake-ceab37513c",
|
|
43
|
+
"@aztec/kv-store": "0.0.1-fake-ceab37513c",
|
|
44
|
+
"@aztec/l1-artifacts": "0.0.1-fake-ceab37513c",
|
|
45
|
+
"@aztec/merkle-tree": "0.0.1-fake-ceab37513c",
|
|
46
|
+
"@aztec/node-keystore": "0.0.1-fake-ceab37513c",
|
|
47
|
+
"@aztec/noir-contracts.js": "0.0.1-fake-ceab37513c",
|
|
48
|
+
"@aztec/noir-noirc_abi": "0.0.1-fake-ceab37513c",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-fake-ceab37513c",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "0.0.1-fake-ceab37513c",
|
|
51
|
+
"@aztec/p2p": "0.0.1-fake-ceab37513c",
|
|
52
|
+
"@aztec/protocol-contracts": "0.0.1-fake-ceab37513c",
|
|
53
|
+
"@aztec/prover-client": "0.0.1-fake-ceab37513c",
|
|
54
|
+
"@aztec/prover-node": "0.0.1-fake-ceab37513c",
|
|
55
|
+
"@aztec/pxe": "0.0.1-fake-ceab37513c",
|
|
56
|
+
"@aztec/sequencer-client": "0.0.1-fake-ceab37513c",
|
|
57
|
+
"@aztec/simulator": "0.0.1-fake-ceab37513c",
|
|
58
|
+
"@aztec/slasher": "0.0.1-fake-ceab37513c",
|
|
59
|
+
"@aztec/stdlib": "0.0.1-fake-ceab37513c",
|
|
60
|
+
"@aztec/telemetry-client": "0.0.1-fake-ceab37513c",
|
|
61
|
+
"@aztec/validator-client": "0.0.1-fake-ceab37513c",
|
|
62
|
+
"@aztec/world-state": "0.0.1-fake-ceab37513c",
|
|
64
63
|
"@iarna/toml": "^2.2.5",
|
|
65
64
|
"@jest/globals": "^30.0.0",
|
|
66
65
|
"@noble/curves": "=1.0.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ContractFunctionInteraction,
|
|
3
3
|
DeployMethod,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
DeployOptions,
|
|
5
|
+
Logger,
|
|
6
|
+
ProfileMethodOptions,
|
|
7
|
+
} from '@aztec/aztec.js';
|
|
8
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { type PrivateExecutionStep, serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
10
10
|
import type { ProvingStats, ProvingTimings, SimulationStats, SimulationTimings } from '@aztec/stdlib/tx';
|
|
@@ -301,7 +301,7 @@ export function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): Git
|
|
|
301
301
|
export async function captureProfile(
|
|
302
302
|
label: string,
|
|
303
303
|
interaction: ContractFunctionInteraction | DeployMethod,
|
|
304
|
-
opts: Omit<
|
|
304
|
+
opts: Omit<ProfileMethodOptions & DeployOptions, 'profileMode'>,
|
|
305
305
|
expectedSteps?: number,
|
|
306
306
|
) {
|
|
307
307
|
// Make sure the proxy logger starts from a clean slate
|
|
@@ -315,12 +315,12 @@ export async function captureProfile(
|
|
|
315
315
|
|
|
316
316
|
const ivcFolder = process.env.CAPTURE_IVC_FOLDER;
|
|
317
317
|
if (ivcFolder) {
|
|
318
|
-
logger.info(`Capturing
|
|
318
|
+
logger.info(`Capturing client ivc execution profile for ${label}`);
|
|
319
319
|
|
|
320
320
|
const resultsDirectory = join(ivcFolder, label);
|
|
321
321
|
logger.info(`Writing private execution steps to ${resultsDirectory}`);
|
|
322
322
|
await mkdir(resultsDirectory, { recursive: true });
|
|
323
|
-
// Write the
|
|
323
|
+
// Write the client IVC files read by the prover.
|
|
324
324
|
const ivcInputsPath = join(resultsDirectory, 'ivc-inputs.msgpack');
|
|
325
325
|
await writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
|
|
326
326
|
await writeFile(join(resultsDirectory, 'logs.json'), JSON.stringify(logs, null, 2));
|