@aztec/end-to-end 3.0.0-nightly.20251015 → 3.0.0-nightly.20251022
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/e2e_p2p/p2p_network.d.ts +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/spartan/utils.d.ts +33 -0
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +129 -19
- package/package.json +38 -38
- package/src/spartan/DEVELOP.md +5 -0
- package/src/spartan/utils.ts +174 -16
|
@@ -34,13 +34,13 @@ export declare class P2PNetworkTest {
|
|
|
34
34
|
sign: (parameters: {
|
|
35
35
|
hash: import("viem").Hash;
|
|
36
36
|
}) => Promise<import("viem").Hex>;
|
|
37
|
-
|
|
37
|
+
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
38
38
|
signMessage: ({ message }: {
|
|
39
39
|
message: import("viem").SignableMessage;
|
|
40
40
|
}) => Promise<import("viem").Hex>;
|
|
41
41
|
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
42
42
|
serializer?: serializer | undefined;
|
|
43
|
-
} | undefined) => Promise<import("viem").
|
|
43
|
+
} | undefined) => Promise<import("viem").Hex>;
|
|
44
44
|
signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
|
|
45
45
|
publicKey: import("viem").Hex;
|
|
46
46
|
source: "privateKey";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"A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CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,YAAY,CAAC;QAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;IAwBD,IAAI,aAAa,uBAKhB;IAEK,gBAAgB;IActB,aAAa;;;IAkBP,kBAAkB;IAsElB,YAAY;IAaZ,kBAAkB;IAsBlB,iBAAiB;IAgBjB,WAAW;;;;YAIH,YAAY;IAQpB,KAAK;IAcL,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE;IAanC,QAAQ;IAMR,YAAY,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;QAC7F,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CA0BH"}
|
package/dest/spartan/utils.d.ts
CHANGED
|
@@ -9,16 +9,25 @@ declare const testConfigSchema: z.ZodObject<{
|
|
|
9
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
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
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>>;
|
|
12
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
AZTEC_SLOT_DURATION: number;
|
|
13
17
|
NAMESPACE: string;
|
|
14
18
|
REAL_VERIFIER: boolean;
|
|
15
19
|
CREATE_ETH_DEVNET: boolean;
|
|
20
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
16
21
|
L1_RPC_URLS_JSON?: string | undefined;
|
|
22
|
+
L1_ACCOUNT_MNEMONIC?: string | undefined;
|
|
17
23
|
}, {
|
|
24
|
+
AZTEC_SLOT_DURATION?: number | undefined;
|
|
18
25
|
NAMESPACE?: string | undefined;
|
|
19
26
|
REAL_VERIFIER?: string | number | boolean | undefined;
|
|
20
27
|
CREATE_ETH_DEVNET?: string | number | boolean | undefined;
|
|
21
28
|
L1_RPC_URLS_JSON?: string | undefined;
|
|
29
|
+
L1_ACCOUNT_MNEMONIC?: string | undefined;
|
|
30
|
+
AZTEC_PROOF_SUBMISSION_WINDOW?: number | undefined;
|
|
22
31
|
}>;
|
|
23
32
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
24
33
|
export declare function setupEnvironment(env: unknown): TestConfig;
|
|
@@ -134,6 +143,30 @@ export declare function applyNetworkShaping({ valuesFile, namespace, spartanDir,
|
|
|
134
143
|
}): Promise<string>;
|
|
135
144
|
export declare function awaitL2BlockNumber(rollupCheatCodes: RollupCheatCodes, blockNumber: bigint, timeoutSeconds: number, logger: Logger): Promise<void>;
|
|
136
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>;
|
|
137
170
|
export declare function enableValidatorDynamicBootNode(instanceName: string, namespace: string, spartanDir: string, logger: Logger): Promise<void>;
|
|
138
171
|
export declare function getSequencers(namespace: string): Promise<string[]>;
|
|
139
172
|
export declare function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>): Promise<AztecNodeAdminConfig[]>;
|
|
@@ -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;AAGpD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAG1B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAIpE,OAAO,EAAE,CAAC,EAAE,MAA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CHANGED
|
@@ -13,7 +13,10 @@ const testConfigSchema = z.object({
|
|
|
13
13
|
NAMESPACE: z.string().default('scenario'),
|
|
14
14
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
15
15
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
16
|
-
L1_RPC_URLS_JSON: z.string().optional()
|
|
16
|
+
L1_RPC_URLS_JSON: z.string().optional(),
|
|
17
|
+
L1_ACCOUNT_MNEMONIC: z.string().optional(),
|
|
18
|
+
AZTEC_SLOT_DURATION: z.coerce.number().optional().default(24),
|
|
19
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5)
|
|
17
20
|
});
|
|
18
21
|
export function setupEnvironment(env) {
|
|
19
22
|
const config = testConfigSchema.parse(env);
|
|
@@ -175,8 +178,12 @@ export async function waitForResourceByLabel({ resource, label, namespace, condi
|
|
|
175
178
|
export function getChartDir(spartanDir, chartName) {
|
|
176
179
|
return path.join(spartanDir.trim(), chartName);
|
|
177
180
|
}
|
|
181
|
+
function shellQuote(value) {
|
|
182
|
+
// Single-quote safe shell escaping: ' -> '\''
|
|
183
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
184
|
+
}
|
|
178
185
|
function valuesToArgs(values) {
|
|
179
|
-
return Object.entries(values).map(([key, value])
|
|
186
|
+
return Object.entries(values).map(([key, value])=>typeof value === 'number' || typeof value === 'boolean' ? `--set ${key}=${value}` : `--set-string ${key}=${shellQuote(String(value))}`).join(' ');
|
|
180
187
|
}
|
|
181
188
|
function createHelmCommand({ instanceName, helmChartDir, namespace, valuesFile, timeout, values, reuseValues = false }) {
|
|
182
189
|
const valuesFileArgs = valuesFile ? `--values ${helmChartDir}/values/${valuesFile}` : '';
|
|
@@ -205,26 +212,30 @@ async function execHelmCommand(args) {
|
|
|
205
212
|
* const stdout = await installChaosMeshChart({ instanceName: 'force-reorg', targetNamespace: 'smoke', valuesFile: 'prover-failure.yaml'});
|
|
206
213
|
* console.log(stdout);
|
|
207
214
|
* ```
|
|
208
|
-
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '
|
|
215
|
+
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '10m', clean = true, values = {}, logger }) {
|
|
209
216
|
if (clean) {
|
|
210
217
|
// uninstall the helm chart if it exists
|
|
211
218
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
212
219
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
213
|
-
// and delete the
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
// and delete the chaos-mesh resources created by this release
|
|
221
|
+
const deleteByLabel = async (resource)=>{
|
|
222
|
+
const args = {
|
|
223
|
+
resource,
|
|
224
|
+
namespace: chaosMeshNamespace,
|
|
225
|
+
label: `app.kubernetes.io/instance=${instanceName}`
|
|
226
|
+
};
|
|
227
|
+
logger.info(`Deleting ${resource} resources for release ${instanceName}`);
|
|
228
|
+
await deleteResourceByLabel(args).catch((e)=>{
|
|
229
|
+
logger.error(`Error deleting ${resource}: ${e}`);
|
|
230
|
+
logger.info(`Force deleting ${resource}`);
|
|
231
|
+
return deleteResourceByLabel({
|
|
232
|
+
...args,
|
|
233
|
+
force: true
|
|
234
|
+
});
|
|
226
235
|
});
|
|
227
|
-
}
|
|
236
|
+
};
|
|
237
|
+
await deleteByLabel('podchaos');
|
|
238
|
+
await deleteByLabel('networkchaos');
|
|
228
239
|
}
|
|
229
240
|
return execHelmCommand({
|
|
230
241
|
instanceName,
|
|
@@ -321,16 +332,115 @@ export async function restartBot(namespace, logger) {
|
|
|
321
332
|
await deleteResourceByLabel({
|
|
322
333
|
resource: 'pods',
|
|
323
334
|
namespace,
|
|
324
|
-
label: 'app=bot'
|
|
335
|
+
label: 'app.kubernetes.io/name=bot'
|
|
325
336
|
});
|
|
326
337
|
await sleep(10 * 1000);
|
|
338
|
+
// Some bot images may take time to report Ready due to heavy boot-time proving.
|
|
339
|
+
// Waiting for PodReadyToStartContainers ensures the pod is scheduled and starting without blocking on full readiness.
|
|
327
340
|
await waitForResourceByLabel({
|
|
328
341
|
resource: 'pods',
|
|
329
342
|
namespace,
|
|
330
|
-
label: 'app=bot'
|
|
343
|
+
label: 'app.kubernetes.io/name=bot',
|
|
344
|
+
condition: 'PodReadyToStartContainers'
|
|
331
345
|
});
|
|
332
346
|
logger.info(`Bot restarted`);
|
|
333
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
350
|
+
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
351
|
+
*/ 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) }) {
|
|
352
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
353
|
+
const helmChartDir = getChartDir(spartanDir, 'aztec-bot');
|
|
354
|
+
const resolvedNodeUrl = nodeUrl ?? `http://${namespace}-rpc-aztec-node.${namespace}.svc.cluster.local:8080`;
|
|
355
|
+
logger.info(`Installing/upgrading transfer bot: replicas=${replicas}, followChain=${followChain}`);
|
|
356
|
+
const values = {
|
|
357
|
+
'bot.replicaCount': replicas,
|
|
358
|
+
'bot.txIntervalSeconds': txIntervalSeconds,
|
|
359
|
+
'bot.followChain': followChain,
|
|
360
|
+
'bot.botPrivateKey': botPrivateKey,
|
|
361
|
+
'bot.nodeUrl': resolvedNodeUrl,
|
|
362
|
+
'bot.mnemonic': mnemonic,
|
|
363
|
+
'bot.feePaymentMethod': 'fee_juice',
|
|
364
|
+
'aztec.slotDuration': aztecSlotDuration,
|
|
365
|
+
// Ensure bot can reach its own PXE started in-process (default rpc.port is 8080)
|
|
366
|
+
// Note: since aztec-bot depends on aztec-node with alias `bot`, env vars go under `bot.node.env`.
|
|
367
|
+
'bot.node.env.BOT_PXE_URL': 'http://127.0.0.1:8080',
|
|
368
|
+
// Provide L1 execution RPC for bridging fee juice
|
|
369
|
+
'bot.node.env.ETHEREUM_HOSTS': `http://${namespace}-eth-execution.${namespace}.svc.cluster.local:8545`,
|
|
370
|
+
// Provide L1 mnemonic for bridging (falls back to labs mnemonic)
|
|
371
|
+
'bot.node.env.BOT_L1_MNEMONIC': mnemonic
|
|
372
|
+
};
|
|
373
|
+
// Ensure we derive a funded L1 key (index 0 is funded on anvil default mnemonic)
|
|
374
|
+
if (mnemonicStartIndex === undefined) {
|
|
375
|
+
values['bot.mnemonicStartIndex'] = 0;
|
|
376
|
+
}
|
|
377
|
+
// Also pass a funded private key directly if available
|
|
378
|
+
if (process.env.FUNDING_PRIVATE_KEY) {
|
|
379
|
+
values['bot.node.env.BOT_L1_PRIVATE_KEY'] = process.env.FUNDING_PRIVATE_KEY;
|
|
380
|
+
}
|
|
381
|
+
// Align bot image with the running network image: prefer env var, else detect from a validator pod
|
|
382
|
+
let repositoryFromEnv;
|
|
383
|
+
let tagFromEnv;
|
|
384
|
+
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
385
|
+
if (aztecDockerImage && aztecDockerImage.includes(':')) {
|
|
386
|
+
const lastColon = aztecDockerImage.lastIndexOf(':');
|
|
387
|
+
repositoryFromEnv = aztecDockerImage.slice(0, lastColon);
|
|
388
|
+
tagFromEnv = aztecDockerImage.slice(lastColon + 1);
|
|
389
|
+
}
|
|
390
|
+
let repository = repositoryFromEnv;
|
|
391
|
+
let tag = tagFromEnv;
|
|
392
|
+
if (!repository || !tag) {
|
|
393
|
+
try {
|
|
394
|
+
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`);
|
|
395
|
+
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
396
|
+
if (image && image.includes(':')) {
|
|
397
|
+
const lastColon = image.lastIndexOf(':');
|
|
398
|
+
repository = image.slice(0, lastColon);
|
|
399
|
+
tag = image.slice(lastColon + 1);
|
|
400
|
+
}
|
|
401
|
+
} catch (err) {
|
|
402
|
+
logger.warn(`Could not detect aztec image from validator pod: ${String(err)}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (repository && tag) {
|
|
406
|
+
values['global.aztecImage.repository'] = repository;
|
|
407
|
+
values['global.aztecImage.tag'] = tag;
|
|
408
|
+
}
|
|
409
|
+
if (mnemonicStartIndex !== undefined) {
|
|
410
|
+
values['bot.mnemonicStartIndex'] = typeof mnemonicStartIndex === 'string' ? mnemonicStartIndex : Number(mnemonicStartIndex);
|
|
411
|
+
}
|
|
412
|
+
await execHelmCommand({
|
|
413
|
+
instanceName,
|
|
414
|
+
helmChartDir,
|
|
415
|
+
namespace,
|
|
416
|
+
valuesFile: undefined,
|
|
417
|
+
timeout,
|
|
418
|
+
values: values,
|
|
419
|
+
reuseValues
|
|
420
|
+
});
|
|
421
|
+
if (replicas > 0) {
|
|
422
|
+
await waitForResourceByLabel({
|
|
423
|
+
resource: 'pods',
|
|
424
|
+
namespace,
|
|
425
|
+
label: 'app.kubernetes.io/name=bot',
|
|
426
|
+
condition: 'PodReadyToStartContainers'
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
432
|
+
* Intended for test teardown to clean up bot resources.
|
|
433
|
+
*/ export async function uninstallTransferBot(namespace, logger) {
|
|
434
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
435
|
+
logger.info(`Uninstalling transfer bot release ${instanceName}`);
|
|
436
|
+
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
437
|
+
// Ensure any leftover pods are removed
|
|
438
|
+
await deleteResourceByLabel({
|
|
439
|
+
resource: 'pods',
|
|
440
|
+
namespace,
|
|
441
|
+
label: 'app.kubernetes.io/name=bot'
|
|
442
|
+
}).catch(()=>undefined);
|
|
443
|
+
}
|
|
334
444
|
export async function enableValidatorDynamicBootNode(instanceName, namespace, spartanDir, logger) {
|
|
335
445
|
logger.info(`Enabling validator dynamic boot node`);
|
|
336
446
|
await execHelmCommand({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251022",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20251022",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20251022",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20251022",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20251022",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251022",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251022",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251022",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251022",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20251022",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20251022",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20251022",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251022",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251022",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20251022",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20251022",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20251022",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251022",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251022",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20251022",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251022",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251022",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251022",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251022",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20251022",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251022",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20251022",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20251022",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20251022",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20251022",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20251022",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20251022",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20251022",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251022",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20251022",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20251022",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20251022",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"tslib": "^2.4.0",
|
|
98
98
|
"typescript": "^5.3.3",
|
|
99
99
|
"util": "^0.12.5",
|
|
100
|
-
"viem": "2.
|
|
100
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
|
|
101
101
|
"zod": "^3.23.8"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
package/src/spartan/DEVELOP.md
CHANGED
|
@@ -60,6 +60,11 @@ The export is important there. The `AZTEC_DOCKER_IMAGE` env var is used as both:
|
|
|
60
60
|
- the container that runs the rollup contract deployment
|
|
61
61
|
- the containers for the aztec infrastructure (validators, provers, etc)
|
|
62
62
|
|
|
63
|
+
# Deploy Metrics
|
|
64
|
+
```bash
|
|
65
|
+
./spartan/bootstrap.sh metrics-kind
|
|
66
|
+
```
|
|
67
|
+
|
|
63
68
|
# Deploy stuff
|
|
64
69
|
|
|
65
70
|
```bash
|
package/src/spartan/utils.ts
CHANGED
|
@@ -26,6 +26,9 @@ const testConfigSchema = z.object({
|
|
|
26
26
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
27
27
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
28
28
|
L1_RPC_URLS_JSON: z.string().optional(),
|
|
29
|
+
L1_ACCOUNT_MNEMONIC: z.string().optional(),
|
|
30
|
+
AZTEC_SLOT_DURATION: z.coerce.number().optional().default(24),
|
|
31
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5),
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
@@ -245,9 +248,18 @@ export function getChartDir(spartanDir: string, chartName: string) {
|
|
|
245
248
|
return path.join(spartanDir.trim(), chartName);
|
|
246
249
|
}
|
|
247
250
|
|
|
248
|
-
function
|
|
251
|
+
function shellQuote(value: string) {
|
|
252
|
+
// Single-quote safe shell escaping: ' -> '\''
|
|
253
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function valuesToArgs(values: Record<string, string | number | boolean>) {
|
|
249
257
|
return Object.entries(values)
|
|
250
|
-
.map(([key, value]) =>
|
|
258
|
+
.map(([key, value]) =>
|
|
259
|
+
typeof value === 'number' || typeof value === 'boolean'
|
|
260
|
+
? `--set ${key}=${value}`
|
|
261
|
+
: `--set-string ${key}=${shellQuote(String(value))}`,
|
|
262
|
+
)
|
|
251
263
|
.join(' ');
|
|
252
264
|
}
|
|
253
265
|
|
|
@@ -305,7 +317,7 @@ export async function installChaosMeshChart({
|
|
|
305
317
|
valuesFile,
|
|
306
318
|
helmChartDir,
|
|
307
319
|
chaosMeshNamespace = 'chaos-mesh',
|
|
308
|
-
timeout = '
|
|
320
|
+
timeout = '10m',
|
|
309
321
|
clean = true,
|
|
310
322
|
values = {},
|
|
311
323
|
logger,
|
|
@@ -324,18 +336,23 @@ export async function installChaosMeshChart({
|
|
|
324
336
|
// uninstall the helm chart if it exists
|
|
325
337
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
326
338
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
327
|
-
// and delete the
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
339
|
+
// and delete the chaos-mesh resources created by this release
|
|
340
|
+
const deleteByLabel = async (resource: string) => {
|
|
341
|
+
const args = {
|
|
342
|
+
resource,
|
|
343
|
+
namespace: chaosMeshNamespace,
|
|
344
|
+
label: `app.kubernetes.io/instance=${instanceName}`,
|
|
345
|
+
} as const;
|
|
346
|
+
logger.info(`Deleting ${resource} resources for release ${instanceName}`);
|
|
347
|
+
await deleteResourceByLabel(args).catch(e => {
|
|
348
|
+
logger.error(`Error deleting ${resource}: ${e}`);
|
|
349
|
+
logger.info(`Force deleting ${resource}`);
|
|
350
|
+
return deleteResourceByLabel({ ...args, force: true });
|
|
351
|
+
});
|
|
332
352
|
};
|
|
333
|
-
|
|
334
|
-
await
|
|
335
|
-
|
|
336
|
-
logger.info(`Force deleting podchaos resource`);
|
|
337
|
-
return deleteResourceByLabel({ ...deleteArgs, force: true });
|
|
338
|
-
});
|
|
353
|
+
|
|
354
|
+
await deleteByLabel('podchaos');
|
|
355
|
+
await deleteByLabel('networkchaos');
|
|
339
356
|
}
|
|
340
357
|
|
|
341
358
|
return execHelmCommand({
|
|
@@ -496,12 +513,153 @@ export async function awaitL2BlockNumber(
|
|
|
496
513
|
|
|
497
514
|
export async function restartBot(namespace: string, logger: Logger) {
|
|
498
515
|
logger.info(`Restarting bot`);
|
|
499
|
-
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app=bot' });
|
|
516
|
+
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app.kubernetes.io/name=bot' });
|
|
500
517
|
await sleep(10 * 1000);
|
|
501
|
-
|
|
518
|
+
// Some bot images may take time to report Ready due to heavy boot-time proving.
|
|
519
|
+
// Waiting for PodReadyToStartContainers ensures the pod is scheduled and starting without blocking on full readiness.
|
|
520
|
+
await waitForResourceByLabel({
|
|
521
|
+
resource: 'pods',
|
|
522
|
+
namespace,
|
|
523
|
+
label: 'app.kubernetes.io/name=bot',
|
|
524
|
+
condition: 'PodReadyToStartContainers',
|
|
525
|
+
});
|
|
502
526
|
logger.info(`Bot restarted`);
|
|
503
527
|
}
|
|
504
528
|
|
|
529
|
+
/**
|
|
530
|
+
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
531
|
+
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
532
|
+
*/
|
|
533
|
+
export async function installTransferBot({
|
|
534
|
+
namespace,
|
|
535
|
+
spartanDir,
|
|
536
|
+
logger,
|
|
537
|
+
replicas = 1,
|
|
538
|
+
txIntervalSeconds = 10,
|
|
539
|
+
followChain = 'PENDING',
|
|
540
|
+
mnemonic = process.env.LABS_INFRA_MNEMONIC ?? 'test test test test test test test test test test test junk',
|
|
541
|
+
mnemonicStartIndex,
|
|
542
|
+
botPrivateKey = process.env.BOT_TRANSFERS_L2_PRIVATE_KEY ?? '0xcafe01',
|
|
543
|
+
nodeUrl,
|
|
544
|
+
timeout = '15m',
|
|
545
|
+
reuseValues = true,
|
|
546
|
+
aztecSlotDuration = Number(process.env.AZTEC_SLOT_DURATION ?? 12),
|
|
547
|
+
}: {
|
|
548
|
+
namespace: string;
|
|
549
|
+
spartanDir: string;
|
|
550
|
+
logger: Logger;
|
|
551
|
+
replicas?: number;
|
|
552
|
+
txIntervalSeconds?: number;
|
|
553
|
+
followChain?: string;
|
|
554
|
+
mnemonic?: string;
|
|
555
|
+
mnemonicStartIndex?: number | string;
|
|
556
|
+
botPrivateKey?: string;
|
|
557
|
+
nodeUrl?: string;
|
|
558
|
+
timeout?: string;
|
|
559
|
+
reuseValues?: boolean;
|
|
560
|
+
aztecSlotDuration?: number;
|
|
561
|
+
}) {
|
|
562
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
563
|
+
const helmChartDir = getChartDir(spartanDir, 'aztec-bot');
|
|
564
|
+
const resolvedNodeUrl = nodeUrl ?? `http://${namespace}-rpc-aztec-node.${namespace}.svc.cluster.local:8080`;
|
|
565
|
+
|
|
566
|
+
logger.info(`Installing/upgrading transfer bot: replicas=${replicas}, followChain=${followChain}`);
|
|
567
|
+
|
|
568
|
+
const values: Record<string, string | number | boolean> = {
|
|
569
|
+
'bot.replicaCount': replicas,
|
|
570
|
+
'bot.txIntervalSeconds': txIntervalSeconds,
|
|
571
|
+
'bot.followChain': followChain,
|
|
572
|
+
'bot.botPrivateKey': botPrivateKey,
|
|
573
|
+
'bot.nodeUrl': resolvedNodeUrl,
|
|
574
|
+
'bot.mnemonic': mnemonic,
|
|
575
|
+
'bot.feePaymentMethod': 'fee_juice',
|
|
576
|
+
'aztec.slotDuration': aztecSlotDuration,
|
|
577
|
+
// Ensure bot can reach its own PXE started in-process (default rpc.port is 8080)
|
|
578
|
+
// Note: since aztec-bot depends on aztec-node with alias `bot`, env vars go under `bot.node.env`.
|
|
579
|
+
'bot.node.env.BOT_PXE_URL': 'http://127.0.0.1:8080',
|
|
580
|
+
// Provide L1 execution RPC for bridging fee juice
|
|
581
|
+
'bot.node.env.ETHEREUM_HOSTS': `http://${namespace}-eth-execution.${namespace}.svc.cluster.local:8545`,
|
|
582
|
+
// Provide L1 mnemonic for bridging (falls back to labs mnemonic)
|
|
583
|
+
'bot.node.env.BOT_L1_MNEMONIC': mnemonic,
|
|
584
|
+
};
|
|
585
|
+
// Ensure we derive a funded L1 key (index 0 is funded on anvil default mnemonic)
|
|
586
|
+
if (mnemonicStartIndex === undefined) {
|
|
587
|
+
values['bot.mnemonicStartIndex'] = 0;
|
|
588
|
+
}
|
|
589
|
+
// Also pass a funded private key directly if available
|
|
590
|
+
if (process.env.FUNDING_PRIVATE_KEY) {
|
|
591
|
+
values['bot.node.env.BOT_L1_PRIVATE_KEY'] = process.env.FUNDING_PRIVATE_KEY;
|
|
592
|
+
}
|
|
593
|
+
// Align bot image with the running network image: prefer env var, else detect from a validator pod
|
|
594
|
+
let repositoryFromEnv: string | undefined;
|
|
595
|
+
let tagFromEnv: string | undefined;
|
|
596
|
+
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
597
|
+
if (aztecDockerImage && aztecDockerImage.includes(':')) {
|
|
598
|
+
const lastColon = aztecDockerImage.lastIndexOf(':');
|
|
599
|
+
repositoryFromEnv = aztecDockerImage.slice(0, lastColon);
|
|
600
|
+
tagFromEnv = aztecDockerImage.slice(lastColon + 1);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
let repository = repositoryFromEnv;
|
|
604
|
+
let tag = tagFromEnv;
|
|
605
|
+
if (!repository || !tag) {
|
|
606
|
+
try {
|
|
607
|
+
const { stdout } = await execAsync(
|
|
608
|
+
`kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[0].spec.containers[?(@.name=="aztec")].image}' | cat`,
|
|
609
|
+
);
|
|
610
|
+
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
611
|
+
if (image && image.includes(':')) {
|
|
612
|
+
const lastColon = image.lastIndexOf(':');
|
|
613
|
+
repository = image.slice(0, lastColon);
|
|
614
|
+
tag = image.slice(lastColon + 1);
|
|
615
|
+
}
|
|
616
|
+
} catch (err) {
|
|
617
|
+
logger.warn(`Could not detect aztec image from validator pod: ${String(err)}`);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (repository && tag) {
|
|
621
|
+
values['global.aztecImage.repository'] = repository;
|
|
622
|
+
values['global.aztecImage.tag'] = tag;
|
|
623
|
+
}
|
|
624
|
+
if (mnemonicStartIndex !== undefined) {
|
|
625
|
+
values['bot.mnemonicStartIndex'] =
|
|
626
|
+
typeof mnemonicStartIndex === 'string' ? mnemonicStartIndex : Number(mnemonicStartIndex);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
await execHelmCommand({
|
|
630
|
+
instanceName,
|
|
631
|
+
helmChartDir,
|
|
632
|
+
namespace,
|
|
633
|
+
valuesFile: undefined,
|
|
634
|
+
timeout,
|
|
635
|
+
values: values as unknown as Record<string, string | number>,
|
|
636
|
+
reuseValues,
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
if (replicas > 0) {
|
|
640
|
+
await waitForResourceByLabel({
|
|
641
|
+
resource: 'pods',
|
|
642
|
+
namespace,
|
|
643
|
+
label: 'app.kubernetes.io/name=bot',
|
|
644
|
+
condition: 'PodReadyToStartContainers',
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
651
|
+
* Intended for test teardown to clean up bot resources.
|
|
652
|
+
*/
|
|
653
|
+
export async function uninstallTransferBot(namespace: string, logger: Logger) {
|
|
654
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
655
|
+
logger.info(`Uninstalling transfer bot release ${instanceName}`);
|
|
656
|
+
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
657
|
+
// Ensure any leftover pods are removed
|
|
658
|
+
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app.kubernetes.io/name=bot' }).catch(
|
|
659
|
+
() => undefined,
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
|
|
505
663
|
export async function enableValidatorDynamicBootNode(
|
|
506
664
|
instanceName: string,
|
|
507
665
|
namespace: string,
|