@aztec/end-to-end 0.0.1-commit.88e6f9396 → 0.0.1-commit.8c0b8ff

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.
Files changed (92) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.js +3 -4
  5. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
  6. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  7. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -1
  8. package/dest/e2e_fees/fees_test.js +1 -1
  9. package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
  10. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  11. package/dest/e2e_p2p/inactivity_slash_test.js +1 -0
  12. package/dest/e2e_p2p/p2p_network.d.ts +1 -1
  13. package/dest/e2e_p2p/p2p_network.js +1 -1
  14. package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
  15. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
  16. package/dest/e2e_p2p/reqresp/utils.js +2 -15
  17. package/dest/e2e_p2p/shared.d.ts +13 -1
  18. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  19. package/dest/e2e_p2p/shared.js +23 -0
  20. package/dest/fixtures/authwit_proxy.d.ts +1 -1
  21. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  22. package/dest/fixtures/authwit_proxy.js +4 -0
  23. package/dest/fixtures/setup.d.ts +4 -5
  24. package/dest/fixtures/setup.d.ts.map +1 -1
  25. package/dest/fixtures/setup.js +12 -9
  26. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  27. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  28. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  29. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  30. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  31. package/dest/forward-compatibility/wallet_service.js +109 -0
  32. package/dest/legacy-jest-resolver.d.cts +3 -0
  33. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  34. package/dest/shared/jest_setup.js +1 -41
  35. package/dest/shared/submit-transactions.d.ts +1 -1
  36. package/dest/shared/submit-transactions.d.ts.map +1 -1
  37. package/dest/simulators/lending_simulator.d.ts +1 -1
  38. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  39. package/dest/simulators/lending_simulator.js +2 -2
  40. package/dest/simulators/token_simulator.js +1 -1
  41. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  42. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  43. package/dest/spartan/setup_test_wallets.js +6 -6
  44. package/dest/spartan/tx_metrics.js +1 -1
  45. package/dest/spartan/utils/config.d.ts +1 -7
  46. package/dest/spartan/utils/config.d.ts.map +1 -1
  47. package/dest/spartan/utils/config.js +1 -3
  48. package/dest/spartan/utils/index.d.ts +1 -2
  49. package/dest/spartan/utils/index.d.ts.map +1 -1
  50. package/dest/spartan/utils/index.js +0 -2
  51. package/dest/spartan/utils/nodes.d.ts +5 -4
  52. package/dest/spartan/utils/nodes.d.ts.map +1 -1
  53. package/dest/spartan/utils/nodes.js +9 -9
  54. package/dest/test-wallet/test_wallet.d.ts +16 -8
  55. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  56. package/dest/test-wallet/test_wallet.js +102 -67
  57. package/dest/test-wallet/worker_wallet.d.ts +4 -4
  58. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  59. package/dest/test-wallet/worker_wallet_schema.d.ts +3 -3
  60. package/package.json +45 -42
  61. package/src/bench/client_flows/client_flows_benchmark.ts +3 -3
  62. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +3 -6
  63. package/src/e2e_fees/fees_test.ts +1 -1
  64. package/src/e2e_p2p/inactivity_slash_test.ts +1 -0
  65. package/src/e2e_p2p/p2p_network.ts +1 -1
  66. package/src/e2e_p2p/reqresp/utils.ts +2 -23
  67. package/src/e2e_p2p/shared.ts +42 -0
  68. package/src/fixtures/authwit_proxy.ts +4 -0
  69. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  70. package/src/fixtures/setup.ts +14 -12
  71. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  72. package/src/forward-compatibility/wallet_service.ts +104 -0
  73. package/src/legacy-jest-resolver.cjs +135 -0
  74. package/src/shared/jest_setup.ts +1 -51
  75. package/src/shared/submit-transactions.ts +4 -1
  76. package/src/simulators/lending_simulator.ts +4 -2
  77. package/src/simulators/token_simulator.ts +1 -1
  78. package/src/spartan/setup_test_wallets.ts +6 -5
  79. package/src/spartan/tx_metrics.ts +1 -1
  80. package/src/spartan/utils/config.ts +0 -2
  81. package/src/spartan/utils/index.ts +0 -3
  82. package/src/spartan/utils/nodes.ts +10 -15
  83. package/src/test-wallet/test_wallet.ts +129 -72
  84. package/src/test-wallet/worker_wallet.ts +3 -2
  85. package/dest/fixtures/elu_monitor.d.ts +0 -21
  86. package/dest/fixtures/elu_monitor.d.ts.map +0 -1
  87. package/dest/fixtures/elu_monitor.js +0 -102
  88. package/dest/spartan/utils/pod_logs.d.ts +0 -25
  89. package/dest/spartan/utils/pod_logs.d.ts.map +0 -1
  90. package/dest/spartan/utils/pod_logs.js +0 -74
  91. package/src/fixtures/elu_monitor.ts +0 -126
  92. package/src/spartan/utils/pod_logs.ts +0 -99
