@aztec/cli 0.0.1-commit.9ef841308 → 0.0.1-commit.a4600f49

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 (67) hide show
  1. package/dest/cmds/aztec_node/block_number.js +1 -1
  2. package/dest/cmds/aztec_node/get_logs.d.ts +30 -4
  3. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
  4. package/dest/cmds/aztec_node/get_logs.js +39 -29
  5. package/dest/cmds/aztec_node/get_node_info.d.ts +1 -1
  6. package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -1
  7. package/dest/cmds/aztec_node/get_node_info.js +0 -2
  8. package/dest/cmds/aztec_node/index.d.ts +1 -1
  9. package/dest/cmds/aztec_node/index.d.ts.map +1 -1
  10. package/dest/cmds/aztec_node/index.js +13 -3
  11. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  12. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  13. package/dest/cmds/infrastructure/setup_l2_contract.js +10 -6
  14. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +1 -1
  15. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -1
  16. package/dest/cmds/l1/deploy_l1_contracts_cmd.js +0 -1
  17. package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
  18. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  19. package/dest/cmds/l1/deploy_new_rollup.js +2 -4
  20. package/dest/cmds/l1/update_l1_validators.d.ts +1 -1
  21. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  22. package/dest/cmds/l1/update_l1_validators.js +0 -1
  23. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts +2 -0
  24. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts.map +1 -0
  25. package/dest/cmds/validator_keys/eth_json_v3_worker.js +27 -0
  26. package/dest/cmds/validator_keys/index.d.ts +1 -1
  27. package/dest/cmds/validator_keys/index.d.ts.map +1 -1
  28. package/dest/cmds/validator_keys/index.js +2 -1
  29. package/dest/cmds/validator_keys/new.d.ts +6 -1
  30. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  31. package/dest/cmds/validator_keys/new.js +78 -8
  32. package/dest/cmds/validator_keys/shared.d.ts +1 -1
  33. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  34. package/dest/cmds/validator_keys/shared.js +66 -23
  35. package/dest/config/chain_l2_config.d.ts +7 -2
  36. package/dest/config/chain_l2_config.d.ts.map +1 -1
  37. package/dest/config/chain_l2_config.js +14 -1
  38. package/dest/config/generated/networks.d.ts +61 -43
  39. package/dest/config/generated/networks.d.ts.map +1 -1
  40. package/dest/config/generated/networks.js +60 -42
  41. package/dest/utils/aztec.d.ts +1 -2
  42. package/dest/utils/aztec.d.ts.map +1 -1
  43. package/dest/utils/aztec.js +2 -3
  44. package/dest/utils/commands.d.ts +14 -6
  45. package/dest/utils/commands.d.ts.map +1 -1
  46. package/dest/utils/commands.js +21 -11
  47. package/dest/utils/inspect.d.ts +1 -1
  48. package/dest/utils/inspect.d.ts.map +1 -1
  49. package/dest/utils/inspect.js +11 -11
  50. package/package.json +30 -30
  51. package/src/cmds/aztec_node/block_number.ts +1 -1
  52. package/src/cmds/aztec_node/get_logs.ts +70 -38
  53. package/src/cmds/aztec_node/get_node_info.ts +0 -2
  54. package/src/cmds/aztec_node/index.ts +13 -8
  55. package/src/cmds/infrastructure/setup_l2_contract.ts +9 -5
  56. package/src/cmds/l1/deploy_l1_contracts_cmd.ts +0 -1
  57. package/src/cmds/l1/deploy_new_rollup.ts +1 -3
  58. package/src/cmds/l1/update_l1_validators.ts +0 -1
  59. package/src/cmds/validator_keys/eth_json_v3_worker.ts +30 -0
  60. package/src/cmds/validator_keys/index.ts +18 -4
  61. package/src/cmds/validator_keys/new.ts +107 -8
  62. package/src/cmds/validator_keys/shared.ts +86 -34
  63. package/src/config/chain_l2_config.ts +14 -1
  64. package/src/config/generated/networks.ts +60 -42
  65. package/src/utils/aztec.ts +12 -18
  66. package/src/utils/commands.ts +24 -11
  67. package/src/utils/inspect.ts +7 -8
@@ -1,4 +1,5 @@
1
1
  import { prettyPrintJSON } from '@aztec/cli/utils';
2
+ import { asyncPool } from '@aztec/foundation/async-pool';
2
3
  import { deriveBlsPrivateKey } from '@aztec/foundation/crypto/bls';
3
4
  import { createBn254Keystore } from '@aztec/foundation/crypto/bls/bn254_keystore';
4
5
  import { computeBn254G1PublicKeyCompressed } from '@aztec/foundation/crypto/bn254';
