@aztec/end-to-end 2.1.0-rc.9 → 3.0.0-devnet.2
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 +3 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +16 -12
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +54 -58
- package/dest/bench/utils.d.ts +2 -11
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +10 -34
- 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 +10 -8
- 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 +31 -33
- package/dest/e2e_deploy_contract/deploy_test.d.ts +10 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +3 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +10 -9
- package/dest/e2e_fees/bridging_race.notest.js +12 -9
- 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 +23 -31
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -1
- 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 +6 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +7 -9
- 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 +5 -2
- package/dest/e2e_p2p/p2p_network.d.ts +16 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +32 -10
- package/dest/e2e_p2p/shared.d.ts +11 -13
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +49 -45
- package/dest/e2e_token_contract/token_contract_test.d.ts +5 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +8 -6
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +40 -50
- 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 +0 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +10 -7
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +44 -34
- package/dest/fixtures/token_utils.d.ts +6 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +11 -15
- package/dest/fixtures/utils.d.ts +23 -27
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +76 -101
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/web3signer.d.ts.map +1 -1
- package/dest/fixtures/web3signer.js +16 -5
- 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 +16 -10
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +13 -15
- package/dest/shared/gas_portal_test_harness.d.ts +9 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +10 -7
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +5 -3
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +9 -6
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +29 -45
- package/dest/simulators/lending_simulator.d.ts +2 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +3 -2
- package/dest/simulators/token_simulator.d.ts +3 -1
- 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 +19 -13
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +108 -85
- package/dest/spartan/utils.d.ts +44 -0
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +212 -20
- package/package.json +38 -37
- package/src/bench/client_flows/benchmark.ts +6 -6
- package/src/bench/client_flows/client_flows_benchmark.ts +62 -82
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +9 -37
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +33 -47
- package/src/e2e_deploy_contract/deploy_test.ts +17 -35
- package/src/e2e_epochs/epochs_test.ts +12 -14
- package/src/e2e_fees/bridging_race.notest.ts +14 -9
- package/src/e2e_fees/fees_test.ts +26 -38
- package/src/e2e_l1_publisher/write_json.ts +8 -6
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +11 -10
- package/src/e2e_p2p/inactivity_slash_test.ts +7 -3
- package/src/e2e_p2p/p2p_network.ts +105 -67
- package/src/e2e_p2p/shared.ts +50 -55
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +51 -88
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/setup_l1_contracts.ts +3 -3
- package/src/fixtures/setup_p2p_test.ts +0 -8
- package/src/fixtures/snapshot_manager.ts +61 -61
- package/src/fixtures/token_utils.ts +13 -21
- package/src/fixtures/utils.ts +87 -138
- package/src/fixtures/web3signer.ts +22 -5
- package/src/guides/up_quick_start.sh +2 -10
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +18 -29
- package/src/shared/gas_portal_test_harness.ts +12 -19
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +61 -67
- package/src/simulators/lending_simulator.ts +3 -2
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +8 -3
- package/src/spartan/setup_test_wallets.ts +133 -126
- package/src/spartan/utils.ts +268 -18
package/dest/spartan/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createLogger
|
|
1
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
2
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
3
3
|
import { schemas } from '@aztec/foundation/schemas';
|
|
4
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
4
5
|
import { createAztecNodeAdminClient, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
5
6
|
import { exec, execSync, spawn } from 'child_process';
|
|
6
7
|
import path from 'path';
|
|
@@ -13,7 +14,10 @@ const testConfigSchema = z.object({
|
|
|
13
14
|
NAMESPACE: z.string().default('scenario'),
|
|
14
15
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
15
16
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
16
|
-
L1_RPC_URLS_JSON: z.string().optional()
|
|
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)
|
|
17
21
|
});
|
|
18
22
|
export function setupEnvironment(env) {
|
|
19
23
|
const config = testConfigSchema.parse(env);
|
|
@@ -154,6 +158,13 @@ export async function deleteResourceByName({ resource, namespace, name, force =
|
|
|
154
158
|
return stdout;
|
|
155
159
|
}
|
|
156
160
|
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
|
+
}
|
|
157
168
|
const command = `kubectl delete ${resource} -l ${label} -n ${namespace} --ignore-not-found=true --wait=true --timeout=${timeout} ${force ? '--force' : ''}`;
|
|
158
169
|
logger.info(`command: ${command}`);
|
|
159
170
|
const { stdout } = await execAsync(command);
|
|
@@ -168,8 +179,12 @@ export async function waitForResourceByLabel({ resource, label, namespace, condi
|
|
|
168
179
|
export function getChartDir(spartanDir, chartName) {
|
|
169
180
|
return path.join(spartanDir.trim(), chartName);
|
|
170
181
|
}
|
|
182
|
+
function shellQuote(value) {
|
|
183
|
+
// Single-quote safe shell escaping: ' -> '\''
|
|
184
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
185
|
+
}
|
|
171
186
|
function valuesToArgs(values) {
|
|
172
|
-
return Object.entries(values).map(([key, value])
|
|
187
|
+
return Object.entries(values).map(([key, value])=>typeof value === 'number' || typeof value === 'boolean' ? `--set ${key}=${value}` : `--set-string ${key}=${shellQuote(String(value))}`).join(' ');
|
|
173
188
|
}
|
|
174
189
|
function createHelmCommand({ instanceName, helmChartDir, namespace, valuesFile, timeout, values, reuseValues = false }) {
|
|
175
190
|
const valuesFileArgs = valuesFile ? `--values ${helmChartDir}/values/${valuesFile}` : '';
|
|
@@ -198,26 +213,30 @@ async function execHelmCommand(args) {
|
|
|
198
213
|
* const stdout = await installChaosMeshChart({ instanceName: 'force-reorg', targetNamespace: 'smoke', valuesFile: 'prover-failure.yaml'});
|
|
199
214
|
* console.log(stdout);
|
|
200
215
|
* ```
|
|
201
|
-
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '
|
|
216
|
+
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '10m', clean = true, values = {}, logger }) {
|
|
202
217
|
if (clean) {
|
|
203
218
|
// uninstall the helm chart if it exists
|
|
204
219
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
205
220
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
206
|
-
// and delete the
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
// and delete the chaos-mesh resources created by this release
|
|
222
|
+
const deleteByLabel = async (resource)=>{
|
|
223
|
+
const args = {
|
|
224
|
+
resource,
|
|
225
|
+
namespace: chaosMeshNamespace,
|
|
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
|
+
});
|
|
219
236
|
});
|
|
220
|
-
}
|
|
237
|
+
};
|
|
238
|
+
await deleteByLabel('podchaos');
|
|
239
|
+
await deleteByLabel('networkchaos');
|
|
221
240
|
}
|
|
222
241
|
return execHelmCommand({
|
|
223
242
|
instanceName,
|
|
@@ -314,16 +333,189 @@ export async function restartBot(namespace, logger) {
|
|
|
314
333
|
await deleteResourceByLabel({
|
|
315
334
|
resource: 'pods',
|
|
316
335
|
namespace,
|
|
317
|
-
label: 'app=bot'
|
|
336
|
+
label: 'app.kubernetes.io/name=bot'
|
|
318
337
|
});
|
|
319
338
|
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.
|
|
320
341
|
await waitForResourceByLabel({
|
|
321
342
|
resource: 'pods',
|
|
322
343
|
namespace,
|
|
323
|
-
label: 'app=bot'
|
|
344
|
+
label: 'app.kubernetes.io/name=bot',
|
|
345
|
+
condition: 'PodReadyToStartContainers'
|
|
324
346
|
});
|
|
325
347
|
logger.info(`Bot restarted`);
|
|
326
348
|
}
|
|
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
|
+
}
|
|
327
519
|
export async function enableValidatorDynamicBootNode(instanceName, namespace, spartanDir, logger) {
|
|
328
520
|
logger.info(`Enabling validator dynamic boot node`);
|
|
329
521
|
await execHelmCommand({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-devnet.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,41 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "
|
|
29
|
-
"@aztec/archiver": "
|
|
30
|
-
"@aztec/aztec": "
|
|
31
|
-
"@aztec/aztec-node": "
|
|
32
|
-
"@aztec/aztec.js": "
|
|
33
|
-
"@aztec/bb-prover": "
|
|
34
|
-
"@aztec/blob-lib": "
|
|
35
|
-
"@aztec/blob-sink": "
|
|
36
|
-
"@aztec/bot": "
|
|
37
|
-
"@aztec/cli": "
|
|
38
|
-
"@aztec/constants": "
|
|
39
|
-
"@aztec/entrypoints": "
|
|
40
|
-
"@aztec/epoch-cache": "
|
|
41
|
-
"@aztec/ethereum": "
|
|
42
|
-
"@aztec/foundation": "
|
|
43
|
-
"@aztec/kv-store": "
|
|
44
|
-
"@aztec/l1-artifacts": "
|
|
45
|
-
"@aztec/merkle-tree": "
|
|
46
|
-
"@aztec/node-keystore": "
|
|
47
|
-
"@aztec/noir-contracts.js": "
|
|
48
|
-
"@aztec/noir-noirc_abi": "
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "
|
|
50
|
-
"@aztec/noir-test-contracts.js": "
|
|
51
|
-
"@aztec/p2p": "
|
|
52
|
-
"@aztec/protocol-contracts": "
|
|
53
|
-
"@aztec/prover-client": "
|
|
54
|
-
"@aztec/prover-node": "
|
|
55
|
-
"@aztec/pxe": "
|
|
56
|
-
"@aztec/sequencer-client": "
|
|
57
|
-
"@aztec/simulator": "
|
|
58
|
-
"@aztec/slasher": "
|
|
59
|
-
"@aztec/stdlib": "
|
|
60
|
-
"@aztec/telemetry-client": "
|
|
61
|
-
"@aztec/
|
|
62
|
-
"@aztec/
|
|
28
|
+
"@aztec/accounts": "3.0.0-devnet.2",
|
|
29
|
+
"@aztec/archiver": "3.0.0-devnet.2",
|
|
30
|
+
"@aztec/aztec": "3.0.0-devnet.2",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-devnet.2",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-devnet.2",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-devnet.2",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-devnet.2",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-devnet.2",
|
|
36
|
+
"@aztec/bot": "3.0.0-devnet.2",
|
|
37
|
+
"@aztec/cli": "3.0.0-devnet.2",
|
|
38
|
+
"@aztec/constants": "3.0.0-devnet.2",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-devnet.2",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-devnet.2",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-devnet.2",
|
|
42
|
+
"@aztec/foundation": "3.0.0-devnet.2",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-devnet.2",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-devnet.2",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-devnet.2",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-devnet.2",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-devnet.2",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-devnet.2",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-devnet.2",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-devnet.2",
|
|
51
|
+
"@aztec/p2p": "3.0.0-devnet.2",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-devnet.2",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-devnet.2",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-devnet.2",
|
|
55
|
+
"@aztec/pxe": "3.0.0-devnet.2",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-devnet.2",
|
|
57
|
+
"@aztec/simulator": "3.0.0-devnet.2",
|
|
58
|
+
"@aztec/slasher": "3.0.0-devnet.2",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-devnet.2",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-devnet.2",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-devnet.2",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-devnet.2",
|
|
63
|
+
"@aztec/world-state": "3.0.0-devnet.2",
|
|
63
64
|
"@iarna/toml": "^2.2.5",
|
|
64
65
|
"@jest/globals": "^30.0.0",
|
|
65
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
"tslib": "^2.4.0",
|
|
97
98
|
"typescript": "^5.3.3",
|
|
98
99
|
"util": "^0.12.5",
|
|
99
|
-
"viem": "2.
|
|
100
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
|
|
100
101
|
"zod": "^3.23.8"
|
|
101
102
|
},
|
|
102
103
|
"devDependencies": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
ContractFunctionInteraction,
|
|
3
3
|
DeployMethod,
|
|
4
|
-
DeployOptions,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '@aztec/aztec.js';
|
|
4
|
+
type DeployOptions,
|
|
5
|
+
type ProfileInteractionOptions,
|
|
6
|
+
} from '@aztec/aztec.js/contracts';
|
|
7
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
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<ProfileInteractionOptions & DeployOptions, 'profileMode'>,
|
|
305
305
|
expectedSteps?: number,
|
|
306
306
|
) {
|
|
307
307
|
// Make sure the proxy logger starts from a clean slate
|