@aztec/cli 0.0.1-commit.a072138 → 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 (83) 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 +12 -7
  14. package/dest/cmds/l1/compute_genesis_values.d.ts +4 -0
  15. package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
  16. package/dest/cmds/l1/compute_genesis_values.js +17 -0
  17. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +1 -1
  18. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -1
  19. package/dest/cmds/l1/deploy_l1_contracts_cmd.js +0 -1
  20. package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
  21. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  22. package/dest/cmds/l1/deploy_new_rollup.js +2 -4
  23. package/dest/cmds/l1/index.d.ts +1 -1
  24. package/dest/cmds/l1/index.d.ts.map +1 -1
  25. package/dest/cmds/l1/index.js +4 -0
  26. package/dest/cmds/l1/update_l1_validators.d.ts +1 -1
  27. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  28. package/dest/cmds/l1/update_l1_validators.js +5 -6
  29. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts +2 -0
  30. package/dest/cmds/validator_keys/eth_json_v3_worker.d.ts.map +1 -0
  31. package/dest/cmds/validator_keys/eth_json_v3_worker.js +27 -0
  32. package/dest/cmds/validator_keys/index.d.ts +1 -1
  33. package/dest/cmds/validator_keys/index.d.ts.map +1 -1
  34. package/dest/cmds/validator_keys/index.js +2 -1
  35. package/dest/cmds/validator_keys/new.d.ts +6 -1
  36. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  37. package/dest/cmds/validator_keys/new.js +78 -8
  38. package/dest/cmds/validator_keys/shared.d.ts +1 -1
  39. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  40. package/dest/cmds/validator_keys/shared.js +66 -23
  41. package/dest/config/cached_fetch.d.ts +19 -10
  42. package/dest/config/cached_fetch.d.ts.map +1 -1
  43. package/dest/config/cached_fetch.js +110 -32
  44. package/dest/config/chain_l2_config.d.ts +7 -2
  45. package/dest/config/chain_l2_config.d.ts.map +1 -1
  46. package/dest/config/chain_l2_config.js +17 -2
  47. package/dest/config/generated/networks.d.ts +91 -57
  48. package/dest/config/generated/networks.d.ts.map +1 -1
  49. package/dest/config/generated/networks.js +92 -58
  50. package/dest/config/network_config.d.ts +1 -1
  51. package/dest/config/network_config.d.ts.map +1 -1
  52. package/dest/config/network_config.js +6 -2
  53. package/dest/utils/aztec.d.ts +1 -2
  54. package/dest/utils/aztec.d.ts.map +1 -1
  55. package/dest/utils/aztec.js +2 -3
  56. package/dest/utils/commands.d.ts +14 -6
  57. package/dest/utils/commands.d.ts.map +1 -1
  58. package/dest/utils/commands.js +21 -11
  59. package/dest/utils/inspect.d.ts +1 -1
  60. package/dest/utils/inspect.d.ts.map +1 -1
  61. package/dest/utils/inspect.js +11 -11
  62. package/package.json +30 -30
  63. package/src/cmds/aztec_node/block_number.ts +1 -1
  64. package/src/cmds/aztec_node/get_logs.ts +70 -38
  65. package/src/cmds/aztec_node/get_node_info.ts +0 -2
  66. package/src/cmds/aztec_node/index.ts +13 -8
  67. package/src/cmds/infrastructure/setup_l2_contract.ts +12 -7
  68. package/src/cmds/l1/compute_genesis_values.ts +29 -0
  69. package/src/cmds/l1/deploy_l1_contracts_cmd.ts +0 -1
  70. package/src/cmds/l1/deploy_new_rollup.ts +1 -3
  71. package/src/cmds/l1/index.ts +18 -0
  72. package/src/cmds/l1/update_l1_validators.ts +5 -6
  73. package/src/cmds/validator_keys/eth_json_v3_worker.ts +30 -0
  74. package/src/cmds/validator_keys/index.ts +18 -4
  75. package/src/cmds/validator_keys/new.ts +107 -8
  76. package/src/cmds/validator_keys/shared.ts +86 -34
  77. package/src/config/cached_fetch.ts +119 -31
  78. package/src/config/chain_l2_config.ts +17 -2
  79. package/src/config/generated/networks.ts +90 -56
  80. package/src/config/network_config.ts +6 -2
  81. package/src/utils/aztec.ts +12 -18
  82. package/src/utils/commands.ts +24 -11
  83. package/src/utils/inspect.ts +7 -8