@@ -0,0 +1,135 @@
1
+ // Custom Jest resolver. When CONTRACT_ARTIFACTS_VERSION is set, redirects *only* JSON artifact files under
2
+ // @aztec/noir-contracts.js/artifacts/, @aztec/noir-test-contracts.js/artifacts/, and @aztec/accounts/artifacts/ to a local cache of the pinned
3
+ // legacy versions. TypeScript wrapper classes (e.g. Token.ts) continue to load from the current workspace and use the
4
+ // current @aztec/aztec.js — only the artifact JSON (the deployed-contract ABI / bytecode / notes surface) is swapped.
5
+ //
6
+ // Why JSON-only: the JSON artifact is the actual interchange surface a "deployed contract" exposes. The TS wrapper is
7
+ // generated client-side ergonomics that's tightly coupled to the current @aztec/aztec.js API. Redirecting the wrapper
8
+ // would couple this test to a moving aztec.js surface and break at import time on unrelated breaking changes; we want
9
+ // to fail only on actual artifact-compat regressions.
10
+ //
11
+ // The cache is populated on demand by running `npm install` into .legacy-contracts/<version>/.
12
+ //
13
+ // Activated by env var; passthrough otherwise.
14
+ /* eslint-disable @typescript-eslint/no-require-imports */
15
+
16
+ const path = require('path');
17
+ const fs = require('fs');
18
+ const { execSync } = require('child_process');
19
+
20
+ const version = process.env.CONTRACT_ARTIFACTS_VERSION;
21
+ const REDIRECTED = ['@aztec/noir-contracts.js', '@aztec/noir-test-contracts.js', '@aztec/accounts'];
22
+
23
+ // Jest sets rootDir to <e2e>/src; this file lives there too.
24
+ const e2eRoot = path.resolve(__dirname, '..');
25
+ const cacheRoot = version ? path.join(e2eRoot, '.legacy-contracts', version) : null;
26
+
27
+ function pkgJsonPath(name) {
28
+ return path.join(cacheRoot, 'node_modules', name, 'package.json');
29
+ }
30
+
31
+ function ensureCache() {
32
+ const missing = REDIRECTED.some(p => !fs.existsSync(pkgJsonPath(p)));
33
+ if (!missing) {
34
+ return;
35
+ }
36
+ fs.mkdirSync(cacheRoot, { recursive: true });
37
+ // Seed a standalone package.json so `npm install --prefix` treats cacheRoot as its own project. Without this, npm
38
+ // walks up and finds the yarn-project workspace root, which breaks on `workspace:` protocol deps and risks
39
+ // clobbering the monorepo's node_modules.
40
+ const seed = path.join(cacheRoot, 'package.json');
41
+ if (!fs.existsSync(seed)) {
42
+ fs.writeFileSync(seed, JSON.stringify({ name: 'legacy-contracts-cache', private: true }));
43
+ }
44
+
45
+ const specs = REDIRECTED.map(p => `${p}@${version}`).join(' ');
46
+ process.stderr.write(`[legacy-contracts] installing ${specs} into ${cacheRoot}\n`);
47
+ // --prefix: install into cacheRoot instead of cwd, so the cache is isolated from the monorepo.
48
+ // --no-save: don't write the installed packages back to the seeded package.json.
49
+ // --ignore-scripts: skip lifecycle scripts (preinstall/postinstall) of the legacy packages and their transitive
50
+ // deps; we only want the files on disk, not to run any build steps.
51
+ // --legacy-peer-deps: tolerate peer-dependency mismatches between the pinned legacy @aztec/* graph and whatever
52
+ // current versions npm would otherwise try to reconcile.
53
+ execSync(`npm install --prefix "${cacheRoot}" --no-save --ignore-scripts --legacy-peer-deps ${specs}`, {
54
+ stdio: 'inherit',
55
+ });
56
+
57
+ // Verify versions on disk match the requested version.
58
+ for (const p of REDIRECTED) {
59
+ const onDisk = JSON.parse(fs.readFileSync(pkgJsonPath(p), 'utf8')).version;
60
+ if (onDisk !== version) {
61
+ throw new Error(`[legacy-contracts] ${p} on disk is ${onDisk}, expected ${version}`);
62
+ }
63
+ }
64
+ }
65
+
66
+ if (version) {
67
+ ensureCache();
68
+ }
69
+
70
+ let bannerPrinted = false;
71
+ const seen = new Set();
72
+
73
+ function printBannerOnce() {
74
+ if (bannerPrinted || !version) {
75
+ return;
76
+ }
77
+ bannerPrinted = true;
78
+ const lines = ['='.repeat(60), `[legacy-contracts][jest] CONTRACT_ARTIFACTS_VERSION=${version}`];
79
+ for (const p of REDIRECTED) {
80
+ const v = JSON.parse(fs.readFileSync(pkgJsonPath(p), 'utf8')).version;
81
+ if (v !== version) {
82
+ throw new Error(`[legacy-contracts] ${p} on disk is ${v}, expected ${version}`);
83
+ }
84
+ lines.push(`[legacy-contracts][jest] redirecting ${p}/artifacts/*.json -> .legacy-contracts/${version}/...`);
85
+ }
86
+ lines.push('='.repeat(60));
87
+ process.stderr.write(lines.join('\n') + '\n');
88
+ }
89
+
90
+ // Match a resolved absolute path against the workspace artifacts dirs and return the legacy cache equivalent, or null
91
+ // if it's not an artifact path we should redirect.
92
+ function legacyArtifactPath(resolved) {
93
+ if (!resolved.endsWith('.json')) {
94
+ return null;
95
+ }
96
+ for (const pkg of REDIRECTED) {
97
+ // pkg = '@aztec/noir-contracts.js' -> match '/noir-contracts.js/artifacts/'
98
+ const dirName = pkg.split('/')[1];
99
+ const marker = `/${dirName}/artifacts/`;
100
+ const idx = resolved.indexOf(marker);
101
+ if (idx === -1) {
102
+ continue;
103
+ }
104
+ const basename = resolved.slice(idx + marker.length);
105
+ return path.join(cacheRoot, 'node_modules', pkg, 'artifacts', basename);
106
+ }
107
+ return null;
108
+ }
109
+
110
+ module.exports = function legacyResolver(request, options) {
111
+ // Always run the default resolver first. We only inspect (and possibly rewrite) the *result*; this catches both
112
+ // bare-specifier imports of `@aztec/noir-contracts.js/artifacts/foo.json` and the relative `../artifacts/foo.json`
113
+ // imports inside the workspace TS wrapper classes — both resolve to the same workspace artifact path that we then
114
+ // redirect.
115
+ const resolved = options.defaultResolver(request, options);
116
+ if (!version) {
117
+ return resolved;
118
+ }
119
+ printBannerOnce();
120
+ const legacy = legacyArtifactPath(resolved);
121
+ if (!legacy) {
122
+ return resolved;
123
+ }
124
+ if (!fs.existsSync(legacy)) {
125
+ throw new Error(
126
+ `[legacy-contracts] artifact ${path.basename(legacy)} not present in legacy cache @${version}; ` +
127
+ `the contract may have been added after that release. Pin a newer CONTRACT_ARTIFACTS_VERSION or skip this test.`,
128
+ );
129
+ }
130
+ if (!seen.has(resolved)) {
131
+ seen.add(resolved);
132
+ process.stderr.write(`[legacy-contracts][jest] redirected ${path.basename(legacy)} -> ${legacy}\n`);
133
+ }
134
+ return legacy;
135
+ };
@@ -1,19 +1,8 @@
1
1
  import { createLogger } from '@aztec/aztec.js/log';
