@aztec/end-to-end 0.0.1-commit.2ed92850 → 0.0.1-commit.3d8f95d
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/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
- 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 +3 -2
- package/dest/e2e_epochs/epochs_test.d.ts +7 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +37 -12
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -2
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +1 -7
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +153 -0
- package/dest/e2e_p2p/shared.d.ts +1 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +5 -2
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/fixtures/e2e_prover_test.js +1 -1
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +114 -0
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/setup.d.ts +15 -15
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +30 -90
- package/dest/fixtures/setup_p2p_test.d.ts +12 -8
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +29 -21
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +8 -6
- package/dest/spartan/tx_metrics.d.ts +35 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +150 -0
- package/dest/spartan/utils/config.d.ts +4 -1
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +2 -1
- package/dest/spartan/utils/index.d.ts +4 -4
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -2
- package/dest/spartan/utils/k8s.d.ts +29 -1
- package/dest/spartan/utils/k8s.d.ts.map +1 -1
- package/dest/spartan/utils/k8s.js +118 -0
- package/dest/spartan/utils/nodes.d.ts +11 -1
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +198 -27
- package/dest/spartan/utils/scripts.d.ts +18 -4
- package/dest/spartan/utils/scripts.d.ts.map +1 -1
- package/dest/spartan/utils/scripts.js +19 -4
- package/package.json +42 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +5 -5
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +1 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +6 -7
- package/src/e2e_deploy_contract/deploy_test.ts +2 -2
- package/src/e2e_epochs/epochs_test.ts +44 -13
- package/src/e2e_fees/fees_test.ts +6 -6
- package/src/e2e_l1_publisher/write_json.ts +1 -6
- package/src/e2e_nested_contract/nested_contract_test.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
- package/src/e2e_p2p/p2p_network.ts +4 -4
- package/src/e2e_p2p/reqresp/utils.ts +207 -0
- package/src/e2e_p2p/shared.ts +11 -2
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +4 -4
- package/src/fixtures/ha_setup.ts +184 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/setup.ts +33 -118
- package/src/fixtures/setup_p2p_test.ts +31 -27
- package/src/shared/uniswap_l1_l2.ts +8 -10
- package/src/spartan/tx_metrics.ts +126 -0
- package/src/spartan/utils/config.ts +1 -0
- package/src/spartan/utils/index.ts +3 -1
- package/src/spartan/utils/k8s.ts +152 -0
- package/src/spartan/utils/nodes.ts +239 -24
- package/src/spartan/utils/scripts.ts +43 -7
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import {
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
|
+
import { makeBackoff, retry, retryUntil } from '@aztec/foundation/retry';
|
|
3
4
|
import { sleep } from '@aztec/foundation/sleep';
|
|
4
5
|
import { createAztecNodeAdminClient } from '@aztec/stdlib/interfaces/client';
|
|
5
6
|
import { exec } from 'child_process';
|
|
6
7
|
import { promisify } from 'util';
|
|
7
8
|
import { execHelmCommand } from './helm.js';
|
|
8
|
-
import { deleteResourceByLabel, getChartDir, startPortForward, waitForResourceByLabel } from './k8s.js';
|
|
9
|
+
import { deleteResourceByLabel, getChartDir, startPortForward, waitForResourceByLabel, waitForResourceByName, waitForStatefulSetsReady } from './k8s.js';
|
|
9
10
|
const execAsync = promisify(exec);
|
|
10
11
|
const logger = createLogger('e2e:k8s-utils');
|
|
11
12
|
export async function awaitCheckpointNumber(rollupCheatCodes, checkpointNumber, timeoutSeconds, log) {
|
|
@@ -23,6 +24,43 @@ export async function awaitCheckpointNumber(rollupCheatCodes, checkpointNumber,
|
|
|
23
24
|
log.info(`Reached checkpoint ${tips.pending}`);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Waits until the proven block number increases.
|
|
29
|
+
*
|
|
30
|
+
* @param rpcUrl - URL of an Aztec RPC node to query
|
|
31
|
+
* @param log - Logger instance
|
|
32
|
+
* @param timeoutSeconds - Maximum time to wait
|
|
33
|
+
* @param pollIntervalSeconds - How often to check
|
|
34
|
+
*/ export async function waitForProvenToAdvance(rpcUrl, log, timeoutSeconds = 300, pollIntervalSeconds = 12) {
|
|
35
|
+
const node = createAztecNodeClient(rpcUrl);
|
|
36
|
+
log.info('Waiting for proven block to advance (indicating epoch proof just submitted)...');
|
|
37
|
+
// Get current proven block number
|
|
38
|
+
let initialProvenBlock;
|
|
39
|
+
try {
|
|
40
|
+
const tips = await node.getL2Tips();
|
|
41
|
+
initialProvenBlock = Number(tips.proven.block.number);
|
|
42
|
+
log.info(`Current proven block: ${initialProvenBlock}. Waiting for it to increase...`);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
log.warn(`Error getting initial tips: ${err}. Will poll until successful.`);
|
|
45
|
+
initialProvenBlock = 0;
|
|
46
|
+
}
|
|
47
|
+
await retryUntil(async ()=>{
|
|
48
|
+
try {
|
|
49
|
+
const tips = await node.getL2Tips();
|
|
50
|
+
const currentProvenBlock = Number(tips.proven.block.number);
|
|
51
|
+
const proposedBlock = Number(tips.proposed.number);
|
|
52
|
+
log.verbose(`Chain state: proposed=${proposedBlock}, proven=${currentProvenBlock} (waiting for > ${initialProvenBlock})`);
|
|
53
|
+
if (currentProvenBlock > initialProvenBlock) {
|
|
54
|
+
log.info(`Proven block advanced from ${initialProvenBlock} to ${currentProvenBlock}.`);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
} catch (err) {
|
|
59
|
+
log.verbose(`Error checking tips: ${err}`);
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}, 'proven block to advance', timeoutSeconds, pollIntervalSeconds);
|
|
63
|
+
}
|
|
26
64
|
export async function getSequencers(namespace) {
|
|
27
65
|
const selectors = [
|
|
28
66
|
'app.kubernetes.io/name=validator',
|
|
@@ -61,9 +99,15 @@ export async function withSequencersAdmin(env, fn) {
|
|
|
61
99
|
const sequencers = await getSequencers(namespace);
|
|
62
100
|
const results = [];
|
|
63
101
|
for (const sequencer of sequencers){
|
|
102
|
+
// Ensure pod is Ready before attempting port-forward.
|
|
103
|
+
await waitForResourceByName({
|
|
104
|
+
resource: 'pods',
|
|
105
|
+
name: sequencer,
|
|
106
|
+
namespace
|
|
107
|
+
});
|
|
64
108
|
// Wrap port-forward + fetch in a retry to handle flaky port-forwards
|
|
65
109
|
const result = await retry(async ()=>{
|
|
66
|
-
const { process, port } = await startPortForward({
|
|
110
|
+
const { process: process1, port } = await startPortForward({
|
|
67
111
|
resource: `pod/${sequencer}`,
|
|
68
112
|
namespace,
|
|
69
113
|
containerPort: adminContainerPort
|
|
@@ -78,11 +122,11 @@ export async function withSequencersAdmin(env, fn) {
|
|
|
78
122
|
const client = createAztecNodeAdminClient(url);
|
|
79
123
|
return {
|
|
80
124
|
result: await fn(client),
|
|
81
|
-
process
|
|
125
|
+
process: process1
|
|
82
126
|
};
|
|
83
127
|
} catch (err) {
|
|
84
128
|
// Kill the port-forward before retrying
|
|
85
|
-
|
|
129
|
+
process1.kill();
|
|
86
130
|
throw err;
|
|
87
131
|
}
|
|
88
132
|
}, 'connect to node admin', makeBackoff([
|
|
@@ -96,6 +140,58 @@ export async function withSequencersAdmin(env, fn) {
|
|
|
96
140
|
}
|
|
97
141
|
return results;
|
|
98
142
|
}
|
|
143
|
+
async function getAztecImageForMigrations(namespace) {
|
|
144
|
+
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
145
|
+
if (aztecDockerImage) {
|
|
146
|
+
return aztecDockerImage;
|
|
147
|
+
}
|
|
148
|
+
const { stdout } = await execAsync(`kubectl get pods -l app.kubernetes.io/name=validator -n ${namespace} -o jsonpath='{.items[0].spec.containers[?(@.name=="aztec")].image}' | cat`);
|
|
149
|
+
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
150
|
+
if (!image) {
|
|
151
|
+
throw new Error(`Could not detect aztec image from validator pod in namespace ${namespace}`);
|
|
152
|
+
}
|
|
153
|
+
return image;
|
|
154
|
+
}
|
|
155
|
+
async function getHaDbConnectionUrl(namespace) {
|
|
156
|
+
const secretName = `${namespace}-validator-ha-db-postgres`;
|
|
157
|
+
const { stdout } = await execAsync(`kubectl get secret ${secretName} -n ${namespace} -o json`);
|
|
158
|
+
const secret = JSON.parse(stdout);
|
|
159
|
+
const data = secret?.data ?? {};
|
|
160
|
+
const decode = (value)=>value ? Buffer.from(value, 'base64').toString('utf8') : '';
|
|
161
|
+
const user = decode(data.POSTGRES_USER);
|
|
162
|
+
const password = decode(data.POSTGRES_PASSWORD);
|
|
163
|
+
const database = decode(data.POSTGRES_DB);
|
|
164
|
+
if (!user || !password || !database) {
|
|
165
|
+
throw new Error(`Missing HA DB credentials in secret ${secretName}`);
|
|
166
|
+
}
|
|
167
|
+
const host = `${namespace}-validator-ha-db-postgres.${namespace}.svc.cluster.local`;
|
|
168
|
+
return `postgresql://${encodeURIComponent(user)}:${encodeURIComponent(password)}@${host}:5432/${database}`;
|
|
169
|
+
}
|
|
170
|
+
export async function initHADb(namespace) {
|
|
171
|
+
const databaseUrl = await getHaDbConnectionUrl(namespace);
|
|
172
|
+
const image = await getAztecImageForMigrations(namespace);
|
|
173
|
+
const jobName = `${namespace}-validator-ha-db-migrate`;
|
|
174
|
+
await execAsync(`kubectl delete pod ${jobName} -n ${namespace} --ignore-not-found=true`).catch(()=>undefined);
|
|
175
|
+
const migrateCmd = [
|
|
176
|
+
`kubectl run ${jobName} -n ${namespace}`,
|
|
177
|
+
'--rm -i',
|
|
178
|
+
'--restart=Never',
|
|
179
|
+
`--image=${image}`,
|
|
180
|
+
`--env=DATABASE_URL=${databaseUrl}`,
|
|
181
|
+
'--command -- node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js migrate-ha-db up'
|
|
182
|
+
].join(' ');
|
|
183
|
+
const migrateCmdForLog = migrateCmd.replace(/--env=DATABASE_URL=\S+/, '--env=DATABASE_URL=<redacted>');
|
|
184
|
+
await retry(async ()=>{
|
|
185
|
+
logger.info(`command: ${migrateCmdForLog}`);
|
|
186
|
+
await execAsync(migrateCmd);
|
|
187
|
+
}, 'run HA DB migrations', makeBackoff([
|
|
188
|
+
1,
|
|
189
|
+
2,
|
|
190
|
+
4,
|
|
191
|
+
8,
|
|
192
|
+
16
|
|
193
|
+
]), logger, true);
|
|
194
|
+
}
|
|
99
195
|
/**
|
|
100
196
|
* Enables or disables probabilistic transaction dropping on validators and waits for rollout.
|
|
101
197
|
* Wired to env vars P2P_DROP_TX and P2P_DROP_TX_CHANCE via Helm values.
|
|
@@ -201,14 +297,16 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
|
|
|
201
297
|
'prover-broker',
|
|
202
298
|
'prover-agent',
|
|
203
299
|
'sequencer-node',
|
|
204
|
-
'rpc'
|
|
300
|
+
'rpc',
|
|
301
|
+
'validator-ha-db'
|
|
205
302
|
];
|
|
206
303
|
const pvcComponents = [
|
|
207
304
|
'p2p-bootstrap',
|
|
208
305
|
'prover-node',
|
|
209
306
|
'prover-broker',
|
|
210
307
|
'sequencer-node',
|
|
211
|
-
'rpc'
|
|
308
|
+
'rpc',
|
|
309
|
+
'validator-ha-db'
|
|
212
310
|
];
|
|
213
311
|
// StatefulSet components that need to be scaled down before PVC deletion
|
|
214
312
|
// Note: validators use 'sequencer-node' as component label, not 'validator'
|
|
@@ -217,20 +315,27 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
|
|
|
217
315
|
'prover-node',
|
|
218
316
|
'prover-broker',
|
|
219
317
|
'sequencer-node',
|
|
220
|
-
'rpc'
|
|
318
|
+
'rpc',
|
|
319
|
+
'validator-ha-db'
|
|
221
320
|
];
|
|
222
321
|
if (clearState) {
|
|
223
322
|
// To delete PVCs, we must first scale down StatefulSets so pods release the volumes
|
|
224
323
|
// Otherwise PVC deletion will hang waiting for pods to terminate
|
|
225
|
-
//
|
|
324
|
+
// Save original replica counts for all StatefulSets
|
|
226
325
|
const originalReplicas = new Map();
|
|
227
326
|
for (const component of statefulSetComponents){
|
|
228
327
|
try {
|
|
229
|
-
|
|
328
|
+
// Get all StatefulSets that match the component label
|
|
329
|
+
const getCmd = `kubectl get statefulset -l app.kubernetes.io/component=${component} -n ${namespace} -o json`;
|
|
230
330
|
const { stdout } = await execAsync(getCmd);
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
331
|
+
const result = JSON.parse(stdout);
|
|
332
|
+
for (const sts of result.items || []){
|
|
333
|
+
const name = sts.metadata.name;
|
|
334
|
+
const replicas = sts.spec.replicas ?? 1;
|
|
335
|
+
if (replicas > 0) {
|
|
336
|
+
originalReplicas.set(name, replicas);
|
|
337
|
+
logger.debug(`Saved replica count for StatefulSet ${name}: ${replicas}`);
|
|
338
|
+
}
|
|
234
339
|
}
|
|
235
340
|
} catch {
|
|
236
341
|
// Component might not exist, continue
|
|
@@ -247,25 +352,79 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
|
|
|
247
352
|
logger.verbose(`Scale down ${component} skipped: ${e}`);
|
|
248
353
|
}
|
|
249
354
|
}
|
|
250
|
-
// Wait for pods to terminate
|
|
251
|
-
|
|
355
|
+
// Wait for all pods to fully terminate before deleting PVCs.
|
|
356
|
+
// terminationGracePeriodSeconds default is 30s.
|
|
357
|
+
logger.info('Waiting for pods to fully terminate before deleting PVCs...');
|
|
358
|
+
for (const component of statefulSetComponents){
|
|
359
|
+
try {
|
|
360
|
+
// Wait for all pods with this component label to be deleted
|
|
361
|
+
const waitCmd = `kubectl wait pods -l app.kubernetes.io/component=${component} --for=delete -n ${namespace} --timeout=2m`;
|
|
362
|
+
logger.info(`command: ${waitCmd}`);
|
|
363
|
+
await execAsync(waitCmd);
|
|
364
|
+
} catch (e) {
|
|
365
|
+
logger.verbose(`Wait for pod deletion ${component} skipped: ${e}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
// Extra buffer to ensure PVC protection finalizers are cleared
|
|
369
|
+
await sleep(5 * 1000);
|
|
252
370
|
// Now delete PVCs (they should no longer be in use)
|
|
253
371
|
for (const component of pvcComponents){
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
372
|
+
try {
|
|
373
|
+
await deleteResourceByLabel({
|
|
374
|
+
resource: 'persistentvolumeclaims',
|
|
375
|
+
namespace: namespace,
|
|
376
|
+
label: `app.kubernetes.io/component=${component}`
|
|
377
|
+
});
|
|
378
|
+
} catch (e) {
|
|
379
|
+
logger.warn(`Failed to delete PVCs for ${component}: ${e}`);
|
|
380
|
+
}
|
|
259
381
|
}
|
|
260
|
-
//
|
|
261
|
-
for (const component of
|
|
262
|
-
|
|
382
|
+
// Verify PVCs are deleted
|
|
383
|
+
for (const component of pvcComponents){
|
|
384
|
+
try {
|
|
385
|
+
const waitCmd = `kubectl wait pvc -l app.kubernetes.io/component=${component} --for=delete -n ${namespace} --timeout=2m`;
|
|
386
|
+
logger.info(`command: ${waitCmd}`);
|
|
387
|
+
await execAsync(waitCmd);
|
|
388
|
+
} catch (e) {
|
|
389
|
+
logger.verbose(`Wait for PVC deletion ${component} skipped: ${e}`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const haDbStatefulSets = [
|
|
393
|
+
...originalReplicas.entries()
|
|
394
|
+
].filter(([name])=>name.includes('validator-ha-db'));
|
|
395
|
+
const otherStatefulSets = [
|
|
396
|
+
...originalReplicas.entries()
|
|
397
|
+
].filter(([name])=>!name.includes('validator-ha-db'));
|
|
398
|
+
// Bring up HA DB first so we can run migrations before validators start
|
|
399
|
+
for (const [stsName, replicas] of haDbStatefulSets){
|
|
400
|
+
try {
|
|
401
|
+
const scaleCmd = `kubectl scale statefulset ${stsName} -n ${namespace} --replicas=${replicas} --timeout=2m`;
|
|
402
|
+
logger.info(`command: ${scaleCmd}`);
|
|
403
|
+
await execAsync(scaleCmd);
|
|
404
|
+
} catch (e) {
|
|
405
|
+
logger.verbose(`Scale up ${stsName} skipped: ${e}`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (haDbStatefulSets.length > 0) {
|
|
409
|
+
try {
|
|
410
|
+
await waitForStatefulSetsReady({
|
|
411
|
+
namespace,
|
|
412
|
+
label: 'app.kubernetes.io/component=validator-ha-db',
|
|
413
|
+
timeoutSeconds: 600
|
|
414
|
+
});
|
|
415
|
+
await initHADb(namespace);
|
|
416
|
+
} catch (e) {
|
|
417
|
+
logger.warn(`HA DB migration step skipped or failed: ${e}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
// Scale remaining StatefulSets back up to original replica counts (by name, not label)
|
|
421
|
+
for (const [stsName, replicas] of otherStatefulSets){
|
|
263
422
|
try {
|
|
264
|
-
const scaleCmd = `kubectl scale statefulset
|
|
423
|
+
const scaleCmd = `kubectl scale statefulset ${stsName} -n ${namespace} --replicas=${replicas} --timeout=2m`;
|
|
265
424
|
logger.info(`command: ${scaleCmd}`);
|
|
266
425
|
await execAsync(scaleCmd);
|
|
267
426
|
} catch (e) {
|
|
268
|
-
logger.verbose(`Scale up ${
|
|
427
|
+
logger.verbose(`Scale up ${stsName} skipped: ${e}`);
|
|
269
428
|
}
|
|
270
429
|
}
|
|
271
430
|
} else {
|
|
@@ -279,8 +438,20 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
|
|
|
279
438
|
}
|
|
280
439
|
}
|
|
281
440
|
await sleep(10 * 1000);
|
|
282
|
-
// Wait for
|
|
283
|
-
for (const component of
|
|
441
|
+
// Wait for StatefulSets to have all replicas ready.
|
|
442
|
+
for (const component of statefulSetComponents){
|
|
443
|
+
try {
|
|
444
|
+
await waitForStatefulSetsReady({
|
|
445
|
+
namespace,
|
|
446
|
+
label: `app.kubernetes.io/component=${component}`,
|
|
447
|
+
timeoutSeconds: 600
|
|
448
|
+
});
|
|
449
|
+
} catch (e) {
|
|
450
|
+
logger.warn(`StatefulSet component ${component} may not be fully ready: ${e}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const nonStatefulSetComponents = podComponents.filter((c)=>!statefulSetComponents.includes(c));
|
|
454
|
+
for (const component of nonStatefulSetComponents){
|
|
284
455
|
await waitForResourceByLabel({
|
|
285
456
|
resource: 'pods',
|
|
286
457
|
namespace: namespace,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
+
/** Result from running a script */
|
|
3
|
+
export type ScriptResult = {
|
|
4
|
+
exitCode: number;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
};
|
|
2
8
|
/**
|
|
3
9
|
* Returns the absolute path to the git repository root
|
|
4
10
|
*/
|
|
@@ -9,8 +15,16 @@ export declare function getAztecBin(): string;
|
|
|
9
15
|
* @param args - The arguments to pass to the Aztec binary
|
|
10
16
|
* @param logger - The logger to use
|
|
11
17
|
* @param env - Optional environment variables to set for the process
|
|
12
|
-
* @returns The exit code of the Aztec binary
|
|
18
|
+
* @returns The exit code, stdout, and stderr of the Aztec binary
|
|
13
19
|
*/
|
|
14
|
-
export declare function runAztecBin(args: string[], logger: Logger, env?: Record<string, string>): Promise<
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
export declare function runAztecBin(args: string[], logger: Logger, env?: Record<string, string>): Promise<ScriptResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Runs a script from the project root
|
|
23
|
+
* @param script - The path to the script, relative to the project root
|
|
24
|
+
* @param args - The arguments to pass to the script
|
|
25
|
+
* @param logger - The logger to use
|
|
26
|
+
* @param env - Optional environment variables to set for the process
|
|
27
|
+
* @returns The exit code, stdout, and stderr of the script
|
|
28
|
+
*/
|
|
29
|
+
export declare function runProjectScript(script: string, args: string[], logger: Logger, env?: Record<string, string>): Promise<ScriptResult>;
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyaXB0cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NwYXJ0YW4vdXRpbHMvc2NyaXB0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUtwRCxtQ0FBbUM7QUFDbkMsTUFBTSxNQUFNLFlBQVksR0FBRztJQUN6QixRQUFRLEVBQUUsTUFBTSxDQUFDO0lBQ2pCLE1BQU0sRUFBRSxNQUFNLENBQUM7SUFDZixNQUFNLEVBQUUsTUFBTSxDQUFDO0NBQ2hCLENBQUM7QUF5Q0Y7O0dBRUc7QUFDSCx3QkFBZ0IsaUJBQWlCLElBQUksTUFBTSxDQVcxQztBQUVELHdCQUFnQixXQUFXLFdBRTFCO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLFdBQVcsQ0FBQyxJQUFJLEVBQUUsTUFBTSxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLENBQUMsRUFBRSxNQUFNLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FFL0c7QUFFRDs7Ozs7OztHQU9HO0FBQ0gsd0JBQWdCLGdCQUFnQixDQUM5QixNQUFNLEVBQUUsTUFBTSxFQUNkLElBQUksRUFBRSxNQUFNLEVBQUUsRUFDZCxNQUFNLEVBQUUsTUFBTSxFQUNkLEdBQUcsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLEdBQzNCLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FHdkIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../src/spartan/utils/scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../src/spartan/utils/scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,mCAAmC;AACnC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyCF;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C;AAED,wBAAgB,WAAW,WAE1B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAE/G;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,YAAY,CAAC,CAGvB"}
|
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
* @param scriptPath - The path to the script, relative to the project root
|
|
5
5
|
* @param args - The arguments to pass to the script
|
|
6
6
|
* @param logger - The logger to use
|
|
7
|
-
* @returns The exit code of the script
|
|
7
|
+
* @returns The exit code, stdout, and stderr of the script
|
|
8
8
|
*/ function runScript(scriptPath, args, logger, env) {
|
|
9
9
|
const childProcess = spawn(scriptPath, args, {
|
|
10
10
|
stdio: [
|
|
@@ -17,13 +17,21 @@ import path from 'path';
|
|
|
17
17
|
...env
|
|
18
18
|
} : process.env
|
|
19
19
|
});
|
|
20
|
+
const stdoutChunks = [];
|
|
21
|
+
const stderrChunks = [];
|
|
20
22
|
return new Promise((resolve, reject)=>{
|
|
21
|
-
childProcess.on('close', (code)=>resolve(
|
|
23
|
+
childProcess.on('close', (code)=>resolve({
|
|
24
|
+
exitCode: code ?? 0,
|
|
25
|
+
stdout: Buffer.concat(stdoutChunks).toString(),
|
|
26
|
+
stderr: Buffer.concat(stderrChunks).toString()
|
|
27
|
+
}));
|
|
22
28
|
childProcess.on('error', reject);
|
|
23
29
|
childProcess.stdout?.on('data', (data)=>{
|
|
30
|
+
stdoutChunks.push(data);
|
|
24
31
|
logger.info(data.toString());
|
|
25
32
|
});
|
|
26
33
|
childProcess.stderr?.on('data', (data)=>{
|
|
34
|
+
stderrChunks.push(data);
|
|
27
35
|
logger.error(data.toString());
|
|
28
36
|
});
|
|
29
37
|
});
|
|
@@ -53,14 +61,21 @@ export function getAztecBin() {
|
|
|
53
61
|
* @param args - The arguments to pass to the Aztec binary
|
|
54
62
|
* @param logger - The logger to use
|
|
55
63
|
* @param env - Optional environment variables to set for the process
|
|
56
|
-
* @returns The exit code of the Aztec binary
|
|
64
|
+
* @returns The exit code, stdout, and stderr of the Aztec binary
|
|
57
65
|
*/ export function runAztecBin(args, logger, env) {
|
|
58
66
|
return runScript('node', [
|
|
59
67
|
getAztecBin(),
|
|
60
68
|
...args
|
|
61
69
|
], logger, env);
|
|
62
70
|
}
|
|
63
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Runs a script from the project root
|
|
73
|
+
* @param script - The path to the script, relative to the project root
|
|
74
|
+
* @param args - The arguments to pass to the script
|
|
75
|
+
* @param logger - The logger to use
|
|
76
|
+
* @param env - Optional environment variables to set for the process
|
|
77
|
+
* @returns The exit code, stdout, and stderr of the script
|
|
78
|
+
*/ export function runProjectScript(script, args, logger, env) {
|
|
64
79
|
const scriptPath = script.startsWith('/') ? script : path.join(getGitProjectRoot(), script);
|
|
65
80
|
return runScript(scriptPath, args, logger, env);
|
|
66
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.3d8f95d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -22,47 +22,48 @@
|
|
|
22
22
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
|
|
23
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures",
|
|
24
24
|
"test:compose": "./scripts/run_test.sh compose",
|
|
25
|
+
"test:ha": "./scripts/run_test.sh ha",
|
|
25
26
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
29
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
30
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
32
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
33
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
34
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
35
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
36
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
37
|
-
"@aztec/bot": "0.0.1-commit.
|
|
38
|
-
"@aztec/cli": "0.0.1-commit.
|
|
39
|
-
"@aztec/constants": "0.0.1-commit.
|
|
40
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
41
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
42
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
43
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
44
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
45
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
46
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
47
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
49
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
51
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
52
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
53
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
54
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
55
|
-
"@aztec/prover-node": "0.0.1-commit.
|
|
56
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
57
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
58
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
59
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
60
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
61
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
62
|
-
"@aztec/test-wallet": "0.0.1-commit.
|
|
63
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
64
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
65
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
29
|
+
"@aztec/accounts": "0.0.1-commit.3d8f95d",
|
|
30
|
+
"@aztec/archiver": "0.0.1-commit.3d8f95d",
|
|
31
|
+
"@aztec/aztec": "0.0.1-commit.3d8f95d",
|
|
32
|
+
"@aztec/aztec-node": "0.0.1-commit.3d8f95d",
|
|
33
|
+
"@aztec/aztec.js": "0.0.1-commit.3d8f95d",
|
|
34
|
+
"@aztec/bb-prover": "0.0.1-commit.3d8f95d",
|
|
35
|
+
"@aztec/bb.js": "0.0.1-commit.3d8f95d",
|
|
36
|
+
"@aztec/blob-client": "0.0.1-commit.3d8f95d",
|
|
37
|
+
"@aztec/blob-lib": "0.0.1-commit.3d8f95d",
|
|
38
|
+
"@aztec/bot": "0.0.1-commit.3d8f95d",
|
|
39
|
+
"@aztec/cli": "0.0.1-commit.3d8f95d",
|
|
40
|
+
"@aztec/constants": "0.0.1-commit.3d8f95d",
|
|
41
|
+
"@aztec/entrypoints": "0.0.1-commit.3d8f95d",
|
|
42
|
+
"@aztec/epoch-cache": "0.0.1-commit.3d8f95d",
|
|
43
|
+
"@aztec/ethereum": "0.0.1-commit.3d8f95d",
|
|
44
|
+
"@aztec/foundation": "0.0.1-commit.3d8f95d",
|
|
45
|
+
"@aztec/kv-store": "0.0.1-commit.3d8f95d",
|
|
46
|
+
"@aztec/l1-artifacts": "0.0.1-commit.3d8f95d",
|
|
47
|
+
"@aztec/merkle-tree": "0.0.1-commit.3d8f95d",
|
|
48
|
+
"@aztec/node-keystore": "0.0.1-commit.3d8f95d",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.3d8f95d",
|
|
50
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.3d8f95d",
|
|
51
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.3d8f95d",
|
|
52
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.3d8f95d",
|
|
53
|
+
"@aztec/p2p": "0.0.1-commit.3d8f95d",
|
|
54
|
+
"@aztec/protocol-contracts": "0.0.1-commit.3d8f95d",
|
|
55
|
+
"@aztec/prover-client": "0.0.1-commit.3d8f95d",
|
|
56
|
+
"@aztec/prover-node": "0.0.1-commit.3d8f95d",
|
|
57
|
+
"@aztec/pxe": "0.0.1-commit.3d8f95d",
|
|
58
|
+
"@aztec/sequencer-client": "0.0.1-commit.3d8f95d",
|
|
59
|
+
"@aztec/simulator": "0.0.1-commit.3d8f95d",
|
|
60
|
+
"@aztec/slasher": "0.0.1-commit.3d8f95d",
|
|
61
|
+
"@aztec/stdlib": "0.0.1-commit.3d8f95d",
|
|
62
|
+
"@aztec/telemetry-client": "0.0.1-commit.3d8f95d",
|
|
63
|
+
"@aztec/test-wallet": "0.0.1-commit.3d8f95d",
|
|
64
|
+
"@aztec/validator-client": "0.0.1-commit.3d8f95d",
|
|
65
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.3d8f95d",
|
|
66
|
+
"@aztec/world-state": "0.0.1-commit.3d8f95d",
|
|
66
67
|
"@iarna/toml": "^2.2.5",
|
|
67
68
|
"@jest/globals": "^30.0.0",
|
|
68
69
|
"@noble/curves": "=1.0.0",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"lodash.every": "^4.6.0",
|
|
91
92
|
"lodash.omit": "^4.5.0",
|
|
92
93
|
"msgpackr": "^1.11.2",
|
|
94
|
+
"pg": "^8.17.1",
|
|
93
95
|
"process": "^0.11.10",
|
|
94
96
|
"snappy": "^7.2.2",
|
|
95
97
|
"stream-browserify": "^3.0.0",
|
|
@@ -108,6 +110,7 @@
|
|
|
108
110
|
"@types/jest": "^30.0.0",
|
|
109
111
|
"@types/js-yaml": "^4.0.9",
|
|
110
112
|
"@types/lodash.chunk": "^4.2.9",
|
|
113
|
+
"@types/pg": "^8",
|
|
111
114
|
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
112
115
|
"concurrently": "^7.6.0",
|
|
113
116
|
"jest": "^30.0.0",
|
|
@@ -138,10 +138,10 @@ export class ClientFlowsBenchmark {
|
|
|
138
138
|
});
|
|
139
139
|
await this.applyBaseSetup();
|
|
140
140
|
|
|
141
|
-
await this.context.aztecNodeService
|
|
141
|
+
await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
|
|
142
142
|
|
|
143
143
|
const rollupContract = RollupContract.getFromConfig(this.context.config);
|
|
144
|
-
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider
|
|
144
|
+
this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
|
|
145
145
|
|
|
146
146
|
return this;
|
|
147
147
|
}
|
|
@@ -207,7 +207,7 @@ export class ClientFlowsBenchmark {
|
|
|
207
207
|
const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
|
|
208
208
|
|
|
209
209
|
this.adminWallet = this.context.wallet;
|
|
210
|
-
this.aztecNode = this.context.aztecNodeService
|
|
210
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
211
211
|
this.cheatCodes = this.context.cheatCodes;
|
|
212
212
|
|
|
213
213
|
this.adminAddress = adminAddress;
|
|
@@ -235,8 +235,8 @@ export class ClientFlowsBenchmark {
|
|
|
235
235
|
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
|
|
236
236
|
|
|
237
237
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
238
|
-
aztecNode: this.context.aztecNodeService
|
|
239
|
-
aztecNodeAdmin: this.context.aztecNodeService
|
|
238
|
+
aztecNode: this.context.aztecNodeService,
|
|
239
|
+
aztecNodeAdmin: this.context.aztecNodeService,
|
|
240
240
|
l1Client: this.context.deployL1ContractsValues.l1Client,
|
|
241
241
|
wallet: this.adminWallet,
|
|
242
242
|
logger: this.logger,
|
|
@@ -6,7 +6,7 @@ export type ClientFlowConfig = {
|
|
|
6
6
|
recursions?: number[];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
|
|
9
|
+
type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm' | 'storageProof';
|
|
10
10
|
|
|
11
11
|
export type ClientFlowsConfig = {
|
|
12
12
|
[key in ClientFlows]: ClientFlowConfig;
|
|
@@ -34,6 +34,10 @@ export const KEY_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
34
34
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
35
35
|
recursions: [0, 1],
|
|
36
36
|
},
|
|
37
|
+
storageProof: {
|
|
38
|
+
accounts: ['ecdsar1'],
|
|
39
|
+
feePaymentMethods: ['sponsored_fpc'],
|
|
40
|
+
},
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
@@ -58,4 +62,8 @@ export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
|
|
|
58
62
|
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
59
63
|
recursions: [0, 1, 2],
|
|
60
64
|
},
|
|
65
|
+
storageProof: {
|
|
66
|
+
accounts: ['ecdsar1', 'schnorr'],
|
|
67
|
+
feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
|
|
68
|
+
},
|
|
61
69
|
};
|
package/src/bench/utils.ts
CHANGED
|
@@ -28,7 +28,7 @@ export async function benchmarkSetup(
|
|
|
28
28
|
const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
|
|
29
29
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
30
30
|
const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
|
|
31
|
-
const telemetry = context.telemetryClient
|
|
31
|
+
const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
|
|
32
32
|
context.logger.warn(`Cleared benchmark data points from setup`);
|
|
33
33
|
telemetry.clear();
|
|
34
34
|
const origTeardown = context.teardown.bind(context);
|
|
@@ -92,7 +92,7 @@ export class BlacklistTokenContractTest {
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
this.cheatCodes = this.context.cheatCodes;
|
|
95
|
-
this.aztecNode = this.context.aztecNodeService
|
|
95
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
96
96
|
this.sequencer = this.context.sequencer!;
|
|
97
97
|
this.wallet = this.context.wallet;
|
|
98
98
|
this.adminAddress = deployedAccounts[0].address;
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
} from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
14
14
|
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
15
15
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
16
|
-
import {
|
|
16
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
17
17
|
import { sleep } from '@aztec/foundation/sleep';
|
|
18
18
|
import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
19
19
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -86,9 +86,8 @@ export class CrossChainMessagingTest {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async advanceToEpochProven(l2TxReceipt: TxReceipt): Promise<EpochNumber> {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
);
|
|
89
|
+
const block = await this.aztecNode.getBlock(l2TxReceipt.blockNumber!);
|
|
90
|
+
const epoch = await this.rollup.getEpochNumberForCheckpoint(block!.checkpointNumber);
|
|
92
91
|
// Warp to the next epoch.
|
|
93
92
|
await this.cheatCodes.rollup.advanceToEpoch(EpochNumber(epoch + 1));
|
|
94
93
|
// Wait for the tx to be proven.
|
|
@@ -110,16 +109,16 @@ export class CrossChainMessagingTest {
|
|
|
110
109
|
|
|
111
110
|
async applyBaseSetup() {
|
|
112
111
|
// Set up base context fields
|
|
113
|
-
this.aztecNode = this.context.aztecNodeService
|
|
112
|
+
this.aztecNode = this.context.aztecNodeService;
|
|
114
113
|
this.wallet = this.context.wallet;
|
|
115
114
|
this.aztecNodeConfig = this.context.config;
|
|
116
115
|
this.cheatCodes = this.context.cheatCodes;
|
|
117
116
|
this.deployL1ContractsValues = this.context.deployL1ContractsValues;
|
|
118
|
-
this.aztecNodeAdmin = this.context.aztecNodeService
|
|
117
|
+
this.aztecNodeAdmin = this.context.aztecNodeService;
|
|
119
118
|
|
|
120
119
|
if (this.requireEpochProven) {
|
|
121
120
|
// Turn off the watcher to prevent it from keep marking blocks as proven.
|
|
122
|
-
this.context.watcher
|
|
121
|
+
this.context.watcher.setIsMarkingAsProven(false);
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
// Deploy 3 accounts
|