@aztec/cli 0.0.1-commit.b655e406 → 0.0.1-commit.b6e433891

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 (180) hide show
  1. package/README.md +1 -1
  2. package/dest/cmds/aztec_node/block_number.d.ts +1 -1
  3. package/dest/cmds/aztec_node/get_block.d.ts +1 -1
  4. package/dest/cmds/aztec_node/get_block.d.ts.map +1 -1
  5. package/dest/cmds/aztec_node/get_block.js +2 -1
  6. package/dest/cmds/aztec_node/get_current_min_fee.d.ts +3 -0
  7. package/dest/cmds/aztec_node/get_current_min_fee.d.ts.map +1 -0
  8. package/dest/cmds/aztec_node/{get_current_base_fee.js → get_current_min_fee.js} +2 -2
  9. package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +1 -1
  10. package/dest/cmds/aztec_node/get_logs.d.ts +3 -2
  11. package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -1
  12. package/dest/cmds/aztec_node/get_node_info.d.ts +1 -1
  13. package/dest/cmds/aztec_node/index.d.ts +1 -1
  14. package/dest/cmds/aztec_node/index.js +3 -3
  15. package/dest/cmds/contracts/index.d.ts +1 -1
  16. package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
  17. package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
  18. package/dest/cmds/contracts/inspect_contract.js +4 -10
  19. package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
  20. package/dest/cmds/infrastructure/index.d.ts +1 -1
  21. package/dest/cmds/infrastructure/index.d.ts.map +1 -1
  22. package/dest/cmds/infrastructure/index.js +0 -1
  23. package/dest/cmds/infrastructure/sequencers.d.ts +1 -2
  24. package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
  25. package/dest/cmds/infrastructure/sequencers.js +11 -4
  26. package/dest/cmds/infrastructure/setup_l2_contract.d.ts +1 -1
  27. package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
  28. package/dest/cmds/infrastructure/setup_l2_contract.js +4 -3
  29. package/dest/cmds/l1/advance_epoch.d.ts +1 -1
  30. package/dest/cmds/l1/assume_proven_through.d.ts +3 -2
  31. package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
  32. package/dest/cmds/l1/assume_proven_through.js +3 -4
  33. package/dest/cmds/l1/bridge_erc20.d.ts +1 -1
  34. package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
  35. package/dest/cmds/l1/bridge_erc20.js +2 -1
  36. package/dest/cmds/l1/compute_genesis_values.d.ts +4 -0
  37. package/dest/cmds/l1/compute_genesis_values.d.ts.map +1 -0
  38. package/dest/cmds/l1/compute_genesis_values.js +17 -0
  39. package/dest/cmds/l1/create_l1_account.d.ts +1 -1
  40. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
  41. package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
  42. package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +39 -4
  43. package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
  44. package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
  45. package/dest/cmds/l1/deploy_new_rollup.js +3 -3
  46. package/dest/cmds/l1/get_l1_addresses.d.ts +1 -1
  47. package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
  48. package/dest/cmds/l1/get_l1_addresses.js +5 -2
  49. package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
  50. package/dest/cmds/l1/get_l1_balance.js +4 -2
  51. package/dest/cmds/l1/governance_utils.d.ts +5 -5
  52. package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
  53. package/dest/cmds/l1/governance_utils.js +3 -1
  54. package/dest/cmds/l1/index.d.ts +1 -2
  55. package/dest/cmds/l1/index.d.ts.map +1 -1
  56. package/dest/cmds/l1/index.js +17 -10
  57. package/dest/cmds/l1/prover_stats.d.ts +1 -1
  58. package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
  59. package/dest/cmds/l1/prover_stats.js +32 -30
  60. package/dest/cmds/l1/trigger_seed_snapshot.d.ts +2 -2
  61. package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
  62. package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
  63. package/dest/cmds/l1/update_l1_validators.d.ts +7 -7
  64. package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
  65. package/dest/cmds/l1/update_l1_validators.js +58 -19
  66. package/dest/cmds/misc/compute_selector.d.ts +1 -1
  67. package/dest/cmds/misc/example_contracts.d.ts +1 -1
  68. package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
  69. package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
  70. package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
  71. package/dest/cmds/misc/generate_secret_and_hash.js +1 -1
  72. package/dest/cmds/misc/generate_secret_key.d.ts +1 -1
  73. package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +1 -1
  74. package/dest/cmds/misc/index.d.ts +1 -1
  75. package/dest/cmds/misc/index.d.ts.map +1 -1
  76. package/dest/cmds/misc/index.js +1 -1
  77. package/dest/cmds/misc/update/common.d.ts +1 -1
  78. package/dest/cmds/misc/update/github.d.ts +1 -1
  79. package/dest/cmds/misc/update/noir.d.ts +1 -1
  80. package/dest/cmds/misc/update/npm.d.ts +1 -1
  81. package/dest/cmds/misc/update/npm.js +1 -1
  82. package/dest/cmds/misc/update/utils.d.ts +1 -1
  83. package/dest/cmds/misc/update.d.ts +1 -1
  84. package/dest/cmds/validator_keys/add.d.ts +1 -1
  85. package/dest/cmds/validator_keys/add.d.ts.map +1 -1
  86. package/dest/cmds/validator_keys/add.js +20 -7
  87. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +1 -1
  88. package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -1
  89. package/dest/cmds/validator_keys/generate_bls_keypair.js +3 -2
  90. package/dest/cmds/validator_keys/index.d.ts +1 -1
  91. package/dest/cmds/validator_keys/index.d.ts.map +1 -1
  92. package/dest/cmds/validator_keys/index.js +16 -4
  93. package/dest/cmds/validator_keys/new.d.ts +7 -4
  94. package/dest/cmds/validator_keys/new.d.ts.map +1 -1
  95. package/dest/cmds/validator_keys/new.js +90 -16
  96. package/dest/cmds/validator_keys/shared.d.ts +4 -4
  97. package/dest/cmds/validator_keys/shared.d.ts.map +1 -1
  98. package/dest/cmds/validator_keys/shared.js +31 -28
  99. package/dest/cmds/validator_keys/staker.d.ts +38 -0
  100. package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
  101. package/dest/cmds/validator_keys/staker.js +210 -0
  102. package/dest/cmds/validator_keys/utils.d.ts +25 -0
  103. package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
  104. package/dest/cmds/validator_keys/utils.js +52 -0
  105. package/dest/config/cached_fetch.d.ts +19 -10
  106. package/dest/config/cached_fetch.d.ts.map +1 -1
  107. package/dest/config/cached_fetch.js +110 -32
  108. package/dest/config/chain_l2_config.d.ts +13 -38
  109. package/dest/config/chain_l2_config.d.ts.map +1 -1
  110. package/dest/config/chain_l2_config.js +35 -463
  111. package/dest/config/enrich_env.d.ts +1 -1
  112. package/dest/config/generated/networks.d.ts +221 -0
  113. package/dest/config/generated/networks.d.ts.map +1 -0
  114. package/dest/config/generated/networks.js +222 -0
  115. package/dest/config/get_l1_config.d.ts +3 -2
  116. package/dest/config/get_l1_config.d.ts.map +1 -1
  117. package/dest/config/get_l1_config.js +3 -1
  118. package/dest/config/index.d.ts +1 -1
  119. package/dest/config/network_config.d.ts +7 -4
  120. package/dest/config/network_config.d.ts.map +1 -1
  121. package/dest/config/network_config.js +70 -30
  122. package/dest/utils/aztec.d.ts +7 -13
  123. package/dest/utils/aztec.d.ts.map +1 -1
  124. package/dest/utils/aztec.js +19 -40
  125. package/dest/utils/commands.d.ts +8 -7
  126. package/dest/utils/commands.d.ts.map +1 -1
  127. package/dest/utils/commands.js +6 -5
  128. package/dest/utils/encoding.d.ts +1 -1
  129. package/dest/utils/encoding.js +1 -1
  130. package/dest/utils/github.d.ts +1 -1
  131. package/dest/utils/index.d.ts +1 -1
  132. package/dest/utils/inspect.d.ts +3 -2
  133. package/dest/utils/inspect.d.ts.map +1 -1
  134. package/dest/utils/inspect.js +4 -1
  135. package/dest/utils/setup_contracts.d.ts +1 -1
  136. package/package.json +44 -31
  137. package/public_include_metric_prefixes.json +1 -0
  138. package/src/cmds/aztec_node/get_block.ts +2 -1
  139. package/src/cmds/aztec_node/{get_current_base_fee.ts → get_current_min_fee.ts} +2 -2
  140. package/src/cmds/aztec_node/get_logs.ts +3 -2
  141. package/src/cmds/aztec_node/index.ts +3 -3
  142. package/src/cmds/contracts/inspect_contract.ts +4 -11
  143. package/src/cmds/infrastructure/index.ts +0 -1
  144. package/src/cmds/infrastructure/sequencers.ts +7 -5
  145. package/src/cmds/infrastructure/setup_l2_contract.ts +5 -4
  146. package/src/cmds/l1/assume_proven_through.ts +4 -4
  147. package/src/cmds/l1/bridge_erc20.ts +2 -1
  148. package/src/cmds/l1/compute_genesis_values.ts +29 -0
  149. package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +39 -22
  150. package/src/cmds/l1/deploy_new_rollup.ts +4 -9
  151. package/src/cmds/l1/get_l1_addresses.ts +4 -2
  152. package/src/cmds/l1/get_l1_balance.ts +2 -2
  153. package/src/cmds/l1/governance_utils.ts +3 -8
  154. package/src/cmds/l1/index.ts +30 -21
  155. package/src/cmds/l1/prover_stats.ts +42 -31
  156. package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
  157. package/src/cmds/l1/update_l1_validators.ts +52 -31
  158. package/src/cmds/misc/generate_secret_and_hash.ts +1 -1
  159. package/src/cmds/misc/index.ts +1 -1
  160. package/src/cmds/misc/update/npm.ts +1 -1
  161. package/src/cmds/validator_keys/add.ts +20 -10
  162. package/src/cmds/validator_keys/generate_bls_keypair.ts +3 -2
  163. package/src/cmds/validator_keys/index.ts +67 -21
  164. package/src/cmds/validator_keys/new.ts +110 -23
  165. package/src/cmds/validator_keys/shared.ts +32 -27
  166. package/src/cmds/validator_keys/staker.ts +301 -0
  167. package/src/cmds/validator_keys/utils.ts +81 -0
  168. package/src/config/cached_fetch.ts +119 -31
  169. package/src/config/chain_l2_config.ts +36 -604
  170. package/src/config/generated/networks.ts +226 -0
  171. package/src/config/get_l1_config.ts +4 -1
  172. package/src/config/network_config.ts +80 -31
  173. package/src/utils/aztec.ts +24 -83
  174. package/src/utils/commands.ts +6 -5
  175. package/src/utils/encoding.ts +1 -1
  176. package/src/utils/inspect.ts +6 -2
  177. package/dest/cmds/aztec_node/get_current_base_fee.d.ts +0 -3
  178. package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +0 -1
  179. package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
  180. package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