2
2
 
3
- import { afterAll, afterEach, beforeEach, expect } from '@jest/globals';
4
- import { readlinkSync } from 'fs';
3
+ import { beforeEach, expect } from '@jest/globals';
5
4
  import { basename } from 'path';
6
5
 
7
- import { EluMonitor } from '../fixtures/elu_monitor.js';
8
-
9
- const eluMonitor = process.env.ELU_MONITOR_FILE
10
- ? new EluMonitor(process.env.ELU_MONITOR_FILE, Number(process.env.ELU_MONITOR_INTERVAL_MS) || undefined)
11
- : undefined;
12
-
13
- if (eluMonitor) {
14
- process.on('exit', () => eluMonitor.stop());
15
- }
16
-
17
6
  beforeEach(() => {
18
7
  const { testPath, currentTestName } = expect.getState();
19
8
  if (!testPath || !currentTestName) {
@@ -21,43 +10,4 @@ beforeEach(() => {
21
10
  }
22
11
  const logger = createLogger(`e2e:${basename(testPath).replace('.test.ts', '')}`);
23
12
  logger.info(`Running test: ${currentTestName}`);
24
- eluMonitor?.startTest(currentTestName);
25
- });
26
-
27
- afterEach(() => {
28
- eluMonitor?.stopTest();
29
- });
30
-
31
- // Log leaked handles after all tests complete. This runs after test-level afterAll hooks,
32
- // so any handles still alive at this point were not properly cleaned up during teardown.
33
- // This diagnostic helps identify the source of exit hangs without masking them.
34
- afterAll(() => {
35
- const handles = (process as any)._getActiveHandles();
36
- if (handles.length > 0) {
37
- const details = handles.map((h: any) => {
38
- const type = h?.constructor?.name ?? typeof h;
39
- const fd = h?.fd ?? h?._handle?.fd ?? '?';
40
- const destroyed = h?.destroyed ?? '?';
41
- const hasRef = typeof h?.hasRef === 'function' ? h.hasRef() : '?';
42
- const localAddr = h?.localAddress ?? '';
43
- const remoteAddr = h?.remoteAddress ?? '';
44
- const localPort = h?.localPort ?? '';
45
- const remotePort = h?.remotePort ?? '';
46
- const proto = Object.getPrototypeOf(h)?.constructor?.name ?? '?';
47
- const keys = Object.keys(h).slice(0, 10).join(',');
48
- let fdTarget = '';
49
- if (typeof fd === 'number') {
50
- try {
51
- fdTarget = ` -> ${readlinkSync(`/proc/self/fd/${fd}`)}`;
52
- } catch {
53
- // ignore
54
- }
55
- }
56
- return ` ${type}(fd=${fd}, destroyed=${destroyed}, hasRef=${hasRef}${fdTarget}) proto=${proto} addr=${localAddr}:${localPort}->${remoteAddr}:${remotePort} keys=[${keys}]`;
57
- });
58
- process.stderr.write(
59
- `\n[jest_setup] WARNING: ${handles.length} handle(s) still active after teardown:\n${details.join('\n')}\n` +
60
- `These may prevent Jest from exiting. Investigate and fix the leak.\n\n`,
61
- );
62
- }
63
13
  });
@@ -19,7 +19,10 @@ export const submitTxsTo = async (
19
19
  times(numTxs, async () => {
20
20
  const accountManager = await wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random());
21
21
  const deployMethod = await accountManager.getDeployMethod();
22
- const { txHash } = await deployMethod.send({ from: submitter, wait: NO_WAIT });
22
+ const { txHash } = await deployMethod.send({
23
+ from: submitter,
24
+ wait: NO_WAIT,
25
+ });
23
26
 
24
27
  logger.info(`Tx sent with hash ${txHash}`);
25
28
  const receipt: TxReceipt = await wallet.getTxReceipt(txHash);
@@ -94,7 +94,9 @@ export class LendingSimulator {
94
94
 
95
95
  async prepare() {
96
96
  this.accumulator = BASE;
97
- const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()) + BigInt(this.ethereumSlotDuration));
97
+ const slot = await this.rollup.getSlotAt(
98
+ BigInt(await this.cc.eth.lastBlockTimestamp()) + BigInt(this.ethereumSlotDuration),
99
+ );
98
100
  this.time = Number(await this.rollup.getTimestampForSlot(slot));
99
101
  }
100
102
 
@@ -103,7 +105,7 @@ export class LendingSimulator {
103
105
  return;
104
106
  }
105
107
 
106
- const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()));
108
+ const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.lastBlockTimestamp()));
107
109
  const targetSlot = SlotNumber(slot + diff);