@@ -1,24 +1,48 @@
1
1
  import { createLogger } from '@aztec/aztec.js/log';
2
2
 
3
- import { mkdir, readFile, stat, writeFile } from 'fs/promises';
3
+ import { mkdir, readFile, writeFile } from 'fs/promises';
4
4
  import { dirname } from 'path';
5
5
 
6
6
  export interface CachedFetchOptions {
7
- /** Cache duration in milliseconds */
8
- cacheDurationMs: number;
9
- /** The cache file */
7
+ /** The cache file path for storing data. If not provided, no caching is performed. */
10
8
  cacheFile?: string;
9
+ /** Fallback max-age in milliseconds when server sends no Cache-Control header. Defaults to 5 minutes. */
10
+ defaultMaxAgeMs?: number;
11
+ }
12
+
13
+ /** Cache metadata stored in a sidecar .meta file alongside the data file. */
14
+ interface CacheMeta {
15
+ etag?: string;
16
+ expiresAt: number;
17
+ }
18
+
19
+ const DEFAULT_MAX_AGE_MS = 5 * 60 * 1000; // 5 minutes
20
+
21
+ /** Extracts max-age value in milliseconds from a Response's Cache-Control header. Returns undefined if not present. */
22
+ export function parseMaxAge(response: { headers: { get(name: string): string | null } }): number | undefined {
23
+ const cacheControl = response.headers.get('cache-control');
24
+ if (!cacheControl) {
25
+ return undefined;
26
+ }
27
+ const match = cacheControl.match(/max-age=(\d+)/);
28
+ if (!match) {
29
+ return undefined;
30
+ }
31
+ return parseInt(match[1], 10) * 1000;
11
32
  }
12
33
 
13
34
  /**
14
- * Fetches data from a URL with file-based caching support.
15
- * This utility can be used by both remote config and bootnodes fetching.
35
+ * Fetches data from a URL with file-based HTTP conditional caching.
36
+ *
37
+ * Data is stored as raw JSON in the cache file (same format as the server returns).
38
+ * Caching metadata (ETag, expiry) is stored in a separate sidecar `.meta` file.
39
+ * This keeps the data file human-readable and backward-compatible with older code.
16
40
  *
17
41
  * @param url - The URL to fetch from
18
- * @param networkName - Network name for cache directory structure
19
- * @param options - Caching and error handling options
20
- * @param cacheDir - Optional cache directory (defaults to no caching)
21
- * @returns The fetched and parsed JSON data, or undefined if fetch fails and throwOnError is false
42
+ * @param options - Caching options
43
+ * @param fetch - Fetch implementation (defaults to globalThis.fetch)
44
+ * @param log - Logger instance
45
+ * @returns The fetched and parsed JSON data, or undefined if fetch fails
22
46
  */
