@aztec/end-to-end 3.0.0-nightly.20250905 → 4.0.0-nightly.20250907
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/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -3
- package/dest/spartan/utils.d.ts +24 -3
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +101 -30
- package/package.json +36 -36
- package/src/fixtures/utils.ts +1 -3
- package/src/spartan/utils.ts +105 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAOZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,QAAQ,EAOd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,aAAa,EAGb,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,O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E,CAAC,SAAS,MAAM,GAAG,MAAM,EACnE,aAAa,EAAE,CAAC,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,CAAC,EAAE,EACX,aAAa,EAAE,CAAC,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAM9E;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,0BAG3C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,wCAQ/C;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,SAAK,EAAE,WAAW,SAAI,iBAS/G;AAED,wBAAgB,uBAAuB,CACrC,oBAAoB,EAAE,KAAK,MAAM,EAAE,EACnC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,EACpF,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,cAAc,GAAE,cAAmB,uBAoDpC"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -182,9 +182,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
182
182
|
* @param numberOfAccounts - The number of new accounts to be created once the PXE is initiated.
|
|
183
183
|
* @param opts - Options to pass to the node initialization and to the setup script.
|
|
184
184
|
* @param pxeOpts - Options to pass to the PXE initialization.
|
|
185
|
-
*/ export async function setup(numberOfAccounts = 1, opts = {
|
|
186
|
-
customForwarderContractAddress: EthAddress.ZERO
|
|
187
|
-
}, pxeOpts = {}, chain = foundry) {
|
|
185
|
+
*/ export async function setup(numberOfAccounts = 1, opts = {}, pxeOpts = {}, chain = foundry) {
|
|
188
186
|
let anvil;
|
|
189
187
|
try {
|
|
190
188
|
opts.aztecTargetCommitteeSize ??= 0;
|
package/dest/spartan/utils.d.ts
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
2
|
+
import type { L1ContractAddresses, ViemPublicClient } from '@aztec/ethereum';
|
|
2
3
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
|
-
import { type AztecNodeAdminConfig } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import { type AztecNodeAdmin, type AztecNodeAdminConfig } from '@aztec/stdlib/interfaces/client';
|
|
4
5
|
import { ChildProcess } from 'child_process';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
declare const testConfigSchema: z.ZodObject<{
|
|
7
8
|
NAMESPACE: z.ZodDefault<z.ZodString>;
|
|
8
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>;
|
|
9
12
|
}, "strip", z.ZodTypeAny, {
|
|
10
13
|
NAMESPACE: string;
|
|
11
14
|
REAL_VERIFIER: boolean;
|
|
15
|
+
CREATE_ETH_DEVNET: boolean;
|
|
16
|
+
L1_RPC_URLS_JSON?: string | undefined;
|
|
12
17
|
}, {
|
|
13
18
|
NAMESPACE?: string | undefined;
|
|
14
19
|
REAL_VERIFIER?: string | number | boolean | undefined;
|
|
20
|
+
CREATE_ETH_DEVNET?: string | number | boolean | undefined;
|
|
21
|
+
L1_RPC_URLS_JSON?: string | undefined;
|
|
15
22
|
}>;
|
|
16
23
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
17
24
|
export declare function setupEnvironment(env: unknown): TestConfig;
|
|
@@ -128,9 +135,23 @@ export declare function applyNetworkShaping({ valuesFile, namespace, spartanDir,
|
|
|
128
135
|
export declare function awaitL2BlockNumber(rollupCheatCodes: RollupCheatCodes, blockNumber: bigint, timeoutSeconds: number, logger: Logger): Promise<void>;
|
|
129
136
|
export declare function restartBot(namespace: string, logger: Logger): Promise<void>;
|
|
130
137
|
export declare function enableValidatorDynamicBootNode(instanceName: string, namespace: string, spartanDir: string, logger: Logger): Promise<void>;
|
|
131
|
-
export declare function updateSequencerConfig(url: string, config: Partial<AztecNodeAdminConfig>): Promise<void>;
|
|
132
138
|
export declare function getSequencers(namespace: string): Promise<string[]>;
|
|
133
|
-
export declare function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>): Promise<
|
|
139
|
+
export declare function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>): Promise<AztecNodeAdminConfig[]>;
|
|
140
|
+
export declare function getSequencersConfig(env: TestConfig): Promise<AztecNodeAdminConfig[]>;
|
|
141
|
+
export declare function withSequencersAdmin<T>(env: TestConfig, fn: (node: AztecNodeAdmin) => Promise<T>): Promise<T[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Returns a public viem client to the eth execution node. If it was part of a local eth devnet,
|
|
144
|
+
* it first port-forwards the service and points to it. Otherwise, just uses the external RPC url.
|
|
145
|
+
*/
|
|
146
|
+
export declare function getPublicViemClient(env: TestConfig,
|
|
147
|
+
/** If set, will push the new process into it */
|
|
148
|
+
processes?: ChildProcess[]): Promise<{
|
|
149
|
+
url: string;
|
|
150
|
+
client: ViemPublicClient;
|
|
151
|
+
process?: ChildProcess;
|
|
152
|
+
}>;
|
|
153
|
+
/** Queries an Aztec node for the L1 deployment addresses */
|
|
154
|
+
export declare function getL1DeploymentAddresses(env: TestConfig): Promise<L1ContractAddresses>;
|
|
134
155
|
/**
|
|
135
156
|
* Rolls the Aztec pods in the given namespace.
|
|
136
157
|
* @param namespace - The namespace to roll the Aztec pods in.
|
|
@@ -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,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,
|
|
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,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;EAKpB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAIzD;AAyBD,wBAAgB,WAAW,WAE1B;AAED;;;;;;GAMG;AACH,wBAAg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M,EAClB,MAAM,EAAE,MAAM,iBAgBf;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,qBAMpD;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,mCAK5F;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,mCAElD;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CA2BpH;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,UAAU;AACf,gDAAgD;AAChD,SAAS,CAAC,EAAE,YAAY,EAAE,GACzB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CAuB5E;AAED,4DAA4D;AAC5D,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsB5F;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
|
package/dest/spartan/utils.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
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 { createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import { createAztecNodeAdminClient, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import { exec, execSync, spawn } from 'child_process';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { promisify } from 'util';
|
|
8
|
+
import { createPublicClient, fallback, http } from 'viem';
|
|
8
9
|
import { z } from 'zod';
|
|
9
10
|
const execAsync = promisify(exec);
|
|
10
11
|
const logger = createLogger('e2e:k8s-utils');
|
|
11
12
|
const testConfigSchema = z.object({
|
|
12
13
|
NAMESPACE: z.string().default('scenario'),
|
|
13
|
-
REAL_VERIFIER: schemas.Boolean.optional().default(true)
|
|
14
|
+
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
15
|
+
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
16
|
+
L1_RPC_URLS_JSON: z.string().optional()
|
|
14
17
|
});
|
|
15
18
|
export function setupEnvironment(env) {
|
|
16
19
|
const config = testConfigSchema.parse(env);
|
|
@@ -66,7 +69,7 @@ export function runProjectScript(script, args, logger, env) {
|
|
|
66
69
|
}
|
|
67
70
|
export async function startPortForward({ resource, namespace, containerPort, hostPort }) {
|
|
68
71
|
const hostPortAsString = hostPort ? hostPort.toString() : '';
|
|
69
|
-
logger.
|
|
72
|
+
logger.debug(`kubectl port-forward -n ${namespace} ${resource} ${hostPortAsString}:${containerPort}`);
|
|
70
73
|
const process1 = spawn('kubectl', [
|
|
71
74
|
'port-forward',
|
|
72
75
|
'-n',
|
|
@@ -88,20 +91,20 @@ export async function startPortForward({ resource, namespace, containerPort, hos
|
|
|
88
91
|
const str = data.toString();
|
|
89
92
|
if (!isResolved && str.includes('Forwarding from')) {
|
|
90
93
|
isResolved = true;
|
|
91
|
-
logger.
|
|
94
|
+
logger.debug(`Port forward for ${resource}: ${str}`);
|
|
92
95
|
const port = str.search(/:\d+/);
|
|
93
96
|
if (port === -1) {
|
|
94
97
|
throw new Error('Port not found in port forward output');
|
|
95
98
|
}
|
|
96
99
|
const portNumber = parseInt(str.slice(port + 1));
|
|
97
|
-
logger.
|
|
100
|
+
logger.verbose(`Port forwarded for ${resource} at ${portNumber}:${containerPort}`);
|
|
98
101
|
resolve(portNumber);
|
|
99
102
|
} else {
|
|
100
103
|
logger.silent(str);
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
106
|
process1.stderr?.on('data', (data)=>{
|
|
104
|
-
logger.
|
|
107
|
+
logger.verbose(`Port forward for ${resource}: ${data.toString()}`);
|
|
105
108
|
// It's a strange thing:
|
|
106
109
|
// If we don't pipe stderr, then the port forwarding does not work.
|
|
107
110
|
// Log to silent because this doesn't actually report errors,
|
|
@@ -111,16 +114,16 @@ export async function startPortForward({ resource, namespace, containerPort, hos
|
|
|
111
114
|
process1.on('close', ()=>{
|
|
112
115
|
if (!isResolved) {
|
|
113
116
|
isResolved = true;
|
|
114
|
-
logger.warn(
|
|
117
|
+
logger.warn(`Port forward for ${resource} closed before connection established`);
|
|
115
118
|
resolve(0);
|
|
116
119
|
}
|
|
117
120
|
});
|
|
118
121
|
process1.on('error', (error)=>{
|
|
119
|
-
logger.error(`Port forward error: ${error}`);
|
|
122
|
+
logger.error(`Port forward for ${resource} error: ${error}`);
|
|
120
123
|
resolve(0);
|
|
121
124
|
});
|
|
122
125
|
process1.on('exit', (code)=>{
|
|
123
|
-
logger.
|
|
126
|
+
logger.verbose(`Port forward for ${resource} exited with code ${code}`);
|
|
124
127
|
resolve(0);
|
|
125
128
|
});
|
|
126
129
|
});
|
|
@@ -336,40 +339,108 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
|
|
|
336
339
|
});
|
|
337
340
|
logger.info(`Validator dynamic boot node enabled`);
|
|
338
341
|
}
|
|
339
|
-
export async function updateSequencerConfig(url, config) {
|
|
340
|
-
const node = createAztecNodeAdminClient(url);
|
|
341
|
-
// Retry incase the port forward is not ready yet
|
|
342
|
-
await retry(()=>node.setConfig(config), 'Update sequencer config', makeBackoff([
|
|
343
|
-
1,
|
|
344
|
-
3,
|
|
345
|
-
6
|
|
346
|
-
]), logger);
|
|
347
|
-
}
|
|
348
342
|
export async function getSequencers(namespace) {
|
|
349
|
-
const command = `kubectl get pods -l app=validator -n ${namespace} -o jsonpath='{.items[*].metadata.name}'`;
|
|
343
|
+
const command = `kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[*].metadata.name}'`;
|
|
350
344
|
const { stdout } = await execAsync(command);
|
|
351
|
-
|
|
345
|
+
const sequencers = stdout.split(' ');
|
|
346
|
+
logger.verbose(`Found sequencer pods ${sequencers.join(', ')}`);
|
|
347
|
+
return sequencers;
|
|
348
|
+
}
|
|
349
|
+
export function updateSequencersConfig(env, config) {
|
|
350
|
+
return withSequencersAdmin(env, async (client)=>{
|
|
351
|
+
await client.setConfig(config);
|
|
352
|
+
return client.getConfig();
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
export function getSequencersConfig(env) {
|
|
356
|
+
return withSequencersAdmin(env, (client)=>client.getConfig());
|
|
352
357
|
}
|
|
353
|
-
async function
|
|
354
|
-
const
|
|
358
|
+
export async function withSequencersAdmin(env, fn) {
|
|
359
|
+
const adminContainerPort = 8880;
|
|
360
|
+
const namespace = env.NAMESPACE;
|
|
355
361
|
const sequencers = await getSequencers(namespace);
|
|
362
|
+
const results = [];
|
|
356
363
|
for (const sequencer of sequencers){
|
|
357
364
|
const { process: process1, port } = await startPortForward({
|
|
358
365
|
resource: `pod/${sequencer}`,
|
|
359
366
|
namespace,
|
|
360
|
-
containerPort
|
|
367
|
+
containerPort: adminContainerPort
|
|
361
368
|
});
|
|
362
369
|
const url = `http://localhost:${port}`;
|
|
363
|
-
await
|
|
370
|
+
await retry(()=>fetch(`${url}/status`).then((res)=>res.status === 200), 'forward node admin port', makeBackoff([
|
|
371
|
+
1,
|
|
372
|
+
1,
|
|
373
|
+
2,
|
|
374
|
+
6
|
|
375
|
+
]), logger, true);
|
|
376
|
+
const client = createAztecNodeAdminClient(url);
|
|
377
|
+
results.push(await fn(client));
|
|
364
378
|
process1.kill();
|
|
365
379
|
}
|
|
380
|
+
return results;
|
|
366
381
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
382
|
+
/**
|
|
383
|
+
* Returns a public viem client to the eth execution node. If it was part of a local eth devnet,
|
|
384
|
+
* it first port-forwards the service and points to it. Otherwise, just uses the external RPC url.
|
|
385
|
+
*/ export async function getPublicViemClient(env, /** If set, will push the new process into it */ processes) {
|
|
386
|
+
const { NAMESPACE, CREATE_ETH_DEVNET, L1_RPC_URLS_JSON } = env;
|
|
387
|
+
if (CREATE_ETH_DEVNET) {
|
|
388
|
+
logger.info(`Creating port forward to eth execution node`);
|
|
389
|
+
const { process: process1, port } = await startPortForward({
|
|
390
|
+
resource: `svc/${NAMESPACE}-eth-execution`,
|
|
391
|
+
namespace: NAMESPACE,
|
|
392
|
+
containerPort: 8545
|
|
393
|
+
});
|
|
394
|
+
const url = `http://127.0.0.1:${port}`;
|
|
395
|
+
const client = createPublicClient({
|
|
396
|
+
transport: fallback([
|
|
397
|
+
http(url)
|
|
398
|
+
])
|
|
399
|
+
});
|
|
400
|
+
if (processes) {
|
|
401
|
+
processes.push(process1);
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
url,
|
|
405
|
+
client,
|
|
406
|
+
process: process1
|
|
407
|
+
};
|
|
408
|
+
} else {
|
|
409
|
+
logger.info(`Connecting to the eth execution node at ${L1_RPC_URLS_JSON}`);
|
|
410
|
+
if (!L1_RPC_URLS_JSON) {
|
|
411
|
+
throw new Error(`L1_RPC_URLS_JSON is not defined`);
|
|
412
|
+
}
|
|
413
|
+
const client = createPublicClient({
|
|
414
|
+
transport: fallback([
|
|
415
|
+
http(L1_RPC_URLS_JSON)
|
|
416
|
+
])
|
|
417
|
+
});
|
|
418
|
+
return {
|
|
419
|
+
url: L1_RPC_URLS_JSON,
|
|
420
|
+
client
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
/** Queries an Aztec node for the L1 deployment addresses */ export async function getL1DeploymentAddresses(env) {
|
|
425
|
+
let forwardProcess;
|
|
426
|
+
try {
|
|
427
|
+
const [sequencer] = await getSequencers(env.NAMESPACE);
|
|
428
|
+
const { process: process1, port } = await startPortForward({
|
|
429
|
+
resource: `pod/${sequencer}`,
|
|
430
|
+
namespace: env.NAMESPACE,
|
|
431
|
+
containerPort: 8080
|
|
432
|
+
});
|
|
433
|
+
forwardProcess = process1;
|
|
434
|
+
const url = `http://127.0.0.1:${port}`;
|
|
435
|
+
const node = createAztecNodeClient(url);
|
|
436
|
+
return await retry(()=>node.getNodeInfo().then((i)=>i.l1ContractAddresses), 'get node info', makeBackoff([
|
|
437
|
+
1,
|
|
438
|
+
3,
|
|
439
|
+
6
|
|
440
|
+
]), logger);
|
|
441
|
+
} finally{
|
|
442
|
+
forwardProcess?.kill();
|
|
443
|
+
}
|
|
373
444
|
}
|
|
374
445
|
/**
|
|
375
446
|
* Rolls the Aztec pods in the given namespace.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-nightly.20250907",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,41 +25,41 @@
|
|
|
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/validator-client": "
|
|
62
|
-
"@aztec/world-state": "
|
|
28
|
+
"@aztec/accounts": "4.0.0-nightly.20250907",
|
|
29
|
+
"@aztec/archiver": "4.0.0-nightly.20250907",
|
|
30
|
+
"@aztec/aztec": "4.0.0-nightly.20250907",
|
|
31
|
+
"@aztec/aztec-node": "4.0.0-nightly.20250907",
|
|
32
|
+
"@aztec/aztec.js": "4.0.0-nightly.20250907",
|
|
33
|
+
"@aztec/bb-prover": "4.0.0-nightly.20250907",
|
|
34
|
+
"@aztec/blob-lib": "4.0.0-nightly.20250907",
|
|
35
|
+
"@aztec/blob-sink": "4.0.0-nightly.20250907",
|
|
36
|
+
"@aztec/bot": "4.0.0-nightly.20250907",
|
|
37
|
+
"@aztec/cli": "4.0.0-nightly.20250907",
|
|
38
|
+
"@aztec/constants": "4.0.0-nightly.20250907",
|
|
39
|
+
"@aztec/entrypoints": "4.0.0-nightly.20250907",
|
|
40
|
+
"@aztec/epoch-cache": "4.0.0-nightly.20250907",
|
|
41
|
+
"@aztec/ethereum": "4.0.0-nightly.20250907",
|
|
42
|
+
"@aztec/foundation": "4.0.0-nightly.20250907",
|
|
43
|
+
"@aztec/kv-store": "4.0.0-nightly.20250907",
|
|
44
|
+
"@aztec/l1-artifacts": "4.0.0-nightly.20250907",
|
|
45
|
+
"@aztec/merkle-tree": "4.0.0-nightly.20250907",
|
|
46
|
+
"@aztec/node-keystore": "4.0.0-nightly.20250907",
|
|
47
|
+
"@aztec/noir-contracts.js": "4.0.0-nightly.20250907",
|
|
48
|
+
"@aztec/noir-noirc_abi": "4.0.0-nightly.20250907",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "4.0.0-nightly.20250907",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "4.0.0-nightly.20250907",
|
|
51
|
+
"@aztec/p2p": "4.0.0-nightly.20250907",
|
|
52
|
+
"@aztec/protocol-contracts": "4.0.0-nightly.20250907",
|
|
53
|
+
"@aztec/prover-client": "4.0.0-nightly.20250907",
|
|
54
|
+
"@aztec/prover-node": "4.0.0-nightly.20250907",
|
|
55
|
+
"@aztec/pxe": "4.0.0-nightly.20250907",
|
|
56
|
+
"@aztec/sequencer-client": "4.0.0-nightly.20250907",
|
|
57
|
+
"@aztec/simulator": "4.0.0-nightly.20250907",
|
|
58
|
+
"@aztec/slasher": "4.0.0-nightly.20250907",
|
|
59
|
+
"@aztec/stdlib": "4.0.0-nightly.20250907",
|
|
60
|
+
"@aztec/telemetry-client": "4.0.0-nightly.20250907",
|
|
61
|
+
"@aztec/validator-client": "4.0.0-nightly.20250907",
|
|
62
|
+
"@aztec/world-state": "4.0.0-nightly.20250907",
|
|
63
63
|
"@iarna/toml": "^2.2.5",
|
|
64
64
|
"@jest/globals": "^30.0.0",
|
|
65
65
|
"@noble/curves": "=1.0.0",
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -382,9 +382,7 @@ export type EndToEndContext = {
|
|
|
382
382
|
*/
|
|
383
383
|
export async function setup(
|
|
384
384
|
numberOfAccounts = 1,
|
|
385
|
-
opts: SetupOptions = {
|
|
386
|
-
customForwarderContractAddress: EthAddress.ZERO,
|
|
387
|
-
},
|
|
385
|
+
opts: SetupOptions = {},
|
|
388
386
|
pxeOpts: Partial<PXEServiceConfig> = {},
|
|
389
387
|
chain: Chain = foundry,
|
|
390
388
|
): Promise<EndToEndContext> {
|
package/src/spartan/utils.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
2
2
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
3
|
+
import type { L1ContractAddresses, ViemPublicClient } from '@aztec/ethereum';
|
|
3
4
|
import type { Logger } from '@aztec/foundation/log';
|
|
4
5
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
5
6
|
import { schemas } from '@aztec/foundation/schemas';
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
type AztecNodeAdmin,
|
|
9
|
+
type AztecNodeAdminConfig,
|
|
10
|
+
createAztecNodeAdminClient,
|
|
11
|
+
createAztecNodeClient,
|
|
12
|
+
} from '@aztec/stdlib/interfaces/client';
|
|
7
13
|
|
|
8
14
|
import { ChildProcess, exec, execSync, spawn } from 'child_process';
|
|
9
15
|
import path from 'path';
|
|
10
16
|
import { promisify } from 'util';
|
|
17
|
+
import { createPublicClient, fallback, http } from 'viem';
|
|
11
18
|
import { z } from 'zod';
|
|
12
19
|
|
|
13
20
|
const execAsync = promisify(exec);
|
|
@@ -17,6 +24,8 @@ const logger = createLogger('e2e:k8s-utils');
|
|
|
17
24
|
const testConfigSchema = z.object({
|
|
18
25
|
NAMESPACE: z.string().default('scenario'),
|
|
19
26
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
27
|
+
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
28
|
+
L1_RPC_URLS_JSON: z.string().optional(),
|
|
20
29
|
});
|
|
21
30
|
|
|
22
31
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
@@ -87,7 +96,7 @@ export async function startPortForward({
|
|
|
87
96
|
}> {
|
|
88
97
|
const hostPortAsString = hostPort ? hostPort.toString() : '';
|
|
89
98
|
|
|
90
|
-
logger.
|
|
99
|
+
logger.debug(`kubectl port-forward -n ${namespace} ${resource} ${hostPortAsString}:${containerPort}`);
|
|
91
100
|
|
|
92
101
|
const process = spawn(
|
|
93
102
|
'kubectl',
|
|
@@ -105,20 +114,20 @@ export async function startPortForward({
|
|
|
105
114
|
const str = data.toString() as string;
|
|
106
115
|
if (!isResolved && str.includes('Forwarding from')) {
|
|
107
116
|
isResolved = true;
|
|
108
|
-
logger.
|
|
117
|
+
logger.debug(`Port forward for ${resource}: ${str}`);
|
|
109
118
|
const port = str.search(/:\d+/);
|
|
110
119
|
if (port === -1) {
|
|
111
120
|
throw new Error('Port not found in port forward output');
|
|
112
121
|
}
|
|
113
122
|
const portNumber = parseInt(str.slice(port + 1));
|
|
114
|
-
logger.
|
|
123
|
+
logger.verbose(`Port forwarded for ${resource} at ${portNumber}:${containerPort}`);
|
|
115
124
|
resolve(portNumber);
|
|
116
125
|
} else {
|
|
117
126
|
logger.silent(str);
|
|
118
127
|
}
|
|
119
128
|
});
|
|
120
129
|
process.stderr?.on('data', data => {
|
|
121
|
-
logger.
|
|
130
|
+
logger.verbose(`Port forward for ${resource}: ${data.toString()}`);
|
|
122
131
|
// It's a strange thing:
|
|
123
132
|
// If we don't pipe stderr, then the port forwarding does not work.
|
|
124
133
|
// Log to silent because this doesn't actually report errors,
|
|
@@ -128,16 +137,16 @@ export async function startPortForward({
|
|
|
128
137
|
process.on('close', () => {
|
|
129
138
|
if (!isResolved) {
|
|
130
139
|
isResolved = true;
|
|
131
|
-
logger.warn(
|
|
140
|
+
logger.warn(`Port forward for ${resource} closed before connection established`);
|
|
132
141
|
resolve(0);
|
|
133
142
|
}
|
|
134
143
|
});
|
|
135
144
|
process.on('error', error => {
|
|
136
|
-
logger.error(`Port forward error: ${error}`);
|
|
145
|
+
logger.error(`Port forward for ${resource} error: ${error}`);
|
|
137
146
|
resolve(0);
|
|
138
147
|
});
|
|
139
148
|
process.on('exit', code => {
|
|
140
|
-
logger.
|
|
149
|
+
logger.verbose(`Port forward for ${resource} exited with code ${code}`);
|
|
141
150
|
resolve(0);
|
|
142
151
|
});
|
|
143
152
|
});
|
|
@@ -505,44 +514,110 @@ export async function enableValidatorDynamicBootNode(
|
|
|
505
514
|
logger.info(`Validator dynamic boot node enabled`);
|
|
506
515
|
}
|
|
507
516
|
|
|
508
|
-
export async function updateSequencerConfig(url: string, config: Partial<AztecNodeAdminConfig>) {
|
|
509
|
-
const node = createAztecNodeAdminClient(url);
|
|
510
|
-
// Retry incase the port forward is not ready yet
|
|
511
|
-
await retry(() => node.setConfig(config), 'Update sequencer config', makeBackoff([1, 3, 6]), logger);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
517
|
export async function getSequencers(namespace: string) {
|
|
515
|
-
const command = `kubectl get pods -l app=validator -n ${namespace} -o jsonpath='{.items[*].metadata.name}'`;
|
|
518
|
+
const command = `kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[*].metadata.name}'`;
|
|
516
519
|
const { stdout } = await execAsync(command);
|
|
517
|
-
|
|
520
|
+
const sequencers = stdout.split(' ');
|
|
521
|
+
logger.verbose(`Found sequencer pods ${sequencers.join(', ')}`);
|
|
522
|
+
return sequencers;
|
|
518
523
|
}
|
|
519
524
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
})
|
|
525
|
-
|
|
525
|
+
export function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>) {
|
|
526
|
+
return withSequencersAdmin(env, async client => {
|
|
527
|
+
await client.setConfig(config);
|
|
528
|
+
return client.getConfig();
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export function getSequencersConfig(env: TestConfig) {
|
|
533
|
+
return withSequencersAdmin(env, client => client.getConfig());
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export async function withSequencersAdmin<T>(env: TestConfig, fn: (node: AztecNodeAdmin) => Promise<T>): Promise<T[]> {
|
|
537
|
+
const adminContainerPort = 8880;
|
|
538
|
+
const namespace = env.NAMESPACE;
|
|
526
539
|
const sequencers = await getSequencers(namespace);
|
|
540
|
+
const results = [];
|
|
541
|
+
|
|
527
542
|
for (const sequencer of sequencers) {
|
|
528
543
|
const { process, port } = await startPortForward({
|
|
529
544
|
resource: `pod/${sequencer}`,
|
|
530
545
|
namespace,
|
|
531
|
-
containerPort,
|
|
546
|
+
containerPort: adminContainerPort,
|
|
532
547
|
});
|
|
533
548
|
|
|
534
549
|
const url = `http://localhost:${port}`;
|
|
535
|
-
await
|
|
550
|
+
await retry(
|
|
551
|
+
() => fetch(`${url}/status`).then(res => res.status === 200),
|
|
552
|
+
'forward node admin port',
|
|
553
|
+
makeBackoff([1, 1, 2, 6]),
|
|
554
|
+
logger,
|
|
555
|
+
true,
|
|
556
|
+
);
|
|
557
|
+
const client = createAztecNodeAdminClient(url);
|
|
558
|
+
results.push(await fn(client));
|
|
536
559
|
process.kill();
|
|
537
560
|
}
|
|
561
|
+
|
|
562
|
+
return results;
|
|
538
563
|
}
|
|
539
564
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
565
|
+
/**
|
|
566
|
+
* Returns a public viem client to the eth execution node. If it was part of a local eth devnet,
|
|
567
|
+
* it first port-forwards the service and points to it. Otherwise, just uses the external RPC url.
|
|
568
|
+
*/
|
|
569
|
+
export async function getPublicViemClient(
|
|
570
|
+
env: TestConfig,
|
|
571
|
+
/** If set, will push the new process into it */
|
|
572
|
+
processes?: ChildProcess[],
|
|
573
|
+
): Promise<{ url: string; client: ViemPublicClient; process?: ChildProcess }> {
|
|
574
|
+
const { NAMESPACE, CREATE_ETH_DEVNET, L1_RPC_URLS_JSON } = env;
|
|
575
|
+
if (CREATE_ETH_DEVNET) {
|
|
576
|
+
logger.info(`Creating port forward to eth execution node`);
|
|
577
|
+
const { process, port } = await startPortForward({
|
|
578
|
+
resource: `svc/${NAMESPACE}-eth-execution`,
|
|
579
|
+
namespace: NAMESPACE,
|
|
580
|
+
containerPort: 8545,
|
|
581
|
+
});
|
|
582
|
+
const url = `http://127.0.0.1:${port}`;
|
|
583
|
+
const client: ViemPublicClient = createPublicClient({ transport: fallback([http(url)]) });
|
|
584
|
+
if (processes) {
|
|
585
|
+
processes.push(process);
|
|
586
|
+
}
|
|
587
|
+
return { url, client, process };
|
|
588
|
+
} else {
|
|
589
|
+
logger.info(`Connecting to the eth execution node at ${L1_RPC_URLS_JSON}`);
|
|
590
|
+
if (!L1_RPC_URLS_JSON) {
|
|
591
|
+
throw new Error(`L1_RPC_URLS_JSON is not defined`);
|
|
592
|
+
}
|
|
593
|
+
const client: ViemPublicClient = createPublicClient({ transport: fallback([http(L1_RPC_URLS_JSON)]) });
|
|
594
|
+
return { url: L1_RPC_URLS_JSON, client };
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** Queries an Aztec node for the L1 deployment addresses */
|
|
599
|
+
export async function getL1DeploymentAddresses(env: TestConfig): Promise<L1ContractAddresses> {
|
|
600
|
+
let forwardProcess: ChildProcess | undefined;
|
|
601
|
+
try {
|
|
602
|
+
const [sequencer] = await getSequencers(env.NAMESPACE);
|
|
603
|
+
const { process, port } = await startPortForward({
|
|
604
|
+
resource: `pod/${sequencer}`,
|
|
605
|
+
namespace: env.NAMESPACE,
|
|
606
|
+
containerPort: 8080,
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
forwardProcess = process;
|
|
610
|
+
const url = `http://127.0.0.1:${port}`;
|
|
611
|
+
const node = createAztecNodeClient(url);
|
|
612
|
+
return await retry(
|
|
613
|
+
() => node.getNodeInfo().then(i => i.l1ContractAddresses),
|
|
614
|
+
'get node info',
|
|
615
|
+
makeBackoff([1, 3, 6]),
|
|
616
|
+
logger,
|
|
617
|
+
);
|
|
618
|
+
} finally {
|
|
619
|
+
forwardProcess?.kill();
|
|
620
|
+
}
|
|
546
621
|
}
|
|
547
622
|
|
|
548
623
|
/**
|