108
110
  const ts = Number(await this.rollup.getTimestampForSlot(targetSlot));
109
111
  const timeDiff = ts - this.time;
@@ -110,7 +110,7 @@ export class TokenSimulator {
110
110
  chunk(calls, 5).map(batch => new BatchCall(this.defaultWallet, batch).simulate({ from: this.defaultAddress })),
111
111
  )
112
112
  )
113
- .flatMap(r => r.result)
113
+ .flat()
114
114
  .map(r => r.result);
115
115
  expect(results[0]).toEqual(this.totalSupply);
116
116
 
@@ -1,4 +1,5 @@
1
1
  import { generateSchnorrAccounts } from '@aztec/accounts/testing';
2
+ import { NO_FROM } from '@aztec/aztec.js/account';
2
3
  import { AztecAddress } from '@aztec/aztec.js/addresses';
3
4
  import { NO_WAIT } from '@aztec/aztec.js/contracts';
4
5
  import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
@@ -89,7 +90,7 @@ export async function deploySponsoredTestAccountsWithTokens(
89
90
  const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
90
91
  const recipientDeployMethod = await recipientAccount.getDeployMethod();
91
92
  await recipientDeployMethod.send({
92
- from: AztecAddress.ZERO,
93
+ from: NO_FROM,
93
94
  fee: { paymentMethod },
94
95
  wait: { timeout: 2400 },
95
96
  });
@@ -97,7 +98,7 @@ export async function deploySponsoredTestAccountsWithTokens(
97
98
  fundedAccounts.map(async a => {
98
99
  const deployMethod = await a.getDeployMethod();
99
100
  await deployMethod.send({
100
- from: AztecAddress.ZERO,
101
+ from: NO_FROM,
101
102
  fee: { paymentMethod },
102
103
  wait: { timeout: 2400 },
103
104
  }); // increase timeout on purpose in order to account for two empty epochs
@@ -141,12 +142,12 @@ async function deployAccountWithDiagnostics(
141
142
  try {
142
143
  let gasSettings;
143
144
  if (estimateGas) {
144
- const sim = await deployMethod.simulate({ from: AztecAddress.ZERO, fee: { paymentMethod } });
145
+ const sim = await deployMethod.simulate({ from: NO_FROM, fee: { paymentMethod } });
145
146
  gasSettings = sim.estimatedGas;
146
147
  logger.info(`${accountLabel} estimated gas: DA=${gasSettings.gasLimits.daGas} L2=${gasSettings.gasLimits.l2Gas}`);
147
148
  }
148
149
  const deployResult = await deployMethod.send({
149
- from: AztecAddress.ZERO,
150
+ from: NO_FROM,
150
151
  fee: { paymentMethod, gasSettings },
151
152
  wait: NO_WAIT,
152
153
  });
@@ -269,7 +270,7 @@ export async function deployTestAccountsWithTokens(
269
270
  fundedAccounts.map(async (a, i) => {
270
271
  const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.address, claims[i]);
271
272
  const deployMethod = await a.getDeployMethod();
272
- await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod } });
273
+ await deployMethod.send({ from: NO_FROM, fee: { paymentMethod } });
273
274
  logger.info(`Account deployed at ${a.address}`);
274
275
  }),
275
276
  );
@@ -296,7 +296,7 @@ export class TxInclusionMetrics {
296
296
  value: stats.mean,
297
297
  },
298
298
  {
299
- name: `${group}/p50_inclusion`,
299
+ name: `${group}/median_inclusion`,
300
300
  unit: 's',
301
301
  value: stats.median,
302
302
  },
@@ -8,7 +8,6 @@ const logger = createLogger('e2e:k8s-utils');
8
8
  const testConfigSchema = z.object({
9
9
  NAMESPACE: z.string().default('scenario'),
10
10
  REAL_VERIFIER: schemas.Boolean.optional().default(true),
11
- DEBUG_FORCE_TX_PROOF_VERIFICATION: schemas.Boolean.optional().default(true),
12
11
  CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
13
12
  L1_RPC_URLS_JSON: z.string().optional(),
14
13
  L1_ACCOUNT_MNEMONIC: z.string().optional(),
@@ -17,7 +16,6 @@ const testConfigSchema = z.object({
17
16
  AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5),
18
17
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: z.coerce.number().optional().default(2),
19
18
  FUNDING_PRIVATE_KEY: z.string().optional(),
20
- AZTEC_ADMIN_API_KEY: z.string().optional(),
21
19
  });
22
20
 
23
21
  export type TestConfig = z.infer<typeof testConfigSchema>;
@@ -66,6 +66,3 @@ export { getPublicViemClient, getL1DeploymentAddresses, getNodeClient } from './
66
66
 
67
67
  // Health checks
68
68
  export { ChainHealth, type ChainHealthSnapshot } from './health.js';
69
-
70
- // Pod log extraction
71
- export { type BlockBuiltLogEntry, fetchBlockBuiltLogs } from './pod_logs.js';
@@ -173,7 +173,7 @@ export async function withSequencersAdmin<T>(env: TestConfig, fn: (node: AztecNo
173
173
  if (statusRes.status !== 200) {
174
174
  throw new Error(`Admin endpoint returned status ${statusRes.status}`);
175
175
  }
176
- const client = createAztecNodeAdminClient(url, {}, undefined, env.AZTEC_ADMIN_API_KEY);
176
+ const client = createAztecNodeAdminClient(url);
177
177
  return { result: await fn(client), process };
178
178
  } catch (err) {
179
179
  // Kill the port-forward before retrying
@@ -255,18 +255,21 @@ export async function initHADb(namespace: string): Promise<void> {
255
255
  }
256
256
 
257
257
  /**
258
- * Sets probabilistic transaction dropping on validators and waits for rollout.
259
- * Use probability=0 to disable. Wired to env var P2P_DROP_TX_CHANCE via Helm values.
258
+ * Enables or disables probabilistic transaction dropping on validators and waits for rollout.
259
+ * Wired to env vars P2P_DROP_TX and P2P_DROP_TX_CHANCE via Helm values.
260
260
  */
261
261
  export async function setValidatorTxDrop({
262
262
  namespace,
263
+ enabled,
263
264
  probability,
264
265
  logger: log,
265
266
  }: {
266
267
  namespace: string;
268
+ enabled: boolean;
267
269
  probability: number;
268
270
  logger: Logger;
269
271
  }) {
272
+ const drop = enabled ? 'true' : 'false';
270
273
  const prob = String(probability);
271
274
 
272
275
  const selectors = ['app.kubernetes.io/name=validator', 'app.kubernetes.io/component=validator', 'app=validator'];
@@ -281,7 +284,7 @@ export async function setValidatorTxDrop({
281
284
  if (names.length === 0) {
282
285
  continue;
283
286
  }
284
- const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace} P2P_DROP_TX_CHANCE=${prob}`;
287
+ const cmd = `kubectl set env statefulset -l ${selector} -n ${namespace} P2P_DROP_TX=${drop} P2P_DROP_TX_CHANCE=${prob}`;
285
288
  log.info(`command: ${cmd}`);
286
289
  await execAsync(cmd);
287
290
  updated = true;
@@ -363,24 +366,16 @@ export async function enableValidatorDynamicBootNode(
363
366
  */
364
367
  export async function rollAztecPods(namespace: string, clearState: boolean = false) {
365
368
  // Pod components use 'validator', but StatefulSets and PVCs use 'sequencer-node' for validators
366
- // RPC nodes have nodeType='rpc-node' in Helm values, so their component label is 'rpc-node' (not 'rpc')
367
369
  const podComponents = [
368
370
  'p2p-bootstrap',
369
371
  'prover-node',
370
372
  'prover-broker',
371
373
  'prover-agent',
372
374
  'sequencer-node',
373
- 'rpc-node',
374
- 'validator-ha-db',
375
- ];
376
- const pvcComponents = [
377
- 'p2p-bootstrap',
378
- 'prover-node',
379
- 'prover-broker',
380
- 'sequencer-node',
381
- 'rpc-node',
375
+ 'rpc',
382
376
  'validator-ha-db',
383
377
  ];
378
+ const pvcComponents = ['p2p-bootstrap', 'prover-node', 'prover-broker', 'sequencer-node', 'rpc', 'validator-ha-db'];
384
379
  // StatefulSet components that need to be scaled down before PVC deletion
385
380
  // Note: validators use 'sequencer-node' as component label, not 'validator'
386
381
  const statefulSetComponents = [
@@ -388,7 +383,7 @@ export async function rollAztecPods(namespace: string, clearState: boolean = fal
388
383
  'prover-node',
389
384
  'prover-broker',
390
385
  'sequencer-node',
391
- 'rpc-node',
386
+ 'rpc',
392
387
  'validator-ha-db',
393
388
  ];
394
389