23
47
  export async function cachedFetch<T = any>(
24
48
  url: string,
@@ -26,42 +50,106 @@ export async function cachedFetch<T = any>(
26
50
  fetch = globalThis.fetch,
27
51
  log = createLogger('cached_fetch'),
28
52
  ): Promise<T | undefined> {
29
- const { cacheDurationMs, cacheFile } = options;
53
+ const { cacheFile, defaultMaxAgeMs = DEFAULT_MAX_AGE_MS } = options;
54
+
55
+ // If no cacheFile, just fetch normally without caching
56
+ if (!cacheFile) {
57
+ return fetchAndParse<T>(url, fetch, log);
58
+ }
59
+
60
+ const metaFile = cacheFile + '.meta';
30
61
 
31
- // Try to read from cache first
62
+ // Try to read metadata
63
+ let meta: CacheMeta | undefined;
32
64
  try {
33
- if (cacheFile) {
34
- const info = await stat(cacheFile);
35
- if (info.mtimeMs + cacheDurationMs > Date.now()) {
36
- const cachedData = JSON.parse(await readFile(cacheFile, 'utf-8'));
37
- return cachedData;
38
- }
39
- }
65
+ meta = JSON.parse(await readFile(metaFile, 'utf-8'));
40
66
  } catch {
41
- log.trace('Failed to read data from cache');
67
+ log.trace('No usable cache metadata found');
42
68
  }
43
69
 
70
+ // Try to read cached data
71
+ let cachedData: T | undefined;
44
72
  try {
45
- const response = await fetch(url);
73
+ cachedData = JSON.parse(await readFile(cacheFile, 'utf-8'));
74
+ } catch {
75
+ log.trace('No usable cached data found');
76
+ }
77
+
78
+ // If metadata and data exist and cache is fresh, return directly
79
+ if (meta && cachedData !== undefined && meta.expiresAt > Date.now()) {
80
+ return cachedData;
81
+ }
82
+
83
+ // Cache is stale or missing — make a (possibly conditional) request
84
+ try {
85
+ const headers: Record<string, string> = {};
86
+ if (meta?.etag && cachedData !== undefined) {
87
+ headers['If-None-Match'] = meta.etag;
88
+ }
89
+
90
+ const response = await fetch(url, { headers });
91
+
92
+ if (response.status === 304 && cachedData !== undefined) {
93
+ // Not modified — recompute expiry from new response headers and return cached data
94
+ const maxAgeMs = parseMaxAge(response) ?? defaultMaxAgeMs;
95
+ await writeMetaFile(metaFile, { etag: meta?.etag, expiresAt: Date.now() + maxAgeMs }, log);
96
+ return cachedData;
97
+ }
98
+
46
99
  if (!response.ok) {
47
100
  log.warn(`Failed to fetch from ${url}: ${response.status} ${response.statusText}`);
48
- return undefined;
101
+ return cachedData;
49
102
  }
50
103
 
51
- const data = await response.json();
104
+ // 200 — parse new data and cache it
105
+ const data = (await response.json()) as T;
106
+ const maxAgeMs = parseMaxAge(response) ?? defaultMaxAgeMs;
107
+ const etag = response.headers.get('etag') ?? undefined;
52
108
 
53
- try {
54
- if (cacheFile) {
55
- await mkdir(dirname(cacheFile), { recursive: true });
56
- await writeFile(cacheFile, JSON.stringify(data), 'utf-8');
57
- }
58
- } catch (err) {
59
- log.warn('Failed to cache data on disk: ' + cacheFile, { cacheFile, err });
60
- }
109
+ await ensureDir(cacheFile, log);
110
+ await Promise.all([
111
+ writeFile(cacheFile, JSON.stringify(data), 'utf-8'),
112
+ writeFile(metaFile, JSON.stringify({ etag, expiresAt: Date.now() + maxAgeMs }), 'utf-8'),
113
+ ]);
61
114
 
62
115
  return data;
116
+ } catch (err) {
117
+ log.warn(`Failed to fetch from ${url}`, { err });
118
+ return cachedData;
119
+ }
120
+ }
121
+
122
+ async function fetchAndParse<T>(
123
+ url: string,
124
+ fetch: typeof globalThis.fetch,
125
+ log: ReturnType<typeof createLogger>,
126
+ ): Promise<T | undefined> {
127
+ try {
128
+ const response = await fetch(url);
129
+ if (!response.ok) {
130
+ log.warn(`Failed to fetch from ${url}: ${response.status} ${response.statusText}`);
131
+ return undefined;
132
+ }
133
+ return (await response.json()) as T;
63
134
  } catch (err) {
64
135
  log.warn(`Failed to fetch from ${url}`, { err });
65
136
  return undefined;
66
137
  }
67
138
  }
139
+
140
+ async function ensureDir(filePath: string, log: ReturnType<typeof createLogger>) {
141
+ try {
142
+ await mkdir(dirname(filePath), { recursive: true });
143
+ } catch (err) {
144
+ log.warn('Failed to create cache directory for: ' + filePath, { err });
145
+ }
146
+ }
147
+
148
+ async function writeMetaFile(metaFile: string, meta: CacheMeta, log: ReturnType<typeof createLogger>) {
149
+ try {
150
+ await mkdir(dirname(metaFile), { recursive: true });
151
+ await writeFile(metaFile, JSON.stringify(meta), 'utf-8');
152
+ } catch (err) {
153
+ log.warn('Failed to write cache metadata: ' + metaFile, { err });
154
+ }
155
+ }
@@ -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
  */
@@ -45,8 +55,13 @@ export function enrichEnvironmentWithChainName(networkName: NetworkNames) {
45
55
  }
46
56
 
47
57
  // Apply generated network config from defaults.yml
48
- const generatedConfig = NetworkConfigs[networkName];
58
+ // For devnet iterations (v4-devnet-1, etc.), use the base devnet config
59
+ const configKey = /^v\d+-devnet-\d+$/.test(networkName) ? 'devnet' : networkName;
60
+ const generatedConfig = NetworkConfigs[configKey];
49
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);
50
65
  enrichEnvironmentWithNetworkConfig(generatedConfig);