@@ -10,12 +11,60 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
10
11
  import { Wallet } from '@ethersproject/wallet';
11
12
  import { constants as fsConstants, mkdirSync } from 'fs';
12
13
  import { access, writeFile } from 'fs/promises';
13
- import { homedir } from 'os';
14
+ import { availableParallelism, homedir } from 'os';
14
15
  import { dirname, isAbsolute, join } from 'path';
15
16
  import { mnemonicToAccount } from 'viem/accounts';
17
+ import { Worker } from 'worker_threads';
16
18
 
17
19
  import { defaultBlsPath } from './utils.js';
18
20
 
21
+ type EthJsonV3WorkerResult = { json: string } | { error: { message: string; name?: string; stack?: string } };
22
+
23
+ // ethers' default scrypt parameters use substantial memory, so keep worker fan-out bounded.
24
+ const maxEthKeystoreWorkers = Math.max(1, Math.min(4, availableParallelism()));
25
+
26
+ function deserializeWorkerError(error: { message: string; name?: string; stack?: string }) {
27
+ const result = new Error(error.message);
28
+ result.name = error.name ?? result.name;
29
+ result.stack = error.stack;
30
+ return result;
31
+ }
32
+
33
+ function encryptEthJsonV3InWorker(privateKeyHex: string, password: string): Promise<string> {
34
+ return new Promise<string>((resolve, reject) => {
35
+ const worker = new Worker(new URL('./eth_json_v3_worker.js', import.meta.url), {
36
+ workerData: { privateKeyHex, password },
37
+ });
38
+ let settled = false;
39
+
40
+ worker.once('message', (result: EthJsonV3WorkerResult) => {
41
+ settled = true;
42
+
43
+ if ('json' in result) {
44
+ resolve(result.json);
45
+ } else {
46
+ reject(deserializeWorkerError(result.error));
47
+ }
48
+ });
49
+ worker.once('error', error => {
50
+ settled = true;
51
+ reject(error);
52
+ });
53
+ worker.once('exit', code => {
54
+ if (!settled) {
55
+ reject(new Error(`ETH JSON V3 worker stopped with exit code ${code}`));
56
+ }
57
+ });
58
+ });
59
+ }
60
+
61
+ async function encryptEthJsonV3(privateKeyHex: string, password: string): Promise<string> {
62
+ if (process.env.JEST_WORKER_ID !== undefined) {
63
+ return await new Wallet(privateKeyHex).encrypt(password);
64
+ }
65
+ return await encryptEthJsonV3InWorker(privateKeyHex, password);
66
+ }
67
+
19
68
  export type ValidatorSummary = { attesterEth?: string; attesterBls?: string; publisherEth?: string[] };
20
69
 
