@aztec/cli 0.0.1-commit.7b97ef96e → 0.0.1-commit.7cbc774

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 (51) 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/l1/deploy_l1_contracts_cmd.d.ts +1 -1
  12. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -1
  13. package/dest/cmds/l1/deploy_l1_contracts_cmd.js +0 -1
  14. package/dest/cmds/l1/deploy_new_rollup.d.ts +1 -1
  15. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  16. package/dest/cmds/l1/deploy_new_rollup.js +2 -4
  17. package/dest/cmds/l1/update_l1_validators.d.ts +1 -1
  18. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  19. package/dest/cmds/l1/update_l1_validators.js +0 -1
  20. package/dest/config/cached_fetch.d.ts +19 -10
  21. package/dest/config/cached_fetch.d.ts.map +1 -1
  22. package/dest/config/cached_fetch.js +110 -32
  23. package/dest/config/generated/networks.d.ts +66 -56
  24. package/dest/config/generated/networks.d.ts.map +1 -1
  25. package/dest/config/generated/networks.js +67 -57
  26. package/dest/config/network_config.d.ts +1 -1
  27. package/dest/config/network_config.d.ts.map +1 -1
  28. package/dest/config/network_config.js +6 -2
  29. package/dest/utils/aztec.d.ts +1 -2
  30. package/dest/utils/aztec.d.ts.map +1 -1
  31. package/dest/utils/aztec.js +2 -3
  32. package/dest/utils/commands.d.ts +14 -6
  33. package/dest/utils/commands.d.ts.map +1 -1
  34. package/dest/utils/commands.js +19 -9
  35. package/dest/utils/inspect.d.ts +1 -1
  36. package/dest/utils/inspect.d.ts.map +1 -1
  37. package/dest/utils/inspect.js +6 -5
  38. package/package.json +30 -30
  39. package/src/cmds/aztec_node/block_number.ts +1 -1
  40. package/src/cmds/aztec_node/get_logs.ts +70 -38
  41. package/src/cmds/aztec_node/get_node_info.ts +0 -2
  42. package/src/cmds/aztec_node/index.ts +13 -8
  43. package/src/cmds/l1/deploy_l1_contracts_cmd.ts +0 -1
  44. package/src/cmds/l1/deploy_new_rollup.ts +1 -3
  45. package/src/cmds/l1/update_l1_validators.ts +0 -1
  46. package/src/config/cached_fetch.ts +119 -31
  47. package/src/config/generated/networks.ts +65 -55
  48. package/src/config/network_config.ts +6 -2
  49. package/src/utils/aztec.ts +12 -18
  50. package/src/utils/commands.ts +22 -9
  51. package/src/utils/inspect.ts +4 -5
@@ -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
+ }
@@ -3,7 +3,7 @@
3
3
 