51
66
  }
52
67
 
@@ -3,18 +3,16 @@
3
3
 
4
4
  export const devnetConfig = {
5
5
  ETHEREUM_SLOT_DURATION: 12,
6
- AZTEC_SLOT_DURATION: 36,
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,15 +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
- SLASH_MAX_PAYLOAD_SIZE: 50,
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
- SEQ_MIN_TX_PER_BLOCK: 0,
36
+ SEQ_MIN_TX_PER_BLOCK: 1,
35
37
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
38
+ SEQ_BLOCK_DURATION_MS: 6000,
39
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
36
40
  DATA_STORE_MAP_SIZE_KB: 134217728,
37
41
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
38
42
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -40,15 +44,21 @@ export const devnetConfig = {
40
44
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
41
45
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
42
46
  SENTINEL_ENABLED: true,
47
+ OFFENSE_COLLECTION_ENABLED: true,
48
+ AZTEC_SLOT_DURATION: 36,
43
49
  AZTEC_EPOCH_DURATION: 8,
44
50
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 1,
45
51
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 1,
52
+ AZTEC_TARGET_COMMITTEE_SIZE: 1,
53
+ MAX_BLOCKS_PER_CHECKPOINT: 4,
46
54
  AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 1,
55
+ AZTEC_SLASHING_QUORUM: 17,
56
+ AZTEC_GOVERNANCE_PROPOSER_QUORUM: 151,
47
57
  L1_CHAIN_ID: 11155111,
48
58
  TEST_ACCOUNTS: true,
49
59
  SPONSORED_FPC: true,
50
60
  TRANSACTIONS_DISABLED: false,
51
- SEQ_MAX_TX_PER_BLOCK: 32,
61
+ SEQ_MAX_TX_PER_BLOCK: 18,
52
62
  PROVER_REAL_PROOFS: false,
53
63
  PXE_PROVER_ENABLED: false,
54
64
  SYNC_SNAPSHOTS_URLS: '',
@@ -56,21 +66,23 @@ export const devnetConfig = {
56
66
  BLOB_ALLOW_EMPTY_SOURCES: false,
57
67
  P2P_MAX_PENDING_TX_COUNT: 1000,
58
68
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: false,
59
- AUTO_UPDATE: 'none',
60
- AUTO_UPDATE_URL: '',
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,
68
75
  SLASH_INACTIVITY_PENALTY: 10000000000000000000,
69
76
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
70
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
77
+ SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
78
+ SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
79
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
80
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10000000000000000000,
71
81
  SLASH_UNKNOWN_PENALTY: 10000000000000000000,
72
82
  SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
83
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
73
84
  SLASH_GRACE_PERIOD_L2_SLOTS: 0,
85
+ ENABLE_AUTO_SHUTDOWN: false,
74
86
  } as const;
75
87
 
76
88
  export const testnetConfig = {
@@ -80,27 +92,30 @@ export const testnetConfig = {
80
92
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 2,
81
93
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 2,
82
94
  AZTEC_EXIT_DELAY_SECONDS: 172800,
83
- AZTEC_INBOX_LAG: 1,
95
+ AZTEC_INBOX_LAG: 2,
84
96
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
85
- AZTEC_PROVING_COST_PER_MANA: 100,
86
97
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
87
- AZTEC_SLASHER_FLAVOR: 'tally',
98
+ AZTEC_SLASHER_ENABLED: true,
88
99
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
89
100
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
90
101
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
91
102
  AZTEC_SLASHING_DISABLE_DURATION: 432000,
92
- AZTEC_SLASH_AMOUNT_SMALL: 10000000000000000000,
93
- AZTEC_SLASH_AMOUNT_MEDIUM: 20000000000000000000,
94
- AZTEC_SLASH_AMOUNT_LARGE: 50000000000000000000,
95
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
96
- 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,
97
108
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
98
- SLASH_MAX_PAYLOAD_SIZE: 50,
109
+ SLASH_MAX_PAYLOAD_SIZE: 80,
99
110
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
111
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
100
112
  P2P_ENABLED: true,
101
113
  BOOTSTRAP_NODES: '',
102
- SEQ_MIN_TX_PER_BLOCK: 0,
114
+ SEQ_MIN_TX_PER_BLOCK: 1,
103
115
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
116
+ SEQ_BLOCK_DURATION_MS: 6000,
117
+ MAX_BLOCKS_PER_CHECKPOINT: 10,
118
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
104
119
  DATA_STORE_MAP_SIZE_KB: 134217728,
105
120
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
106
121
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -108,6 +123,7 @@ export const testnetConfig = {
108
123
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
109
124
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
110
125
  SENTINEL_ENABLED: true,
126
+ OFFENSE_COLLECTION_ENABLED: true,
111
127
  AZTEC_SLOT_DURATION: 72,
112
128
  AZTEC_ACTIVATION_THRESHOLD: 2E+23,
113
129
  AZTEC_EJECTION_THRESHOLD: 1E+23,
@@ -117,46 +133,58 @@ export const testnetConfig = {
117
133
  AZTEC_SLASHING_QUORUM: 33,
118
134
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 100,
119
135
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 60,
120
- AZTEC_MANA_TARGET: 150000000,
136
+ AZTEC_MANA_TARGET: 75000000,
137
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
138
+ AZTEC_SLASH_AMOUNT_SMALL: 1E+23,
139
+ AZTEC_SLASH_AMOUNT_MEDIUM: 2.5E+23,
140
+ AZTEC_SLASH_AMOUNT_LARGE: 2.5E+23,
121
141
  L1_CHAIN_ID: 11155111,
122
142
  TEST_ACCOUNTS: false,
123
- SPONSORED_FPC: true,
143
+ SPONSORED_FPC: false,
124
144
  TRANSACTIONS_DISABLED: false,
125
- SEQ_MAX_TX_PER_BLOCK: 8,
145
+ SEQ_MAX_TX_PER_CHECKPOINT: 72,
126
146
  PROVER_REAL_PROOFS: true,
147
+ P2P_MAX_PENDING_TX_COUNT: 1000,
127
148
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
128
- SLASH_PRUNE_PENALTY: 10000000000000000000,
129
- SLASH_DATA_WITHHOLDING_PENALTY: 10000000000000000000,
149
+ SLASH_DATA_WITHHOLDING_PENALTY: 0,
130
150
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.9,
131
151
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
132
- SLASH_INACTIVITY_PENALTY: 10000000000000000000,
133
- SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
134
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
135
- SLASH_UNKNOWN_PENALTY: 10000000000000000000,
136
- 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,
137
161
  SLASH_GRACE_PERIOD_L2_SLOTS: 64,
162
+ ENABLE_AUTO_SHUTDOWN: false,
138
163
  } as const;
139
164
 
140
165
  export const mainnetConfig = {
141
166
  ETHEREUM_SLOT_DURATION: 12,
142
167
  AZTEC_EPOCH_DURATION: 32,
168
+ AZTEC_TARGET_COMMITTEE_SIZE: 48,
143
169
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 2,
144
170
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 2,
145
- AZTEC_INBOX_LAG: 1,
171
+ AZTEC_INBOX_LAG: 2,
146
172
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
147
173
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
148
- AZTEC_SLASHER_FLAVOR: 'tally',
174
+ AZTEC_SLASHER_ENABLED: true,
149
175
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
150
176
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
151
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
152
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
153
177
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
154
- SLASH_MAX_PAYLOAD_SIZE: 50,
178
+ SLASH_MAX_PAYLOAD_SIZE: 80,
155
179
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
180
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
156
181
  P2P_ENABLED: true,
157
182
  BOOTSTRAP_NODES: '',
158
- SEQ_MIN_TX_PER_BLOCK: 0,
183
+ SEQ_MIN_TX_PER_BLOCK: 1,
159
184
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
185
+ SEQ_BLOCK_DURATION_MS: 6000,
186
+ MAX_BLOCKS_PER_CHECKPOINT: 10,
187
+ CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS: 12,
160
188
  DATA_STORE_MAP_SIZE_KB: 134217728,
161
189
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
162
190
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -164,47 +192,53 @@ export const mainnetConfig = {
164
192
  PUBLIC_DATA_TREE_MAP_SIZE_KB: 1073741824,
165
193
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
166
194
  SENTINEL_ENABLED: true,
195
+ OFFENSE_COLLECTION_ENABLED: true,
167
196
  AZTEC_SLOT_DURATION: 72,
168
- AZTEC_TARGET_COMMITTEE_SIZE: 24,
169
197
  AZTEC_ACTIVATION_THRESHOLD: 2E+23,
170
198
  AZTEC_EJECTION_THRESHOLD: 1E+23,
171
- AZTEC_LOCAL_EJECTION_THRESHOLD: 1.96E+23,
199
+ AZTEC_LOCAL_EJECTION_THRESHOLD: 1.9E+23,
172
200
  AZTEC_SLASH_AMOUNT_SMALL: 2E+21,
173
- AZTEC_SLASH_AMOUNT_MEDIUM: 2E+21,
174
- AZTEC_SLASH_AMOUNT_LARGE: 2E+21,
201
+ AZTEC_SLASH_AMOUNT_MEDIUM: 5E+21,
202
+ AZTEC_SLASH_AMOUNT_LARGE: 5E+21,
175
203
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 34,
176
204
  AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 28,
177
205
  AZTEC_SLASHING_VETOER: '0xBbB4aF368d02827945748b28CD4b2D42e4A37480',
178
206
  AZTEC_SLASHING_QUORUM: 65,
179
207
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 600,
180
208
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 1000,
181
- AZTEC_MANA_TARGET: 0,
182
- AZTEC_PROVING_COST_PER_MANA: 0,
209
+ AZTEC_MANA_TARGET: 75000000,
210
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
183
211
  AZTEC_EXIT_DELAY_SECONDS: 345600,
184
212
  AZTEC_SLASHING_DISABLE_DURATION: 259200,
213
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 500,
214
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 500,
215
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 1,
216
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 400,
217
+ AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 4,
185
218
  L1_CHAIN_ID: 1,
186
219
  TEST_ACCOUNTS: false,
187
220
  SPONSORED_FPC: false,
188
- TRANSACTIONS_DISABLED: true,
189
- SEQ_MAX_TX_PER_BLOCK: 0,
221
+ TRANSACTIONS_DISABLED: false,
222
+ SEQ_MAX_TX_PER_CHECKPOINT: 72,
190
223
  PROVER_REAL_PROOFS: true,
191
- SYNC_SNAPSHOTS_URLS: 'https://aztec-labs-snapshots.com/mainnet/',
192
224
  BLOB_ALLOW_EMPTY_SOURCES: true,
193
- P2P_MAX_PENDING_TX_COUNT: 0,
225
+ P2P_MAX_PENDING_TX_COUNT: 1000,
194
226
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
195
- AUTO_UPDATE: 'notify',
196
- AUTO_UPDATE_URL: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
197
- PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
198
- PUBLIC_OTEL_COLLECT_FROM: 'sequencer',
199
- SLASH_PRUNE_PENALTY: 0,
227
+ PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
228
+ PUBLIC_OTEL_COLLECT_FROM: '',
229
+ ENABLE_AUTO_SHUTDOWN: false,
200
230
  SLASH_DATA_WITHHOLDING_PENALTY: 0,
201
231
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.8,
202
232
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2,
203
233
  SLASH_INACTIVITY_PENALTY: 2E+21,
204
234
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2E+21,
205
- 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,
206
239
  SLASH_UNKNOWN_PENALTY: 2E+21,
207
240
  SLASH_INVALID_BLOCK_PENALTY: 2E+21,
208
- SLASH_GRACE_PERIOD_L2_SLOTS: 1200,
241
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 2E+21,
242
+ SLASH_GRACE_PERIOD_L2_SLOTS: 8400,
209
243
  } as const;
210
244
 
@@ -9,7 +9,6 @@ import { enrichEthAddressVar, enrichVar } from './enrich_env.js';
9
9
  const DEFAULT_CONFIG_URL =
10
10
  'https://raw.githubusercontent.com/AztecProtocol/networks/refs/heads/main/network_config.json';
11
11
  const FALLBACK_CONFIG_URL = 'https://metadata.aztec.network/network_config.json';
12
- const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
13
12
 
14
13
  /**
15
14
  * Fetches remote network configuration from GitHub with caching support.
@@ -87,7 +86,6 @@ async function fetchNetworkConfigFromUrl(
87
86
 
88
87
  if (url.protocol === 'http:' || url.protocol === 'https:') {
89
88
  rawConfig = await cachedFetch(url.href, {
90
- cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
91
89
  cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined,
92
90
  });
93
91
  } else if (url.protocol === 'file:') {
@@ -141,7 +139,13 @@ export async function enrichEnvironmentWithNetworkConfig(networkName: NetworkNam
141
139
  if (networkConfig.blobFileStoreUrls?.length) {
142
140
  enrichVar('BLOB_FILE_STORE_URLS', networkConfig.blobFileStoreUrls.join(','));
143
141
  }
142
+ if (networkConfig.txCollectionFileStoreUrls?.length) {
143
+ enrichVar('TX_COLLECTION_FILE_STORE_URLS', networkConfig.txCollectionFileStoreUrls.join(','));
144
+ }
144
145
  if (networkConfig.blockDurationMs !== undefined) {
145
146
  enrichVar('SEQ_BLOCK_DURATION_MS', String(networkConfig.blockDurationMs));
146
147
  }
148
+ if (networkConfig.txPublicSetupAllowListExtend) {
149
+ enrichVar('TX_PUBLIC_SETUP_ALLOWLIST', networkConfig.txPublicSetupAllowListExtend);
150
+ }
147
151
  }
@@ -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
  /**