21
70
  export type BuildValidatorsInput = {
@@ -228,7 +277,7 @@ export async function writeBn254BlsKeystore(
228
277
  ): Promise<string> {
229
278
  mkdirSync(outDir, { recursive: true });
230
279
 
231
- const keystore = createBn254Keystore(password, privateKeyHex, pubkeyHex, derivationPath);
280
+ const keystore = await createBn254Keystore(password, privateKeyHex, pubkeyHex, derivationPath);
232
281
 
233
282
  const safeBase = fileNameBase.replace(/[^a-zA-Z0-9_-]/g, '_');
234
283
  const outPath = join(outDir, `keystore-${safeBase}.json`);
@@ -241,28 +290,29 @@ export async function writeBlsBn254ToFile(
241
290
  validators: ValidatorKeyStore[],
242
291
  options: { outDir: string; password: string; blsPath?: string },
243
292
  ): Promise<void> {
244
- for (let i = 0; i < validators.length; i++) {
245
- const v = validators[i];
246
- if (!v || typeof v !== 'object' || !('attester' in v)) {
247
- continue;
248
- }
249
- const att = (v as any).attester;
293
+ await Promise.all(
294
+ validators.map(async (v, i) => {
295
+ if (!v || typeof v !== 'object' || !('attester' in v)) {
296
+ return;
297
+ }
298
+ const att = (v as any).attester;
250
299
 
251
- // Shapes: { bls: <hex> } or { eth: <ethAccount>, bls?: <hex> } or plain EthAccount
252
- const blsKey: string | undefined = typeof att === 'object' && 'bls' in att ? (att as any).bls : undefined;
253
- if (!blsKey || typeof blsKey !== 'string') {
254
- continue;
255
- }
300
+ // Shapes: { bls: <hex> } or { eth: <ethAccount>, bls?: <hex> } or plain EthAccount
301
+ const blsKey: string | undefined = typeof att === 'object' && 'bls' in att ? (att as any).bls : undefined;
302
+ if (!blsKey || typeof blsKey !== 'string') {
303
+ return;
304
+ }
256
305
 
257
- const pub = await computeBlsPublicKeyCompressed(blsKey);
258
- const path = options.blsPath ?? defaultBlsPath;
259
- const fileBase = `${String(i + 1)}_${pub.slice(2, 18)}`;
260
- const keystorePath = await writeBn254BlsKeystore(options.outDir, fileBase, options.password, blsKey, pub, path);
306
+ const pub = await computeBlsPublicKeyCompressed(blsKey);
307
+ const path = options.blsPath ?? defaultBlsPath;
308
+ const fileBase = `${String(i + 1)}_${pub.slice(2, 18)}`;
309
+ const keystorePath = await writeBn254BlsKeystore(options.outDir, fileBase, options.password, blsKey, pub, path);
261
310
 
262
- if (typeof att === 'object') {
263
- (att as any).bls = { path: keystorePath, password: options.password };
264
- }
265
- }
311
+ if (typeof att === 'object') {
312
+ (att as any).bls = { path: keystorePath, password: options.password };
313
+ }
314
+ }),
315
+ );
266
316
  }
267
317
 
268
318
  /** Writes an Ethereum JSON V3 keystore using ethers, returns absolute path */
@@ -274,8 +324,7 @@ export async function writeEthJsonV3Keystore(
274
324
  ): Promise<string> {
275
325
  const safeBase = fileNameBase.replace(/[^a-zA-Z0-9_-]/g, '_');
276
326
  mkdirSync(outDir, { recursive: true });
277
- const wallet = new Wallet(privateKeyHex);
278
- const json = await wallet.encrypt(password);
327
+ const json = await encryptEthJsonV3(privateKeyHex, password);
279
328
  const outPath = join(outDir, `keystore-eth-${safeBase}.json`);
280
329
  await writeFile(outPath, json, { encoding: 'utf-8' });
281
330
  return outPath;
@@ -286,13 +335,16 @@ export async function writeEthJsonV3ToFile(
286
335
  validators: ValidatorKeyStore[],
287
336
  options: { outDir: string; password: string },
288
337
  ): Promise<void> {
289
- const maybeEncryptEth = async (account: any, label: string) => {
338
+ const tasks: (() => Promise<void>)[] = [];
339
+
340
+ const maybeQueueEncryptEth = (account: any, label: string, setEncryptedAccount: (account: any) => void) => {
290
341
  if (typeof account === 'string' && account.startsWith('0x') && account.length === 66) {
291
- const fileBase = `${label}_${account.slice(2, 10)}`;
292
- const p = await writeEthJsonV3Keystore(options.outDir, fileBase, options.password, account);
293
- return { path: p, password: options.password };
342
+ tasks.push(async () => {
343
+ const fileBase = `${label}_${account.slice(2, 10)}`;
344
+ const path = await writeEthJsonV3Keystore(options.outDir, fileBase, options.password, account);
345
+ setEncryptedAccount({ path, password: options.password });
346
+ });
294
347
  }
295
- return account;
296
348
  };
297
349
 
298
350
  for (let i = 0; i < validators.length; i++) {
@@ -304,23 +356,23 @@ export async function writeEthJsonV3ToFile(
304
356
  // attester may be string (eth), object with eth, or remote signer
305
357
  const att = (v as any).attester;
306
358
  if (typeof att === 'string') {
307
- (v as any).attester = await maybeEncryptEth(att, `attester_${i + 1}`);
359
+ maybeQueueEncryptEth(att, `attester_${i + 1}`, account => ((v as any).attester = account));
308
360
  } else if (att && typeof att === 'object' && 'eth' in att) {
309
- (att as any).eth = await maybeEncryptEth((att as any).eth, `attester_${i + 1}`);
361
+ maybeQueueEncryptEth((att as any).eth, `attester_${i + 1}`, account => ((att as any).eth = account));
310
362
  }
311
363
 
312
364
  // publisher can be single or array
313
365
  if ('publisher' in v) {
314
366
  const pub = (v as any).publisher;
315
367
  if (Array.isArray(pub)) {
316
- const out: any[] = [];
317
368
  for (let j = 0; j < pub.length; j++) {
318
- out.push(await maybeEncryptEth(pub[j], `publisher_${i + 1}_${j + 1}`));
369
+ maybeQueueEncryptEth(pub[j], `publisher_${i + 1}_${j + 1}`, account => (pub[j] = account));
319
370
  }
320
- (v as any).publisher = out;
321
371
  } else if (pub !== undefined) {
322
- (v as any).publisher = await maybeEncryptEth(pub, `publisher_${i + 1}`);
372
+ maybeQueueEncryptEth(pub, `publisher_${i + 1}`, account => ((v as any).publisher = account));
323
373
  }
324
374
  }
325
375
  }
376
+
377
+ await asyncPool(maxEthKeystoreWorkers, tasks, task => task());
326
378
  }
@@ -1,4 +1,6 @@
1
1
  import type { NetworkNames } from '@aztec/foundation/config';
2
+ import { createLogger } from '@aztec/foundation/log';
3
+ import { type ConsensusEnvVar, checkConsensusEnvOverrides } from '@aztec/stdlib/config';
2
4
 
3
5
  import path from 'path';
4
6
 
@@ -12,6 +14,12 @@ const NetworkConfigs: Partial<Record<NetworkNames, NetworkConfigEnv>> = {
12
14
  mainnet: mainnetConfig,
13
15
  };
14
16
 
17
+ /** Every generated network config must define every consensus-critical env var. */
18
+ export type ConsensusComplete = Record<ConsensusEnvVar, string | number | boolean>;
19
+ ({ devnetConfig, testnetConfig, mainnetConfig }) satisfies Record<string, ConsensusComplete>;
20
+
21
+ const log = createLogger('cli:chain_l2_config');
22
+
15
23
  function enrichEnvironmentWithNetworkConfig(config: NetworkConfigEnv): void {
16
24
  for (const [key, value] of Object.entries(config)) {
17
25
  if (process.env[key] === undefined && value !== undefined) {
@@ -31,7 +39,9 @@ function getDefaultDataDir(networkName: NetworkNames): string {
31
39
  * and DefaultSlasherConfig (which match the 'defaults' section of defaults.yml).
32
40
  *
33
41
  * For deployed networks: applies network configuration from generated defaults.yml,
34
- * merging base defaults with network-specific overrides.
42
+ * merging base defaults with network-specific overrides. Before merging, enforces that operators have not
43
+ * overridden any consensus-critical env var with a value diverging from the network config (throwing unless
44
+ * ALLOW_OVERRIDING_NETWORK_CONFIG is set), so all nodes of a network agree on consensus-critical values.
35
45
  *
36
46
  * @param networkName - The network name
37
47
  */
@@ -49,6 +59,9 @@ export function enrichEnvironmentWithChainName(networkName: NetworkNames) {
49
59
  const configKey = /^v\d+-devnet-\d+$/.test(networkName) ? 'devnet' : networkName;
50
60
  const generatedConfig = NetworkConfigs[configKey];
51
61
  if (generatedConfig) {
62
+ // The check is pure; this layer owns env mutation, so apply its canonical writes before enriching.
63
+ const canonical = checkConsensusEnvOverrides(generatedConfig, process.env, msg => log.warn(msg));
64
+ Object.assign(process.env, canonical);
52
65
  enrichEnvironmentWithNetworkConfig(generatedConfig);
53
66
  }
54
67
 
@@ -3,18 +3,16 @@
3
3
 
4
4
  export const devnetConfig = {
5
5
  ETHEREUM_SLOT_DURATION: 12,
6
- AZTEC_SLOT_DURATION: 72,
7
- AZTEC_TARGET_COMMITTEE_SIZE: 48,
8
6
  AZTEC_ACTIVATION_THRESHOLD: 100000000000000000000,
9
7
  AZTEC_EJECTION_THRESHOLD: 50000000000000000000,
10
8
  AZTEC_LOCAL_EJECTION_THRESHOLD: 98000000000000000000,
11
9
  AZTEC_EXIT_DELAY_SECONDS: 172800,
12
- AZTEC_INBOX_LAG: 1,
10
+ AZTEC_INBOX_LAG: 2,
13
11
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
14
12
  AZTEC_MANA_TARGET: 100000000,
15
13
  AZTEC_PROVING_COST_PER_MANA: 100,
16
14
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
17
- AZTEC_SLASHER_FLAVOR: 'tally',
15
+ AZTEC_SLASHER_ENABLED: true,
18
16
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
19
17
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
20
18
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
@@ -24,17 +22,21 @@ export const devnetConfig = {
24
22
  AZTEC_SLASH_AMOUNT_MEDIUM: 20000000000000000000,
25
23
  AZTEC_SLASH_AMOUNT_LARGE: 50000000000000000000,
26
24
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 300,
27
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
28
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
25
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 0,
26
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 0,
27
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 48,
28
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 2,
29
+ AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 48,
29
30
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
30
31
  SLASH_MAX_PAYLOAD_SIZE: 80,
31
32
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
33
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
32
34
  P2P_ENABLED: true,
33
35
  BOOTSTRAP_NODES: '',
34
36
  SEQ_MIN_TX_PER_BLOCK: 1,
35
37
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
36
38
  SEQ_BLOCK_DURATION_MS: 6000,
37
- SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
39
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
38
40
  DATA_STORE_MAP_SIZE_KB: 134217728,
39
41
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
40
42
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -42,10 +44,16 @@ export const devnetConfig = {
42
44
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
43
45
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
44
46
  SENTINEL_ENABLED: true,
47
+ OFFENSE_COLLECTION_ENABLED: true,
48
+ AZTEC_SLOT_DURATION: 36,
45
49
  AZTEC_EPOCH_DURATION: 8,
46
50
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 1,
47
51
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 1,
52
+ AZTEC_TARGET_COMMITTEE_SIZE: 1,
53
+ MAX_BLOCKS_PER_CHECKPOINT: 4,
48
54
  AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 1,
55
+ AZTEC_SLASHING_QUORUM: 17,
56
+ AZTEC_GOVERNANCE_PROPOSER_QUORUM: 151,
49
57
  L1_CHAIN_ID: 11155111,
50
58
  TEST_ACCOUNTS: true,
51
59
  SPONSORED_FPC: true,
@@ -61,7 +69,6 @@ export const devnetConfig = {
61
69
  PUBLIC_OTEL_OPT_OUT: true,
62
70
  PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
63
71
  PUBLIC_OTEL_COLLECT_FROM: '',
64
- SLASH_PRUNE_PENALTY: 10000000000000000000,
65
72
  SLASH_DATA_WITHHOLDING_PENALTY: 10000000000000000000,
66
73
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.9,
67
74
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
@@ -69,11 +76,13 @@ export const devnetConfig = {
69
76
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
70
77
  SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
71
78
  SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
72
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
79
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
80
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10000000000000000000,
73
81
  SLASH_UNKNOWN_PENALTY: 10000000000000000000,
74
82
  SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
83
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
75
84
  SLASH_GRACE_PERIOD_L2_SLOTS: 0,
76
- ENABLE_VERSION_CHECK: true,
85
+ ENABLE_AUTO_SHUTDOWN: false,
77
86
  } as const;
78
87
 
79
88
  export const testnetConfig = {
@@ -83,25 +92,30 @@ export const testnetConfig = {
83
92
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 2,
84
93
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 2,
85
94
  AZTEC_EXIT_DELAY_SECONDS: 172800,
86
- AZTEC_INBOX_LAG: 1,
95
+ AZTEC_INBOX_LAG: 2,
87
96
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
88
97
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
89
- AZTEC_SLASHER_FLAVOR: 'tally',
98
+ AZTEC_SLASHER_ENABLED: true,
90
99
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
91
100
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
92
101
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
93
102
  AZTEC_SLASHING_DISABLE_DURATION: 432000,
94
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
95
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
103
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 0,
104
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 0,
105
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 48,
106
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 2,
107
+ AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 48,
96
108
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
97
109
  SLASH_MAX_PAYLOAD_SIZE: 80,
98
110
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
111
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
99
112
  P2P_ENABLED: true,
100
113
  BOOTSTRAP_NODES: '',
101
114
  SEQ_MIN_TX_PER_BLOCK: 1,
102
115
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
103
116
  SEQ_BLOCK_DURATION_MS: 6000,
104
- SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
117
+ MAX_BLOCKS_PER_CHECKPOINT: 10,
118
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
105
119
  DATA_STORE_MAP_SIZE_KB: 134217728,
106
120
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
107
121
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -109,6 +123,7 @@ export const testnetConfig = {
109
123
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
110
124
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
111
125
  SENTINEL_ENABLED: true,
126
+ OFFENSE_COLLECTION_ENABLED: true,
112
127
  AZTEC_SLOT_DURATION: 72,
113
128
  AZTEC_ACTIVATION_THRESHOLD: 2E+23,
114
129
  AZTEC_EJECTION_THRESHOLD: 1E+23,
@@ -119,10 +134,10 @@ export const testnetConfig = {
119
134
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 100,
120
135
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 60,
121
136
  AZTEC_MANA_TARGET: 75000000,
122
- AZTEC_PROVING_COST_PER_MANA: 25000000,
137
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
123
138
  AZTEC_SLASH_AMOUNT_SMALL: 1E+23,
124
- AZTEC_SLASH_AMOUNT_MEDIUM: 1E+23,
125
- AZTEC_SLASH_AMOUNT_LARGE: 1E+23,
139
+ AZTEC_SLASH_AMOUNT_MEDIUM: 2.5E+23,
140
+ AZTEC_SLASH_AMOUNT_LARGE: 2.5E+23,
126
141
  L1_CHAIN_ID: 11155111,
127
142
  TEST_ACCOUNTS: false,
128
143
  SPONSORED_FPC: false,
@@ -131,19 +146,20 @@ export const testnetConfig = {
131
146
  PROVER_REAL_PROOFS: true,
132
147
  P2P_MAX_PENDING_TX_COUNT: 1000,
133
148
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
134
- SLASH_PRUNE_PENALTY: 10000000000000000000,
135
- SLASH_DATA_WITHHOLDING_PENALTY: 10000000000000000000,
149
+ SLASH_DATA_WITHHOLDING_PENALTY: 0,
136
150
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.9,
137
151
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
138
- SLASH_INACTIVITY_PENALTY: 10000000000000000000,
139
- SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
140
- SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
141
- SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
142
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
143
- SLASH_UNKNOWN_PENALTY: 10000000000000000000,
144
- SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
152
+ SLASH_INACTIVITY_PENALTY: 1E+23,
153
+ SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 1E+23,
154
+ SLASH_DUPLICATE_PROPOSAL_PENALTY: 2.5E+23,
155
+ SLASH_DUPLICATE_ATTESTATION_PENALTY: 2.5E+23,
156
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 0,
157
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
158
+ SLASH_UNKNOWN_PENALTY: 1E+23,
159
+ SLASH_INVALID_BLOCK_PENALTY: 1E+23,
160
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 1E+23,
145
161
  SLASH_GRACE_PERIOD_L2_SLOTS: 64,
146
- ENABLE_VERSION_CHECK: true,
162
+ ENABLE_AUTO_SHUTDOWN: false,
147
163
  } as const;
148
164
 
149
165
  export const mainnetConfig = {
@@ -152,23 +168,23 @@ export const mainnetConfig = {
152
168
  AZTEC_TARGET_COMMITTEE_SIZE: 48,
153
169
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 2,
154
170
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 2,
155
- AZTEC_INBOX_LAG: 1,
171
+ AZTEC_INBOX_LAG: 2,
156
172
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
157
173
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
158
- AZTEC_SLASHER_FLAVOR: 'tally',
174
+ AZTEC_SLASHER_ENABLED: true,
159
175
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
160
176
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
161
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
162
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
163
177
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
164
178
  SLASH_MAX_PAYLOAD_SIZE: 80,
165
179
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
180
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
166
181
  P2P_ENABLED: true,
167
182
  BOOTSTRAP_NODES: '',
168
183
  SEQ_MIN_TX_PER_BLOCK: 1,
169
184
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
170
185
  SEQ_BLOCK_DURATION_MS: 6000,
171
- SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
186
+ MAX_BLOCKS_PER_CHECKPOINT: 10,
187
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
172
188
  DATA_STORE_MAP_SIZE_KB: 134217728,
173
189
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
174
190
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -176,13 +192,14 @@ export const mainnetConfig = {
176
192
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
177
193
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
178
194
  SENTINEL_ENABLED: true,
195
+ OFFENSE_COLLECTION_ENABLED: true,
179
196
  AZTEC_SLOT_DURATION: 72,
180
197
  AZTEC_ACTIVATION_THRESHOLD: 2E+23,
181
198
  AZTEC_EJECTION_THRESHOLD: 1E+23,
182
199
  AZTEC_LOCAL_EJECTION_THRESHOLD: 1.9E+23,
183
200
  AZTEC_SLASH_AMOUNT_SMALL: 2E+21,
184
- AZTEC_SLASH_AMOUNT_MEDIUM: 2E+21,
185
- AZTEC_SLASH_AMOUNT_LARGE: 2E+21,
201
+ AZTEC_SLASH_AMOUNT_MEDIUM: 5E+21,
202
+ AZTEC_SLASH_AMOUNT_LARGE: 5E+21,
186
203
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 34,
187
204
  AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 28,
188
205
  AZTEC_SLASHING_VETOER: '0xBbB4aF368d02827945748b28CD4b2D42e4A37480',
@@ -190,7 +207,7 @@ export const mainnetConfig = {
190
207
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 600,
191
208
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 1000,
192
209
  AZTEC_MANA_TARGET: 75000000,
193
- AZTEC_PROVING_COST_PER_MANA: 25000000,
210
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
194
211
  AZTEC_EXIT_DELAY_SECONDS: 345600,
195
212
  AZTEC_SLASHING_DISABLE_DURATION: 259200,
196
213
  AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 500,
@@ -209,18 +226,19 @@ export const mainnetConfig = {
209
226
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
210
227
  PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
211
228
  PUBLIC_OTEL_COLLECT_FROM: '',
212
- ENABLE_VERSION_CHECK: false,
213
- SLASH_PRUNE_PENALTY: 0,
229
+ ENABLE_AUTO_SHUTDOWN: false,
214
230
  SLASH_DATA_WITHHOLDING_PENALTY: 0,
215
231
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.8,
216
232
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2,
217
233
  SLASH_INACTIVITY_PENALTY: 2E+21,
218
234
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2E+21,
219
- SLASH_DUPLICATE_PROPOSAL_PENALTY: 2E+21,
220
- SLASH_DUPLICATE_ATTESTATION_PENALTY: 2E+21,
221
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2E+21,
235
+ SLASH_DUPLICATE_PROPOSAL_PENALTY: 5E+21,
236
+ SLASH_DUPLICATE_ATTESTATION_PENALTY: 5E+21,
237
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 0,
238
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
222
239
  SLASH_UNKNOWN_PENALTY: 2E+21,
223
240
  SLASH_INVALID_BLOCK_PENALTY: 2E+21,
224
- SLASH_GRACE_PERIOD_L2_SLOTS: 1200,
241
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 2E+21,
242
+ SLASH_GRACE_PERIOD_L2_SLOTS: 8400,
225
243
  } as const;
226
244
 
@@ -49,7 +49,7 @@ export async function deployNewRollupContracts(
49
49
  feeJuicePortalInitialBalance: bigint,
50
50
  config: L1ContractsConfig,
51
51
  realVerifier: boolean,
52
- ): Promise<{ rollup: RollupContract; slashFactoryAddress: EthAddress }> {
52
+ ): Promise<{ rollup: RollupContract }> {
53
53
  const { deployRollupForUpgrade } = await import('@aztec/ethereum/deploy-aztec-l1-contracts');
54
54
  const { mnemonicToAccount, privateKeyToAccount } = await import('viem/accounts');
55
55
  const { getVKTreeRoot } = await import('@aztec/noir-protocol-circuits-types/vk-tree');
@@ -80,23 +80,17 @@ export async function deployNewRollupContracts(
80
80
  logger.info('Initializing new rollup with old attesters', { initialValidators });
81
81
  }
82
82
 
83
- const { rollup, slashFactoryAddress } = await deployRollupForUpgrade(
84
- privateKey as Hex,
85
- rpcUrls[0],
86
- chainId,
87
- registryAddress,
88
- {
89
- vkTreeRoot: getVKTreeRoot(),
90
- protocolContractsHash,
91
- genesisArchiveRoot,
92
- initialValidators,
93
- feeJuicePortalInitialBalance,
94
- realVerifier,
95
- ...config,
96
- },
97
- );
98
-
99
- return { rollup, slashFactoryAddress: EthAddress.fromString(slashFactoryAddress!) };
83
+ const { rollup } = await deployRollupForUpgrade(privateKey as Hex, rpcUrls[0], chainId, registryAddress, {
84
+ vkTreeRoot: getVKTreeRoot(),
85
+ protocolContractsHash,
86
+ genesisArchiveRoot,
87
+ initialValidators,
88
+ feeJuicePortalInitialBalance,
89
+ realVerifier,
90
+ ...config,
91
+ });
92
+
93
+ return { rollup };
100
94
  }
101
95
 
102
96
  /**
@@ -5,13 +5,15 @@ import type { PXE } from '@aztec/pxe/server';
5
5
  import { FunctionSelector } from '@aztec/stdlib/abi/function-selector';
6
6
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import { PublicKeys } from '@aztec/stdlib/keys';
8
- import { LogId } from '@aztec/stdlib/logs/log-id';
8
+ import { LogCursor, Tag } from '@aztec/stdlib/logs';
9
9
  import { TxHash } from '@aztec/stdlib/tx/tx-hash';
10
10
 
11
11
  import { type Command, CommanderError, InvalidArgumentError, Option } from 'commander';
12
12
  import { lookup } from 'dns/promises';
13
13
  import { rename, writeFile } from 'fs/promises';
14
14
 
15
+ export { LogCursor };
16
+
15
17
  /**
16
18
  * If we can successfully resolve 'host.docker.internal', then we are running in a container, and we should treat
17
19
  * localhost as being host.docker.internal.
@@ -99,7 +101,7 @@ export async function getTxSender(pxe: PXE, _from?: string) {
99
101
  let from: AztecAddress;
100
102
  if (_from) {
101
103
  try {
102
- from = AztecAddress.fromString(_from);
104
+ from = AztecAddress.fromStringUnsafe(_from);
103
105
  } catch {
104
106
  throw new InvalidArgumentError(`Invalid option 'from' passed: ${_from}`);
105
107
  }
@@ -193,7 +195,7 @@ export function parseFieldFromHexString(str: string): Fr {
193
195
  */
194
196
  export function parseAztecAddress(address: string): AztecAddress {
195
197
  try {
196
- return AztecAddress.fromString(address);
198
+ return AztecAddress.fromStringUnsafe(address);
197
199
  } catch {
198
200
  throw new InvalidArgumentError(`Invalid Aztec address: ${address}`);
199
201
  }
@@ -227,16 +229,27 @@ export function parseOptionalAztecAddress(address: string): AztecAddress | undef
227
229
  }
228
230
 
229
231
  /**
230
- * Parses an optional log ID string into a LogId object.
231
- *
232
- * @param logId - The log ID string to parse.
233
- * @returns The parsed LogId object, or undefined if the log ID is missing or empty.
232
+ * Parses an optional `<blockNumber>-<txIndexWithinBlock>-<logIndexWithinTx>` triple into a {@link LogCursor},
233
+ * used as the `--after-log` argument of `get-logs` to resume pagination strictly after a previously-seen log.
234
+ * Thin wrapper over {@link LogCursor.parseOptional} that surfaces parse errors as commander's
235
+ * {@link InvalidArgumentError}.
234
236
  */
235
- export function parseOptionalLogId(logId: string): LogId | undefined {
236
- if (!logId) {
237
- return undefined;
237
+ export function parseOptionalLogCursor(value: string): LogCursor | undefined {
238
+ try {
239
+ return LogCursor.parseOptional(value);
240
+ } catch (err) {
241
+ throw new InvalidArgumentError(err instanceof Error ? err.message : String(err));
238
242
  }
239
- return LogId.fromString(logId);
243
+ }
244
+
245
+ /**
246
+ * Parses a log tag from a string. Tags are field-element values; we delegate to the {@link parseField} parser.
247
+ *
248
+ * @param tag - A hex string, integer, or boolean string representing the tag.
249
+ * @returns A {@link Tag} wrapping the parsed field.
250
+ */
251
+ export function parseTag(tag: string): Tag {
252
+ return new Tag(parseField(tag));
240
253
  }
241
254
 
242
255
  /**
@@ -9,14 +9,13 @@ export async function inspectBlock(
9
9
  log: LogFn,
10
10
  opts: { showTxs?: boolean } = {},
11
11
  ) {
12
- const block = await aztecNode.getBlock(blockNumber);
12
+ const block = await aztecNode.getBlock(blockNumber, { includeTransactions: opts.showTxs });
13
13
  if (!block) {
14
14
  log(`No block found for block number ${blockNumber}`);
15
15
  return;
16
16
  }
17
17
 
18
- const blockHash = await block.hash();
19
- log(`Block ${blockNumber} (${blockHash.toString()})`);
18
+ log(`Block ${blockNumber} (${block.hash.toString()})`);
20
19
  log(` Total fees: ${block.header.totalFees.toBigInt()}`);
21
20
  log(` Total mana used: ${block.header.totalManaUsed.toBigInt()}`);
22
21
  log(
@@ -25,12 +24,12 @@ export async function inspectBlock(
25
24
  log(` Coinbase: ${block.header.globalVariables.coinbase}`);
26
25
  log(` Fee recipient: ${block.header.globalVariables.feeRecipient}`);
27
26
  log(` Timestamp: ${new Date(Number(block.header.globalVariables.timestamp) * 500)}`);
28
- if (opts.showTxs) {
27
+ if (opts.showTxs && block.body) {
29
28
  log(``);
30
29
  for (const txHash of block.body.txEffects.map(tx => tx.txHash)) {
31
30
  await inspectTx(aztecNode, txHash, log, { includeBlockInfo: false });
32
31
  }
33
- } else {
32
+ } else if (block.body) {
34
33
  log(` Transactions: ${block.body.txEffects.length}`);
35
34
  }
36
35
  }
@@ -41,7 +40,7 @@ export async function inspectTx(
41
40
  log: LogFn,
42
41
  opts: { includeBlockInfo?: boolean } = {},
43
42
  ) {
44
- const [receipt, effectsInBlock] = await Promise.all([aztecNode.getTxReceipt(txHash), aztecNode.getTxEffect(txHash)]);
43
+ const receipt = await aztecNode.getTxReceipt(txHash, { includeTxEffect: true });
45
44
  // Base tx data
46
45
  log(`Tx ${txHash.toString()}`);
47
46
  log(` Status: ${receipt.status}`);
@@ -52,11 +51,11 @@ export async function inspectTx(
52
51
  log(` Error: ${receipt.error}`);
53
52
  }
54
53
 
55
- if (!effectsInBlock) {
54
+ if (!receipt.isMined() || !receipt.txEffect) {
56
55
  return;
57
56
  }
58
57
 
59
- const effects = effectsInBlock.data;
58
+ const effects = receipt.txEffect;
60
59
 
61
60
  if (opts.includeBlockInfo) {
62
61
  log(` Block: ${receipt.blockNumber} (${receipt.blockHash?.toString()})`);