@@ -0,0 +1,81 @@
1
+ import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { ethPrivateKeySchema } from '@aztec/node-keystore/schemas';
3
+ import type { EthPrivateKey } from '@aztec/node-keystore/types';
4
+
5
+ export const defaultBlsPath = 'm/12381/3600/0/0/0';
6
+
7
+ export function validateBlsPathOptions(options: {
8
+ count?: number;
9
+ publisherCount?: number;
10
+ accountIndex?: number;
11
+ addressIndex?: number;
12
+ blsPath?: string;
13
+ ikm?: string;
14
+ }) {
15
+ if (options.blsPath && options.blsPath !== defaultBlsPath) {
16
+ if (
17
+ (options.count && options.count !== 1) ||
18
+ (options.publisherCount && options.publisherCount > 0) ||
19
+ (options.accountIndex && options.accountIndex !== 0) ||
20
+ (options.addressIndex && options.addressIndex !== 0)
21
+ ) {
22
+ throw new Error('--bls-path cannot be used with --count, --publisher-count, --account-index, or --address-index');
23
+ }
24
+ }
25
+ }
26
+
27
+ export function validateStakerOutputOptions(options: {
28
+ stakerOutput?: boolean;
29
+ gseAddress?: EthAddress;
30
+ l1RpcUrls?: string[];
31
+ l1ChainId?: number;
32
+ }) {
33
+ if (!options.stakerOutput) {
34
+ return;
35
+ }
36
+ // Required options for staker output
37
+ if (!options.gseAddress) {
38
+ throw new Error('--gse-address is required when using --staker-output');
39
+ }
40
+ if (!options.l1RpcUrls || options.l1RpcUrls.length === 0) {
41
+ throw new Error('--l1-rpc-urls is required when using --staker-output');
42
+ }
43
+
44
+ if (options.l1ChainId === undefined) {
45
+ throw new Error('--l1-chain-id is required when using --staker-output');
46
+ }
47
+ }
48
+
49
+ export function validateRemoteSignerOptions(options: { remoteSigner?: string; mnemonic?: string }) {
50
+ if (options.remoteSigner && !options.mnemonic) {
51
+ throw new Error(
52
+ 'Using --remote-signer requires a deterministic key source. Provide --mnemonic to derive keys, or omit --remote-signer to write new private keys to keystore.',
53
+ );
54
+ }
55
+ }
56
+
57
+ export function validatePublisherOptions(options: { publishers?: string[]; publisherCount?: number }) {
58
+ if (options.publisherCount && options.publisherCount > 0 && options.publishers && options.publishers.length > 0) {
59
+ throw new Error('--publishers and --publisher-count cannot be used together');
60
+ }
61
+
62
+ if (options.publishers && options.publishers.length > 0) {
63
+ // Normalize each private key by adding 0x prefix if missing
64
+ const normalizedKeys: string[] = [];
65
+ for (const key of options.publishers) {
66
+ let privateKey = key.trim();
67
+ if (!privateKey.startsWith('0x')) {
68
+ privateKey = '0x' + privateKey;
69
+ }
70
+
71
+ try {
72
+ ethPrivateKeySchema.parse(privateKey);
73
+ normalizedKeys.push(privateKey);
74
+ } catch (error) {
75
+ throw new Error(`Invalid publisher private key: ${error instanceof Error ? error.message : String(error)}`);
76
+ }
77
+ }
78
+ // Update the options with the normalized keys
79
+ options.publishers = normalizedKeys as EthPrivateKey[];
80
+ }
81
+ }
@@ -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
+ }