4
4
  export const devnetConfig = {
5
5
  ETHEREUM_SLOT_DURATION: 12,
6
- AZTEC_SLOT_DURATION: 36,
6
+ AZTEC_SLOT_DURATION: 72,
7
7
  AZTEC_TARGET_COMMITTEE_SIZE: 48,
8
8
  AZTEC_ACTIVATION_THRESHOLD: 100000000000000000000,
9
9
  AZTEC_EJECTION_THRESHOLD: 50000000000000000000,
@@ -14,7 +14,7 @@ export const devnetConfig = {
14
14
  AZTEC_MANA_TARGET: 100000000,
15
15
  AZTEC_PROVING_COST_PER_MANA: 100,
16
16
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
17
- AZTEC_SLASHER_FLAVOR: 'tally',
17
+ AZTEC_SLASHER_ENABLED: true,
18
18
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
19
19
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
20
20
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
@@ -24,15 +24,16 @@ export const devnetConfig = {
24
24
  AZTEC_SLASH_AMOUNT_MEDIUM: 20000000000000000000,
25
25
  AZTEC_SLASH_AMOUNT_LARGE: 50000000000000000000,
26
26
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 300,
27
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
28
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
29
27
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
30
- SLASH_MAX_PAYLOAD_SIZE: 50,
28
+ SLASH_MAX_PAYLOAD_SIZE: 80,
31
29
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
30
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
32
31
  P2P_ENABLED: true,
33
32
  BOOTSTRAP_NODES: '',
34
- SEQ_MIN_TX_PER_BLOCK: 0,
33
+ SEQ_MIN_TX_PER_BLOCK: 1,
35
34
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
35
+ SEQ_BLOCK_DURATION_MS: 6000,
36
+ SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
36
37
  DATA_STORE_MAP_SIZE_KB: 134217728,
37
38
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
38
39
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -48,7 +49,7 @@ export const devnetConfig = {
48
49
  TEST_ACCOUNTS: true,
49
50
  SPONSORED_FPC: true,
50
51
  TRANSACTIONS_DISABLED: false,
51
- SEQ_MAX_TX_PER_BLOCK: 32,
52
+ SEQ_MAX_TX_PER_BLOCK: 18,
52
53
  PROVER_REAL_PROOFS: false,
53
54
  PXE_PROVER_ENABLED: false,
54
55
  SYNC_SNAPSHOTS_URLS: '',
@@ -56,12 +57,9 @@ export const devnetConfig = {
56
57
  BLOB_ALLOW_EMPTY_SOURCES: false,
57
58
  P2P_MAX_PENDING_TX_COUNT: 1000,
58
59
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: false,
59
- AUTO_UPDATE: 'none',
60
- AUTO_UPDATE_URL: '',
61
60
  PUBLIC_OTEL_OPT_OUT: true,
62
61
  PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
63
62
  PUBLIC_OTEL_COLLECT_FROM: '',
64
- SLASH_PRUNE_PENALTY: 10000000000000000000,
65
63
  SLASH_DATA_WITHHOLDING_PENALTY: 10000000000000000000,
66
64
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.9,
67
65
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
@@ -69,10 +67,13 @@ export const devnetConfig = {
69
67
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
70
68
  SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
71
69
  SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
72
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
70
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
71
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10000000000000000000,
73
72
  SLASH_UNKNOWN_PENALTY: 10000000000000000000,
74
73
  SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
74
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
75
75
  SLASH_GRACE_PERIOD_L2_SLOTS: 0,
76
+ ENABLE_VERSION_CHECK: true,
76
77
  } as const;
77
78
 
78
79
  export const testnetConfig = {
@@ -84,25 +85,22 @@ export const testnetConfig = {
84
85
  AZTEC_EXIT_DELAY_SECONDS: 172800,
85
86
  AZTEC_INBOX_LAG: 1,
86
87
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
87
- AZTEC_PROVING_COST_PER_MANA: 100,
88
88
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
89
- AZTEC_SLASHER_FLAVOR: 'tally',
89
+ AZTEC_SLASHER_ENABLED: true,
90
90
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
91
91
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 5,
92
92
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
93
93
  AZTEC_SLASHING_DISABLE_DURATION: 432000,
94
- AZTEC_SLASH_AMOUNT_SMALL: 10000000000000000000,
95
- AZTEC_SLASH_AMOUNT_MEDIUM: 20000000000000000000,
96
- AZTEC_SLASH_AMOUNT_LARGE: 50000000000000000000,
97
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
98
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
99
94
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
100
- SLASH_MAX_PAYLOAD_SIZE: 50,
95
+ SLASH_MAX_PAYLOAD_SIZE: 80,
101
96
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
97
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
102
98
  P2P_ENABLED: true,
103
99
  BOOTSTRAP_NODES: '',
104
- SEQ_MIN_TX_PER_BLOCK: 0,
100
+ SEQ_MIN_TX_PER_BLOCK: 1,
105
101
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
102
+ SEQ_BLOCK_DURATION_MS: 6000,
103
+ SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
106
104
  DATA_STORE_MAP_SIZE_KB: 134217728,
107
105
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
108
106
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -119,48 +117,57 @@ export const testnetConfig = {
119
117
  AZTEC_SLASHING_QUORUM: 33,
120
118
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 100,
121
119
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 60,
122
- AZTEC_MANA_TARGET: 150000000,
120
+ AZTEC_MANA_TARGET: 75000000,
121
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
122
+ AZTEC_SLASH_AMOUNT_SMALL: 1E+23,
123
+ AZTEC_SLASH_AMOUNT_MEDIUM: 2.5E+23,
124
+ AZTEC_SLASH_AMOUNT_LARGE: 2.5E+23,
123
125
  L1_CHAIN_ID: 11155111,
124
126
  TEST_ACCOUNTS: false,
125
- SPONSORED_FPC: true,
127
+ SPONSORED_FPC: false,
126
128
  TRANSACTIONS_DISABLED: false,
127
- SEQ_MAX_TX_PER_BLOCK: 8,
129
+ SEQ_MAX_TX_PER_CHECKPOINT: 72,
128
130
  PROVER_REAL_PROOFS: true,
131
+ P2P_MAX_PENDING_TX_COUNT: 1000,
129
132
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
130
- SLASH_PRUNE_PENALTY: 10000000000000000000,
131
- SLASH_DATA_WITHHOLDING_PENALTY: 10000000000000000000,
133
+ SLASH_DATA_WITHHOLDING_PENALTY: 0,
132
134
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.9,
133
135
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 1,
134
- SLASH_INACTIVITY_PENALTY: 10000000000000000000,
135
- SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10000000000000000000,
136
- SLASH_DUPLICATE_PROPOSAL_PENALTY: 10000000000000000000,
137
- SLASH_DUPLICATE_ATTESTATION_PENALTY: 10000000000000000000,
138
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10000000000000000000,
139
- SLASH_UNKNOWN_PENALTY: 10000000000000000000,
140
- SLASH_INVALID_BLOCK_PENALTY: 10000000000000000000,
136
+ SLASH_INACTIVITY_PENALTY: 1E+23,
137
+ SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 1E+23,
138
+ SLASH_DUPLICATE_PROPOSAL_PENALTY: 2.5E+23,
139
+ SLASH_DUPLICATE_ATTESTATION_PENALTY: 2.5E+23,
140
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 0,
141
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
142
+ SLASH_UNKNOWN_PENALTY: 1E+23,
143
+ SLASH_INVALID_BLOCK_PENALTY: 1E+23,
144
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 1E+23,
141
145
  SLASH_GRACE_PERIOD_L2_SLOTS: 64,
146
+ ENABLE_VERSION_CHECK: true,
142
147
  } as const;
143
148
 
144
149
  export const mainnetConfig = {
145
150
  ETHEREUM_SLOT_DURATION: 12,
146
151
  AZTEC_EPOCH_DURATION: 32,
152
+ AZTEC_TARGET_COMMITTEE_SIZE: 48,
147
153
  AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET: 2,
148
154
  AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 2,
149
155
  AZTEC_INBOX_LAG: 1,
150
156
  AZTEC_PROOF_SUBMISSION_EPOCHS: 1,
151
157
  AZTEC_INITIAL_ETH_PER_FEE_ASSET: 10000000,
152
- AZTEC_SLASHER_FLAVOR: 'tally',
158
+ AZTEC_SLASHER_ENABLED: true,
153
159
  AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS: 4,
154
160
  AZTEC_SLASHING_OFFSET_IN_ROUNDS: 2,
155
- SLASH_MIN_PENALTY_PERCENTAGE: 0.5,
156
- SLASH_MAX_PENALTY_PERCENTAGE: 2,
157
161
  SLASH_OFFENSE_EXPIRATION_ROUNDS: 4,
158
- SLASH_MAX_PAYLOAD_SIZE: 50,
162
+ SLASH_MAX_PAYLOAD_SIZE: 80,
159
163
  SLASH_EXECUTE_ROUNDS_LOOK_BACK: 4,
164
+ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS: 3,
160
165
  P2P_ENABLED: true,
161
166
  BOOTSTRAP_NODES: '',
162
- SEQ_MIN_TX_PER_BLOCK: 0,
167
+ SEQ_MIN_TX_PER_BLOCK: 1,
163
168
  SEQ_BUILD_CHECKPOINT_IF_EMPTY: true,
169
+ SEQ_BLOCK_DURATION_MS: 6000,
170
+ SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT: 36,
164
171
  DATA_STORE_MAP_SIZE_KB: 134217728,
165
172
  ARCHIVER_STORE_MAP_SIZE_KB: 1073741824,
166
173
  NOTE_HASH_TREE_MAP_SIZE_KB: 1073741824,
@@ -169,48 +176,51 @@ export const mainnetConfig = {
169
176
  PUBLIC_OTEL_INCLUDE_METRICS: 'aztec.validator,aztec.tx_collector,aztec.mempool,aztec.p2p.gossip.agg_,aztec.ivc_verifier.agg_',
170
177
  SENTINEL_ENABLED: true,
171
178
  AZTEC_SLOT_DURATION: 72,
172
- AZTEC_TARGET_COMMITTEE_SIZE: 24,
173
179
  AZTEC_ACTIVATION_THRESHOLD: 2E+23,
174
180
  AZTEC_EJECTION_THRESHOLD: 1E+23,
175
- AZTEC_LOCAL_EJECTION_THRESHOLD: 1.96E+23,
181
+ AZTEC_LOCAL_EJECTION_THRESHOLD: 1.9E+23,
176
182
  AZTEC_SLASH_AMOUNT_SMALL: 2E+21,
177
- AZTEC_SLASH_AMOUNT_MEDIUM: 2E+21,
178
- AZTEC_SLASH_AMOUNT_LARGE: 2E+21,
183
+ AZTEC_SLASH_AMOUNT_MEDIUM: 5E+21,
184
+ AZTEC_SLASH_AMOUNT_LARGE: 5E+21,
179
185
  AZTEC_SLASHING_LIFETIME_IN_ROUNDS: 34,
180
186
  AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 28,
181
187
  AZTEC_SLASHING_VETOER: '0xBbB4aF368d02827945748b28CD4b2D42e4A37480',
182
188
  AZTEC_SLASHING_QUORUM: 65,
183
189
  AZTEC_GOVERNANCE_PROPOSER_QUORUM: 600,
184
190
  AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 1000,
185
- AZTEC_MANA_TARGET: 0,
186
- AZTEC_PROVING_COST_PER_MANA: 0,
191
+ AZTEC_MANA_TARGET: 75000000,
192
+ AZTEC_PROVING_COST_PER_MANA: 12500000,
187
193
  AZTEC_EXIT_DELAY_SECONDS: 345600,
188
194
  AZTEC_SLASHING_DISABLE_DURATION: 259200,
195
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 500,
196
+ AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 500,
197
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 1,
198
+ AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 400,
199
+ AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 4,
189
200
  L1_CHAIN_ID: 1,
190
201
  TEST_ACCOUNTS: false,
191
202
  SPONSORED_FPC: false,
192
- TRANSACTIONS_DISABLED: true,
193
- SEQ_MAX_TX_PER_BLOCK: 0,
203
+ TRANSACTIONS_DISABLED: false,
204
+ SEQ_MAX_TX_PER_CHECKPOINT: 72,
194
205
  PROVER_REAL_PROOFS: true,
195
- SYNC_SNAPSHOTS_URLS: 'https://aztec-labs-snapshots.com/mainnet/',
196
206
  BLOB_ALLOW_EMPTY_SOURCES: true,
197
- P2P_MAX_PENDING_TX_COUNT: 0,
207
+ P2P_MAX_PENDING_TX_COUNT: 1000,
198
208
  P2P_TX_POOL_DELETE_TXS_AFTER_REORG: true,
199
- AUTO_UPDATE: 'notify',
200
- AUTO_UPDATE_URL: 'https://storage.googleapis.com/aztec-mainnet/auto-update/mainnet.json',
201
- PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
202
- PUBLIC_OTEL_COLLECT_FROM: 'sequencer',
203
- SLASH_PRUNE_PENALTY: 0,
209
+ PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',
210
+ PUBLIC_OTEL_COLLECT_FROM: '',
211
+ ENABLE_VERSION_CHECK: false,
204
212
  SLASH_DATA_WITHHOLDING_PENALTY: 0,
205
213
  SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.8,
206
214
  SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2,
207
215
  SLASH_INACTIVITY_PENALTY: 2E+21,
208
216
  SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2E+21,
209
- SLASH_DUPLICATE_PROPOSAL_PENALTY: 2E+21,
210
- SLASH_DUPLICATE_ATTESTATION_PENALTY: 2E+21,
211
- SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2E+21,
217
+ SLASH_DUPLICATE_PROPOSAL_PENALTY: 5E+21,
218
+ SLASH_DUPLICATE_ATTESTATION_PENALTY: 5E+21,
219
+ SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 0,
220
+ SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 0,
212
221
  SLASH_UNKNOWN_PENALTY: 2E+21,
213
222
  SLASH_INVALID_BLOCK_PENALTY: 2E+21,
223
+ SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 2E+21,
214
224
  SLASH_GRACE_PERIOD_L2_SLOTS: 1200,
215
225
  } as const;
216
226
 
@@ -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.
@@ -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
  }