@aztec/foundation 0.0.1-commit.d1f2d6c → 0.0.1-commit.d20b825a7

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 (237) hide show
  1. package/dest/array/sorted_array.d.ts +6 -1
  2. package/dest/array/sorted_array.d.ts.map +1 -1
  3. package/dest/array/sorted_array.js +18 -15
  4. package/dest/branded-types/buffer32_hash.d.ts +24 -0
  5. package/dest/branded-types/buffer32_hash.d.ts.map +1 -0
  6. package/dest/branded-types/buffer32_hash.js +19 -0
  7. package/dest/branded-types/checkpoint_number.d.ts +4 -1
  8. package/dest/branded-types/checkpoint_number.d.ts.map +1 -1
  9. package/dest/branded-types/checkpoint_number.js +3 -0
  10. package/dest/branded-types/index.d.ts +2 -1
  11. package/dest/branded-types/index.d.ts.map +1 -1
  12. package/dest/branded-types/index.js +1 -0
  13. package/dest/branded-types/slot.d.ts +4 -1
  14. package/dest/branded-types/slot.d.ts.map +1 -1
  15. package/dest/branded-types/slot.js +3 -0
  16. package/dest/buffer/buffer16.d.ts +3 -1
  17. package/dest/buffer/buffer16.d.ts.map +1 -1
  18. package/dest/buffer/buffer32.d.ts +28 -61
  19. package/dest/buffer/buffer32.d.ts.map +1 -1
  20. package/dest/buffer/buffer32.js +26 -60
  21. package/dest/buffer/index.d.ts +2 -1
  22. package/dest/buffer/index.d.ts.map +1 -1
  23. package/dest/buffer/index.js +1 -0
  24. package/dest/buffer/utils.d.ts +3 -0
  25. package/dest/buffer/utils.d.ts.map +1 -0
  26. package/dest/buffer/utils.js +7 -0
  27. package/dest/collection/array.d.ts +9 -1
  28. package/dest/collection/array.d.ts.map +1 -1
  29. package/dest/collection/array.js +39 -0
  30. package/dest/collection/index.d.ts +2 -1
  31. package/dest/collection/index.d.ts.map +1 -1
  32. package/dest/collection/index.js +1 -0
  33. package/dest/collection/lru_set.d.ts +35 -0
  34. package/dest/collection/lru_set.d.ts.map +1 -0
  35. package/dest/collection/lru_set.js +95 -0
  36. package/dest/config/env_var.d.ts +2 -2
  37. package/dest/config/env_var.d.ts.map +1 -1
  38. package/dest/config/index.d.ts +48 -30
  39. package/dest/config/index.d.ts.map +1 -1
  40. package/dest/config/index.js +35 -29
  41. package/dest/config/network_config.d.ts +19 -1
  42. package/dest/config/network_config.d.ts.map +1 -1
  43. package/dest/config/network_config.js +4 -1
  44. package/dest/config/network_name.d.ts +2 -2
  45. package/dest/config/network_name.d.ts.map +1 -1
  46. package/dest/config/network_name.js +2 -0
  47. package/dest/crypto/aes128/index.d.ts +2 -1
  48. package/dest/crypto/aes128/index.d.ts.map +1 -1
  49. package/dest/crypto/aes128/index.js +11 -2
  50. package/dest/crypto/bls/bn254_keystore.d.ts +1 -10
  51. package/dest/crypto/bls/bn254_keystore.d.ts.map +1 -1
  52. package/dest/crypto/bls/bn254_keystore.js +0 -17
  53. package/dest/crypto/poseidon/index.d.ts +1 -1
  54. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  55. package/dest/crypto/poseidon/index.js +40 -33
  56. package/dest/crypto/random/randomness_singleton.d.ts +4 -3
  57. package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
  58. package/dest/crypto/random/randomness_singleton.js +4 -4
  59. package/dest/crypto/secp256k1-signer/utils.d.ts +12 -1
  60. package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
  61. package/dest/crypto/secp256k1-signer/utils.js +26 -0
  62. package/dest/curves/bls12/field.d.ts +1 -1
  63. package/dest/curves/bls12/field.d.ts.map +1 -1
  64. package/dest/curves/bls12/field.js +0 -5
  65. package/dest/curves/bn254/field.d.ts +18 -16
  66. package/dest/curves/bn254/field.d.ts.map +1 -1
  67. package/dest/curves/bn254/field.js +23 -15
  68. package/dest/curves/grumpkin/point.d.ts +4 -4
  69. package/dest/curves/grumpkin/point.d.ts.map +1 -1
  70. package/dest/curves/grumpkin/point.js +7 -4
  71. package/dest/eth-address/index.d.ts +1 -1
  72. package/dest/eth-address/index.d.ts.map +1 -1
  73. package/dest/eth-address/index.js +0 -3
  74. package/dest/eth-signature/eth_signature.d.ts +2 -1
  75. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  76. package/dest/eth-signature/eth_signature.js +7 -2
  77. package/dest/fifo/fifo_frame_reader.d.ts +41 -0
  78. package/dest/fifo/fifo_frame_reader.d.ts.map +1 -0
  79. package/dest/fifo/fifo_frame_reader.js +74 -0
  80. package/dest/fifo/index.d.ts +2 -0
  81. package/dest/fifo/index.d.ts.map +1 -0
  82. package/dest/fifo/index.js +1 -0
  83. package/dest/jest/setup.js +28 -1
  84. package/dest/json-rpc/client/fetch.d.ts +1 -1
  85. package/dest/json-rpc/client/fetch.d.ts.map +1 -1
  86. package/dest/json-rpc/client/fetch.js +4 -3
  87. package/dest/json-rpc/client/safe_json_rpc_client.d.ts +2 -1
  88. package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
  89. package/dest/json-rpc/client/safe_json_rpc_client.js +1 -1
  90. package/dest/json-rpc/client/undici.d.ts +1 -1
  91. package/dest/json-rpc/client/undici.d.ts.map +1 -1
  92. package/dest/json-rpc/client/undici.js +5 -3
  93. package/dest/json-rpc/server/api_key_auth.d.ts +19 -0
  94. package/dest/json-rpc/server/api_key_auth.d.ts.map +1 -0
  95. package/dest/json-rpc/server/api_key_auth.js +57 -0
  96. package/dest/json-rpc/server/index.d.ts +2 -1
  97. package/dest/json-rpc/server/index.d.ts.map +1 -1
  98. package/dest/json-rpc/server/index.js +1 -0
  99. package/dest/log/bigint-utils.d.ts +5 -0
  100. package/dest/log/bigint-utils.d.ts.map +1 -0
  101. package/dest/log/bigint-utils.js +21 -0
  102. package/dest/log/gcloud-logger-config.d.ts +1 -1
  103. package/dest/log/gcloud-logger-config.d.ts.map +1 -1
  104. package/dest/log/gcloud-logger-config.js +3 -0
  105. package/dest/log/libp2p_logger.d.ts +5 -2
  106. package/dest/log/libp2p_logger.d.ts.map +1 -1
  107. package/dest/log/libp2p_logger.js +14 -4
  108. package/dest/log/log-filters.d.ts +17 -4
  109. package/dest/log/log-filters.d.ts.map +1 -1
  110. package/dest/log/log-filters.js +26 -12
  111. package/dest/log/pino-logger-server.d.ts +9 -0
  112. package/dest/log/pino-logger-server.d.ts.map +1 -0
  113. package/dest/log/pino-logger-server.js +18 -0
  114. package/dest/log/pino-logger.d.ts +37 -8
  115. package/dest/log/pino-logger.d.ts.map +1 -1
  116. package/dest/log/pino-logger.js +137 -29
  117. package/dest/queue/base_memory_queue.d.ts +2 -2
  118. package/dest/queue/base_memory_queue.d.ts.map +1 -1
  119. package/dest/queue/batch_queue.d.ts +1 -1
  120. package/dest/queue/batch_queue.d.ts.map +1 -1
  121. package/dest/queue/batch_queue.js +1 -0
  122. package/dest/queue/semaphore.d.ts +5 -1
  123. package/dest/queue/semaphore.d.ts.map +1 -1
  124. package/dest/retry/index.d.ts +12 -1
  125. package/dest/retry/index.d.ts.map +1 -1
  126. package/dest/retry/index.js +21 -0
  127. package/dest/schemas/api.d.ts +2 -2
  128. package/dest/schemas/api.d.ts.map +1 -1
  129. package/dest/serialize/buffer_reader.d.ts +8 -1
  130. package/dest/serialize/buffer_reader.d.ts.map +1 -1
  131. package/dest/serialize/buffer_reader.js +13 -0
  132. package/dest/serialize/serialize.d.ts +19 -1
  133. package/dest/serialize/serialize.d.ts.map +1 -1
  134. package/dest/serialize/serialize.js +31 -0
  135. package/dest/sleep/index.d.ts +2 -1
  136. package/dest/sleep/index.d.ts.map +1 -1
  137. package/dest/sleep/index.js +10 -1
  138. package/dest/string/index.js +1 -1
  139. package/dest/timer/date.d.ts +25 -1
  140. package/dest/timer/date.d.ts.map +1 -1
  141. package/dest/timer/date.js +33 -0
  142. package/dest/transport/dispatch/create_dispatch_proxy.d.ts +11 -2
  143. package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +1 -1
  144. package/dest/transport/index.d.ts +1 -2
  145. package/dest/transport/index.d.ts.map +1 -1
  146. package/dest/transport/index.js +0 -1
  147. package/dest/transport/transport_client.js +2 -2
  148. package/dest/trees/balanced_merkle_tree_root.d.ts +2 -3
  149. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -1
  150. package/dest/trees/balanced_merkle_tree_root.js +2 -3
  151. package/dest/trees/hasher.d.ts +3 -2
  152. package/dest/trees/hasher.d.ts.map +1 -1
  153. package/dest/trees/hasher.js +5 -5
  154. package/dest/trees/indexed_merkle_tree_calculator.d.ts +1 -1
  155. package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
  156. package/dest/trees/indexed_merkle_tree_calculator.js +5 -1
  157. package/dest/trees/merkle_tree_calculator.d.ts +4 -2
  158. package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
  159. package/dest/trees/merkle_tree_calculator.js +1 -5
  160. package/dest/trees/sibling_path.d.ts +2 -2
  161. package/dest/trees/sibling_path.d.ts.map +1 -1
  162. package/dest/trees/sibling_path.js +1 -5
  163. package/dest/trees/unbalanced_merkle_tree_root.d.ts +2 -3
  164. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -1
  165. package/dest/trees/unbalanced_merkle_tree_root.js +2 -3
  166. package/dest/types/index.d.ts +3 -1
  167. package/dest/types/index.d.ts.map +1 -1
  168. package/dest/types/index.js +3 -0
  169. package/package.json +24 -2
  170. package/src/array/sorted_array.ts +22 -17
  171. package/src/branded-types/buffer32_hash.ts +42 -0
  172. package/src/branded-types/checkpoint_number.ts +5 -0
  173. package/src/branded-types/index.ts +1 -0
  174. package/src/branded-types/slot.ts +5 -0
  175. package/src/buffer/buffer16.ts +3 -0
  176. package/src/buffer/buffer32.ts +36 -65
  177. package/src/buffer/index.ts +1 -0
  178. package/src/buffer/utils.ts +8 -0
  179. package/src/collection/array.ts +35 -0
  180. package/src/collection/index.ts +1 -0
  181. package/src/collection/lru_set.ts +115 -0
  182. package/src/config/env_var.ts +63 -12
  183. package/src/config/index.ts +110 -83
  184. package/src/config/network_config.ts +3 -0
  185. package/src/config/network_name.ts +4 -1
  186. package/src/crypto/aes128/index.ts +11 -2
  187. package/src/crypto/bls/bn254_keystore.ts +0 -23
  188. package/src/crypto/poseidon/index.ts +42 -34
  189. package/src/crypto/random/randomness_singleton.ts +9 -5
  190. package/src/crypto/secp256k1-signer/utils.ts +32 -0
  191. package/src/curves/bls12/field.ts +0 -7
  192. package/src/curves/bn254/field.ts +31 -33
  193. package/src/curves/grumpkin/point.ts +6 -3
  194. package/src/eth-address/index.ts +0 -4
  195. package/src/eth-signature/eth_signature.ts +7 -1
  196. package/src/fifo/fifo_frame_reader.ts +98 -0
  197. package/src/fifo/index.ts +1 -0
  198. package/src/jest/setup.mjs +31 -1
  199. package/src/json-rpc/client/fetch.ts +4 -3
  200. package/src/json-rpc/client/safe_json_rpc_client.ts +2 -0
  201. package/src/json-rpc/client/undici.ts +5 -3
  202. package/src/json-rpc/server/api_key_auth.ts +63 -0
  203. package/src/json-rpc/server/index.ts +1 -0
  204. package/src/log/bigint-utils.ts +25 -0
  205. package/src/log/gcloud-logger-config.ts +5 -0
  206. package/src/log/libp2p_logger.ts +12 -5
  207. package/src/log/log-filters.ts +29 -11
  208. package/src/log/pino-logger-server.ts +25 -0
  209. package/src/log/pino-logger.ts +160 -39
  210. package/src/queue/base_memory_queue.ts +1 -1
  211. package/src/queue/batch_queue.ts +1 -0
  212. package/src/queue/semaphore.ts +5 -0
  213. package/src/retry/index.ts +30 -0
  214. package/src/schemas/api.ts +4 -1
  215. package/src/serialize/buffer_reader.ts +15 -0
  216. package/src/serialize/serialize.ts +32 -0
  217. package/src/sleep/index.ts +10 -1
  218. package/src/string/index.ts +1 -1
  219. package/src/timer/date.ts +48 -0
  220. package/src/transport/dispatch/create_dispatch_proxy.ts +11 -1
  221. package/src/transport/index.ts +0 -1
  222. package/src/transport/transport_client.ts +2 -2
  223. package/src/trees/balanced_merkle_tree_root.ts +2 -5
  224. package/src/trees/hasher.ts +6 -3
  225. package/src/trees/indexed_merkle_tree_calculator.ts +5 -1
  226. package/src/trees/merkle_tree_calculator.ts +4 -10
  227. package/src/trees/sibling_path.ts +1 -2
  228. package/src/trees/unbalanced_merkle_tree_root.ts +2 -5
  229. package/src/types/index.ts +5 -0
  230. package/dest/crypto/serialize.d.ts +0 -51
  231. package/dest/crypto/serialize.d.ts.map +0 -1
  232. package/dest/crypto/serialize.js +0 -68
  233. package/dest/transport/dispatch/create_dispatch_fn.d.ts +0 -25
  234. package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +0 -1
  235. package/dest/transport/dispatch/create_dispatch_fn.js +0 -17
  236. package/src/crypto/serialize.ts +0 -85
  237. package/src/transport/dispatch/create_dispatch_fn.ts +0 -35
@@ -1,17 +1,21 @@
1
1
  export type EnvVar =
2
2
  | 'REGISTRY_CONTRACT_ADDRESS'
3
3
  | 'FEE_ASSET_HANDLER_CONTRACT_ADDRESS'
4
- | 'SLASH_FACTORY_CONTRACT_ADDRESS'
5
4
  | 'ACVM_BINARY_PATH'
6
5
  | 'ACVM_WORKING_DIRECTORY'
7
6
  | 'API_KEY'
8
7
  | 'API_PREFIX'
9
8
  | 'ARCHIVER_MAX_LOGS'
10
9
  | 'ARCHIVER_POLLING_INTERVAL_MS'
10
+ | 'ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK'
11
11
  | 'ARCHIVER_URL'
12
12
  | 'ARCHIVER_VIEM_POLLING_INTERVAL_MS'
13
13
  | 'ARCHIVER_BATCH_SIZE'
14
14
  | 'AZTEC_ADMIN_PORT'
15
+ | 'AZTEC_NODE_DEBUG'
16
+ | 'AZTEC_ADMIN_API_KEY_HASH'
17
+ | 'AZTEC_DISABLE_ADMIN_API_KEY'
18
+ | 'AZTEC_RESET_ADMIN_API_KEY'
15
19
  | 'AZTEC_NODE_ADMIN_URL'
16
20
  | 'AZTEC_NODE_URL'
17
21
  | 'AZTEC_PORT'
@@ -20,6 +24,8 @@ export type EnvVar =
20
24
  | 'BB_WORKING_DIRECTORY'
21
25
  | 'BB_NUM_IVC_VERIFIERS'
22
26
  | 'BB_IVC_CONCURRENCY'
27
+ | 'BB_CHONK_VERIFY_MAX_BATCH'
28
+ | 'BB_CHONK_VERIFY_BATCH_CONCURRENCY'
23
29
  | 'BOOTSTRAP_NODES'
24
30
  | 'BLOB_ARCHIVE_API_URL'
25
31
  | 'BLOB_FILE_STORE_URLS'
@@ -47,7 +53,10 @@ export type EnvVar =
47
53
  | 'BOT_TX_MINED_WAIT_SECONDS'
48
54
  | 'BOT_MAX_CONSECUTIVE_ERRORS'
49
55
  | 'BOT_STOP_WHEN_UNHEALTHY'
50
- | 'BOT_AMM_TXS'
56
+ | 'BOT_MODE'
57
+ | 'BOT_L2_TO_L1_MESSAGES_PER_TX'
58
+ | 'BOT_L1_TO_L2_SEED_COUNT'
59
+ | 'BOT_L1_TO_L2_SEED_INTERVAL'
51
60
  | 'COINBASE'
52
61
  | 'CRS_PATH'
53
62
  | 'DATA_DIRECTORY'
@@ -56,6 +65,7 @@ export type EnvVar =
56
65
  | 'BLOB_SINK_MAP_SIZE_KB'
57
66
  | 'P2P_STORE_MAP_SIZE_KB'
58
67
  | 'PROVER_BROKER_STORE_MAP_SIZE_KB'
68
+ | 'SIGNING_PROTECTION_MAP_SIZE_KB'
59
69
  | 'WS_DB_MAP_SIZE_KB'
60
70
  | 'ARCHIVE_TREE_MAP_SIZE_KB'
61
71
  | 'NULLIFIER_TREE_MAP_SIZE_KB'
@@ -64,6 +74,7 @@ export type EnvVar =
64
74
  | 'PUBLIC_DATA_TREE_MAP_SIZE_KB'
65
75
  | 'DEBUG'
66
76
  | 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
77
+ | 'ENABLE_PROVER_NODE'
67
78
  | 'ETHEREUM_HOSTS'
68
79
  | 'ETHEREUM_DEBUG_HOSTS'
69
80
  | 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS'
@@ -73,15 +84,17 @@ export type EnvVar =
73
84
  | 'KEY_STORE_DIRECTORY'
74
85
  | 'L1_CHAIN_ID'
75
86
  | 'L1_CONSENSUS_HOST_URLS'
87
+ | 'ETHEREUM_HTTP_TIMEOUT_MS'
76
88
  | 'L1_CONSENSUS_HOST_API_KEYS'
77
89
  | 'L1_CONSENSUS_HOST_API_KEY_HEADERS'
90
+ | 'L1_TX_FAILED_STORE'
78
91
  | 'LOG_JSON'
79
92
  | 'LOG_MULTILINE'
93
+ | 'LOG_NO_COLOR_PER_ACTOR'
80
94
  | 'LOG_LEVEL'
81
95
  | 'MNEMONIC'
82
96
  | 'NETWORK'
83
97
  | 'NETWORK_CONFIG_LOCATION'
84
- | 'NO_PXE'
85
98
  | 'USE_GCLOUD_LOGGING'
86
99
  | 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'
87
100
  | 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT'
@@ -94,7 +107,12 @@ export type EnvVar =
94
107
  | 'PUBLIC_OTEL_INCLUDE_METRICS'
95
108
  | 'PUBLIC_OTEL_COLLECT_FROM'
96
109
  | 'PUBLIC_OTEL_OPT_OUT'
110
+ | 'P2P_BATCH_TX_REQUESTER_SMART_PARALLEL_WORKER_COUNT'
111
+ | 'P2P_BATCH_TX_REQUESTER_DUMB_PARALLEL_WORKER_COUNT'
112
+ | 'P2P_BATCH_TX_REQUESTER_TX_BATCH_SIZE'
113
+ | 'P2P_BATCH_TX_REQUESTER_BAD_PEER_THRESHOLD'
97
114
  | 'P2P_BLOCK_CHECK_INTERVAL_MS'
115
+ | 'P2P_SLOT_CHECK_INTERVAL_MS'
98
116
  | 'P2P_BLOCK_REQUEST_BATCH_SIZE'
99
117
  | 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK'
100
118
  | 'P2P_BOOTSTRAP_NODES_AS_FULL_PEERS'
@@ -115,6 +133,7 @@ export type EnvVar =
115
133
  | 'P2P_L2_QUEUE_SIZE'
116
134
  | 'P2P_MAX_PEERS'
117
135
  | 'P2P_PEER_CHECK_INTERVAL_MS'
136
+ | 'P2P_PEER_FAILED_BAN_TIME_MS'
118
137
  | 'P2P_PEER_PENALTY_VALUES'
119
138
  | 'P2P_QUERY_FOR_IP'
120
139
  | 'P2P_REQRESP_INDIVIDUAL_REQUEST_TIMEOUT_MS'
@@ -135,9 +154,10 @@ export type EnvVar =
135
154
  | 'P2P_PREFERRED_PEERS'
136
155
  | 'P2P_MAX_PENDING_TX_COUNT'
137
156
  | 'P2P_SEEN_MSG_CACHE_SIZE'
138
- | 'P2P_DROP_TX'
139
157
  | 'P2P_DROP_TX_CHANCE'
140
158
  | 'P2P_TX_POOL_DELETE_TXS_AFTER_REORG'
159
+ | 'P2P_MIN_TX_POOL_AGE_MS'
160
+ | 'P2P_RPC_PRICE_BUMP_PERCENTAGE'
141
161
  | 'DEBUG_P2P_INSTRUMENT_MESSAGES'
142
162
  | 'PEER_ID_PRIVATE_KEY'
143
163
  | 'PEER_ID_PRIVATE_KEY_PATH'
@@ -151,8 +171,11 @@ export type EnvVar =
151
171
  | 'PROVER_BROKER_BATCH_INTERVAL_MS'
152
172
  | 'PROVER_BROKER_BATCH_SIZE'
153
173
  | 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
174
+ | 'PROVER_BROKER_DEBUG_REPLAY_ENABLED'
154
175
  | 'PROVER_CANCEL_JOBS_ON_STOP'
176
+ | 'PROVER_ENQUEUE_CONCURRENCY'
155
177
  | 'PROVER_COORDINATION_NODE_URLS'
178
+ | 'PROVER_PROOF_STORE'
156
179
  | 'PROVER_FAILED_PROOF_STORE'
157
180
  | 'PROVER_NODE_FAILED_EPOCH_STORE'
158
181
  | 'PROVER_NODE_DISABLE_PROOF_PUBLISH'
@@ -184,27 +207,33 @@ export type EnvVar =
184
207
  | 'SENTINEL_ENABLED'
185
208
  | 'SENTINEL_HISTORY_LENGTH_IN_EPOCHS'
186
209
  | 'SENTINEL_HISTORIC_PROVEN_PERFORMANCE_LENGTH_IN_EPOCHS'
187
- | 'SEQ_MAX_BLOCK_SIZE_IN_BYTES'
210
+ | 'SEQ_ENABLE_PROPOSER_PIPELINING'
188
211
  | 'SEQ_MAX_TX_PER_BLOCK'
212
+ | 'SEQ_MAX_TX_PER_CHECKPOINT'
189
213
  | 'SEQ_MIN_TX_PER_BLOCK'
190
214
  | 'SEQ_PUBLISH_TXS_WITH_PROPOSALS'
191
215
  | 'SEQ_MAX_DA_BLOCK_GAS'
192
216
  | 'SEQ_MAX_L2_BLOCK_GAS'
217
+ | 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER'
218
+ | 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET'
193
219
  | 'SEQ_PUBLISHER_PRIVATE_KEY'
194
220
  | 'SEQ_PUBLISHER_PRIVATE_KEYS'
195
221
  | 'SEQ_PUBLISHER_ADDRESSES'
196
222
  | 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
197
223
  | 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
224
+ | 'PUBLISHER_FUNDING_THRESHOLD'
225
+ | 'PUBLISHER_FUNDING_AMOUNT'
198
226
  | 'SEQ_POLLING_INTERVAL_MS'
199
227
  | 'SEQ_ENFORCE_TIME_TABLE'
200
228
  | 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
201
229
  | 'SEQ_ATTESTATION_PROPAGATION_TIME'
202
230
  | 'SEQ_BLOCK_DURATION_MS'
231
+ | 'SEQ_LAST_BLOCK_DURATION_MS'
232
+ | 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT'
203
233
  | 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
204
234
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
205
235
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
206
- | 'SLASH_MIN_PENALTY_PERCENTAGE'
207
- | 'SLASH_MAX_PENALTY_PERCENTAGE'
236
+ | 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT'
208
237
  | 'SLASH_VALIDATORS_ALWAYS'
209
238
  | 'SLASH_VALIDATORS_NEVER'
210
239
  | 'SLASH_PRUNE_PENALTY'
@@ -213,6 +242,8 @@ export type EnvVar =
213
242
  | 'SLASH_INACTIVITY_TARGET_PERCENTAGE'
214
243
  | 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD'
215
244
  | 'SLASH_INVALID_BLOCK_PENALTY'
245
+ | 'SLASH_DUPLICATE_PROPOSAL_PENALTY'
246
+ | 'SLASH_DUPLICATE_ATTESTATION_PENALTY'
216
247
  | 'SLASH_OVERRIDE_PAYLOAD'
217
248
  | 'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY'
218
249
  | 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY'
@@ -227,6 +258,7 @@ export type EnvVar =
227
258
  | 'TELEMETRY'
228
259
  | 'TEST_ACCOUNTS'
229
260
  | 'SPONSORED_FPC'
261
+ | 'PREFUND_ADDRESSES'
230
262
  | 'TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS'
231
263
  | 'TX_COLLECTION_SLOW_NODES_INTERVAL_MS'
232
264
  | 'TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS'
@@ -237,20 +269,38 @@ export type EnvVar =
237
269
  | 'TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE'
238
270
  | 'TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE'
239
271
  | 'TX_COLLECTION_NODE_RPC_URLS'
272
+ | 'TX_COLLECTION_MISSING_TXS_COLLECTOR_TYPE'
273
+ | 'TX_COLLECTION_FILE_STORE_URLS'
274
+ | 'TX_COLLECTION_FILE_STORE_SLOW_DELAY_MS'
275
+ | 'TX_COLLECTION_FILE_STORE_FAST_DELAY_MS'
276
+ | 'TX_COLLECTION_FILE_STORE_FAST_WORKER_COUNT'
277
+ | 'TX_COLLECTION_FILE_STORE_SLOW_WORKER_COUNT'
278
+ | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_BASE_MS'
279
+ | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_BASE_MS'
280
+ | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_MAX_MS'
281
+ | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_MAX_MS'
282
+ | 'TX_FILE_STORE_URL'
283
+ | 'TX_FILE_STORE_UPLOAD_CONCURRENCY'
284
+ | 'TX_FILE_STORE_MAX_QUEUE_SIZE'
285
+ | 'TX_FILE_STORE_ENABLED'
240
286
  | 'TX_PUBLIC_SETUP_ALLOWLIST'
241
287
  | 'TXE_PORT'
242
288
  | 'TRANSACTIONS_DISABLED'
243
289
  | 'VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS'
244
290
  | 'VALIDATOR_DISABLED'
291
+ | 'VALIDATOR_MAX_DA_BLOCK_GAS'
292
+ | 'VALIDATOR_MAX_L2_BLOCK_GAS'
293
+ | 'VALIDATOR_MAX_TX_PER_BLOCK'
294
+ | 'VALIDATOR_MAX_TX_PER_CHECKPOINT'
245
295
  | 'VALIDATOR_PRIVATE_KEYS'
246
296
  | 'VALIDATOR_PRIVATE_KEY'
247
- | 'VALIDATOR_REEXECUTE'
248
297
  | 'VALIDATOR_ADDRESSES'
249
298
  | 'ROLLUP_VERSION'
250
299
  | 'WS_BLOCK_CHECK_INTERVAL_MS'
251
300
  | 'WS_BLOCK_REQUEST_BATCH_SIZE'
252
301
  | 'L1_READER_VIEM_POLLING_INTERVAL_MS'
253
302
  | 'WS_DATA_DIRECTORY'
303
+ | 'WS_NUM_HISTORIC_CHECKPOINTS'
254
304
  | 'WS_NUM_HISTORIC_BLOCKS'
255
305
  | 'ETHEREUM_SLOT_DURATION'
256
306
  | 'AZTEC_SLOT_DURATION'
@@ -276,7 +326,7 @@ export type EnvVar =
276
326
  | 'AZTEC_SLASH_AMOUNT_SMALL'
277
327
  | 'AZTEC_SLASH_AMOUNT_MEDIUM'
278
328
  | 'AZTEC_SLASH_AMOUNT_LARGE'
279
- | 'AZTEC_SLASHER_FLAVOR'
329
+ | 'AZTEC_SLASHER_ENABLED'
280
330
  | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
281
331
  | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
282
332
  | 'AZTEC_GOVERNANCE_VOTING_DURATION'
@@ -305,12 +355,12 @@ export type EnvVar =
305
355
  | 'K8S_POD_NAME'
306
356
  | 'K8S_POD_UID'
307
357
  | 'K8S_NAMESPACE_NAME'
308
- | 'VALIDATOR_REEXECUTE_DEADLINE_MS'
309
- | 'AUTO_UPDATE'
310
- | 'AUTO_UPDATE_URL'
358
+ | 'ENABLE_VERSION_CHECK'
311
359
  | 'WEB3_SIGNER_URL'
312
360
  | 'SKIP_ARCHIVER_INITIAL_SYNC'
313
361
  | 'BLOB_ALLOW_EMPTY_SOURCES'
362
+ | 'BLOB_PREFER_FILESTORES'
363
+ | 'BLOB_FILE_STORE_TIMEOUT_MS'
314
364
  | 'FISHERMAN_MODE'
315
365
  | 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
316
366
  | 'LEGACY_BLS_CLI'
@@ -320,6 +370,7 @@ export type EnvVar =
320
370
  | 'VALIDATOR_HA_POLLING_INTERVAL_MS'
321
371
  | 'VALIDATOR_HA_SIGNING_TIMEOUT_MS'
322
372
  | 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS'
373
+ | 'VALIDATOR_HA_OLD_DUTIES_MAX_AGE_H'
323
374
  | 'VALIDATOR_HA_DATABASE_URL'
324
375
  | 'VALIDATOR_HA_RUN_MIGRATIONS'
325
376
  | 'VALIDATOR_HA_POOL_MAX'
@@ -10,14 +10,15 @@ export type { EnvVar, NetworkNames };
10
10
  export type { NetworkConfig, NetworkConfigMap } from './network_config.js';
11
11
  export { NetworkConfigMapSchema, NetworkConfigSchema } from './network_config.js';
12
12
 
13
- export interface ConfigMapping {
13
+ export interface ConfigMapping<T> {
14
14
  env?: EnvVar;
15
- parseEnv?: (val: string) => any;
16
- defaultValue?: any;
15
+ /** Parse an env-var string into `T`. Throws on invalid input. */
16
+ parseEnv?: (val: string) => T;
17
+ defaultValue?: T;
17
18
  printDefault?: (val: any) => string;
18
19
  description: string;
19
20
  isBoolean?: boolean;
20
- nested?: Record<string, ConfigMapping>;
21
+ nested?: Record<string, ConfigMapping<any>>;
21
22
  fallback?: EnvVar[];
22
23
  /**
23
24
  * List of deprecated env vars that are still supported but will log a warning.
@@ -30,7 +31,9 @@ export function isBooleanConfigValue<T>(obj: T, key: keyof T): boolean {
30
31
  return typeof obj[key] === 'boolean';
31
32
  }
32
33
 
33
- export type ConfigMappingsType<T> = Record<keyof T, ConfigMapping>;
34
+ export type ConfigMappingsType<T> = {
35
+ [K in keyof T]-?: ConfigMapping<Required<T>[K]>;
36
+ };
34
37
 
35
38
  /**
36
39
  * Shared utility function to get a value from environment variables with fallback support.
@@ -66,8 +69,8 @@ export function getValueFromEnvWithFallback<T>(
66
69
  }
67
70
  }
68
71
 
69
- // Parse the value if needed
70
- if (value !== undefined) {
72
+ // Parse the value if needed. Empty strings are treated as "not set".
73
+ if (value !== undefined && value !== '') {
71
74
  return parseFunc ? parseFunc(value) : (value as unknown as T);
72
75
  }
73
76
 
@@ -84,7 +87,11 @@ export function getConfigFromMappings<T>(configMappings: ConfigMappingsType<T>):
84
87
  (config as any)[key] = getConfigFromMappings(nested);
85
88
  } else {
86
89
  // Use the shared utility function
87
- (config as any)[key] = getValueFromEnvWithFallback(env, parseEnv, defaultValue, fallback);
90
+ try {
91
+ (config as any)[key] = getValueFromEnvWithFallback(env, parseEnv, defaultValue, fallback);
92
+ } catch (e: any) {
93
+ throw new Error(`Failed to parse config '${key}' (env: ${env ?? 'none'}): ${e.message}`);
94
+ }
88
95
 
89
96
  // Check for deprecated env vars and warn if logger is set
90
97
  if (deprecatedFallback?.length) {
@@ -123,7 +130,7 @@ export function omitConfigMappings<T, K extends keyof T>(
123
130
  * @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
124
131
  * @returns Object with parseEnv and default values for a numerical config value
125
132
  */
126
- export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
133
+ export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
127
134
  return {
128
135
  parseEnv: (val: string) => safeParseNumber(val, defaultVal),
129
136
  defaultValue: defaultVal,
@@ -138,7 +145,7 @@ export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping, 'par
138
145
  export function floatConfigHelper(
139
146
  defaultVal: number,
140
147
  validationFn?: (val: number) => void,
141
- ): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
148
+ ): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
142
149
  return {
143
150
  parseEnv: (val: string): number => {
144
151
  const parsed = safeParseFloat(val, defaultVal);
@@ -152,7 +159,7 @@ export function floatConfigHelper(
152
159
  /**
153
160
  * Parses an environment variable to a 0-1 percentage value
154
161
  */
155
- export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
162
+ export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
156
163
  return {
157
164
  parseEnv: (val: string): number => {
158
165
  const parsed = safeParseFloat(val, defaultVal);
@@ -171,11 +178,27 @@ export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping,
171
178
  * @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
172
179
  * @returns Object with parseEnv and default values for a numerical config value
173
180
  */
174
- export function bigintConfigHelper(defaultVal?: bigint): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
181
+ export function bigintConfigHelper(defaultVal: bigint): Pick<ConfigMapping<bigint>, 'parseEnv' | 'defaultValue'>;
182
+ export function bigintConfigHelper(): Pick<ConfigMapping<bigint | undefined>, 'parseEnv' | 'defaultValue'>;
183
+ export function bigintConfigHelper(
184
+ defaultVal?: bigint,
185
+ ): Pick<ConfigMapping<bigint | undefined>, 'parseEnv' | 'defaultValue'> {
175
186
  return {
176
187
  parseEnv: (val: string) => {
177
- if (val === '') {
178
- return defaultVal;
188
+ // Handle scientific notation (e.g. "1e+23", "2E23") which BigInt() doesn't accept directly.
189
+ // We parse it losslessly using bigint arithmetic instead of going through float64.
190
+ if (/[eE]/.test(val)) {
191
+ const match = val.match(/^(-?\d+(?:\.(\d+))?)[eE]([+-]?\d+)$/);
192
+ if (!match) {
193
+ throw new Error(`Cannot convert '${val}' to a BigInt`);
194
+ }
195
+ const digits = match[1].replace('.', '');
196
+ const decimalPlaces = match[2]?.length ?? 0;
197
+ const exponent = parseInt(match[3], 10) - decimalPlaces;
198
+ if (exponent < 0) {
199
+ throw new Error(`Cannot convert '${val}' to a BigInt: result is not an integer`);
200
+ }
201
+ return BigInt(digits) * 10n ** BigInt(exponent);
179
202
  }
180
203
  return BigInt(val);
181
204
  },
@@ -185,32 +208,37 @@ export function bigintConfigHelper(defaultVal?: bigint): Pick<ConfigMapping, 'pa
185
208
 
186
209
  /**
187
210
  * Generates parseEnv for an optional numerical config value.
211
+ * Empty strings are already handled by getValueFromEnvWithFallback.
188
212
  */
189
- export function optionalNumberConfigHelper(): Pick<ConfigMapping, 'parseEnv'> {
213
+ export function optionalNumberConfigHelper(): Pick<ConfigMapping<number>, 'parseEnv'> {
190
214
  return {
191
- parseEnv: (val: string | undefined) => {
192
- if (val !== undefined && val.length > 0) {
193
- const parsedValue = parseInt(val);
194
- return Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
215
+ parseEnv: (val: string) => {
216
+ const parsedValue = parseInt(val);
217
+ if (!Number.isSafeInteger(parsedValue)) {
218
+ throw new Error(`Invalid number: ${val}`);
195
219
  }
196
- return undefined;
220
+ return parsedValue;
197
221
  },
198
222
  };
199
223
  }
200
224
 
201
225
  /** Generates parseEnv for an enum-like config value. */
226
+ export function enumConfigHelper<T extends string>(
227
+ values: T[],
228
+ defaultValue: NoInfer<T>,
229
+ ): Pick<ConfigMapping<T>, 'parseEnv' | 'defaultValue'>;
230
+ export function enumConfigHelper<T extends string>(
231
+ values: T[],
232
+ ): Pick<ConfigMapping<T | undefined>, 'parseEnv' | 'defaultValue'>;
202
233
  export function enumConfigHelper<T extends string>(
203
234
  values: T[],
204
235
  defaultValue?: NoInfer<T>,
205
- ): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
236
+ ): Pick<ConfigMapping<T | undefined>, 'parseEnv' | 'defaultValue'> {
206
237
  return {
207
238
  parseEnv: (val: string) => {
208
- const sanitizedVal = (val ?? '').trim().toLowerCase();
209
- if (values.includes(sanitizedVal as T)) {
210
- return sanitizedVal as T;
211
- }
212
- if (!val && defaultValue) {
213
- return defaultValue;
239
+ const sanitizedVal = val.trim().toLowerCase();
240
+ if (values.some(v => v.toLowerCase() === sanitizedVal)) {
241
+ return values.find(v => v.toLowerCase() === sanitizedVal)!;
214
242
  }
215
243
  throw new Error(`Invalid config value '${val}' (must be one of ${values.join(', ')})`);
216
244
  },
@@ -225,7 +253,9 @@ export function enumConfigHelper<T extends string>(
225
253
  */
226
254
  export function booleanConfigHelper(
227
255
  defaultVal = false,
228
- ): Required<Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & { parseVal: (val: string) => boolean }> {
256
+ ): Required<
257
+ Pick<ConfigMapping<boolean>, 'parseEnv' | 'defaultValue' | 'isBoolean'> & { parseVal: (val: string) => boolean }
258
+ > {
229
259
  const parse = (val: string | boolean) => (typeof val === 'boolean' ? val : parseBooleanEnv(val));
230
260
  return {
231
261
  parseEnv: parse,
@@ -235,91 +265,88 @@ export function booleanConfigHelper(
235
265
  };
236
266
  }
237
267
 
238
- export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T): Required<
239
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
240
- parseVal: (val: string) => SecretValue<T>;
241
- }
242
- > {
268
+ export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T): Pick<
269
+ ConfigMapping<SecretValue<T>>,
270
+ 'parseEnv' | 'defaultValue'
271
+ > & {
272
+ parseVal: (val: string) => SecretValue<T>;
273
+ } {
243
274
  const wrap = (val: string) => new SecretValue(parse(val));
244
275
  return {
245
276
  parseEnv: wrap,
246
277
  parseVal: wrap,
247
278
  defaultValue: new SecretValue(parse(undefined)),
248
- isBoolean: true,
249
279
  };
250
280
  }
251
281
 
252
282
  export { parseBooleanEnv } from './parse-env.js';
253
283
 
254
- export function secretStringConfigHelper(): Required<
255
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
256
- parseVal: (val: string) => SecretValue<string | undefined>;
257
- }
258
- >;
259
- export function secretStringConfigHelper(defaultValue: string): Required<
260
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
261
- parseVal: (val: string) => SecretValue<string>;
262
- }
263
- >;
264
- export function secretStringConfigHelper(defaultValue?: string): Required<
265
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
266
- parseVal: (val: string) => SecretValue<string | typeof defaultValue>;
267
- }
268
- > {
284
+ export function secretStringConfigHelper(): {
285
+ parseEnv: (val: string) => SecretValue<string>;
286
+ parseVal: (val: string) => SecretValue<string>;
287
+ defaultValue: undefined;
288
+ };
289
+ export function secretStringConfigHelper(defaultValue: string): {
290
+ parseEnv: (val: string) => SecretValue<string>;
291
+ parseVal: (val: string) => SecretValue<string>;
292
+ defaultValue: SecretValue<string>;
293
+ };
294
+ export function secretStringConfigHelper(defaultValue?: string): {
295
+ parseEnv: (val: string) => SecretValue<string>;
296
+ parseVal: (val: string) => SecretValue<string>;
297
+ defaultValue: SecretValue<string> | undefined;
298
+ } {
269
299
  const parse = (val: string) => new SecretValue(val);
270
300
  return {
271
301
  parseEnv: parse,
272
302
  parseVal: parse,
273
303
  defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
274
- isBoolean: true,
275
304
  };
276
305
  }
277
306
 
278
- export function secretFrConfigHelper(): Required<
279
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
280
- parseVal: (val: string) => SecretValue<Fr | undefined>;
281
- }
282
- >;
283
- export function secretFrConfigHelper(defaultValue: Fr): Required<
284
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
285
- parseVal: (val: string) => SecretValue<Fr>;
286
- }
287
- >;
288
- export function secretFrConfigHelper(defaultValue?: Fr): Required<
289
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
290
- parseVal: (val: string) => SecretValue<Fr | typeof defaultValue>;
291
- }
292
- > {
307
+ export function secretFrConfigHelper(): {
308
+ parseEnv: (val: string) => SecretValue<Fr>;
309
+ parseVal: (val: string) => SecretValue<Fr>;
310
+ defaultValue: undefined;
311
+ };
312
+ export function secretFrConfigHelper(defaultValue: Fr): {
313
+ parseEnv: (val: string) => SecretValue<Fr>;
314
+ parseVal: (val: string) => SecretValue<Fr>;
315
+ defaultValue: SecretValue<Fr>;
316
+ };
317
+ export function secretFrConfigHelper(defaultValue?: Fr): {
318
+ parseEnv: (val: string) => SecretValue<Fr>;
319
+ parseVal: (val: string) => SecretValue<Fr>;
320
+ defaultValue: SecretValue<Fr> | undefined;
321
+ } {
293
322
  const parse = (val: string) => new SecretValue(Fr.fromHexString(val));
294
323
  return {
295
324
  parseEnv: parse,
296
325
  parseVal: parse,
297
326
  defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
298
- isBoolean: true,
299
327
  };
300
328
  }
301
329
 
302
- export function secretFqConfigHelper(defaultValue: Fq): Required<
303
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
304
- parseVal: (val: string) => SecretValue<Fq>;
305
- }
306
- >;
307
- export function secretFqConfigHelper(): Required<
308
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
309
- parseVal: (val: string) => SecretValue<Fq | undefined>;
310
- }
311
- >;
312
- export function secretFqConfigHelper(defaultValue?: Fq): Required<
313
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
314
- parseVal: (val: string) => SecretValue<Fq | typeof defaultValue>;
315
- }
316
- > {
330
+ export function secretFqConfigHelper(): {
331
+ parseEnv: (val: string) => SecretValue<Fq>;
332
+ parseVal: (val: string) => SecretValue<Fq>;
333
+ defaultValue: undefined;
334
+ };
335
+ export function secretFqConfigHelper(defaultValue: Fq): {
336
+ parseEnv: (val: string) => SecretValue<Fq>;
337
+ parseVal: (val: string) => SecretValue<Fq>;
338
+ defaultValue: SecretValue<Fq>;
339
+ };
340
+ export function secretFqConfigHelper(defaultValue?: Fq): {
341
+ parseEnv: (val: string) => SecretValue<Fq>;
342
+ parseVal: (val: string) => SecretValue<Fq>;
343
+ defaultValue: SecretValue<Fq> | undefined;
344
+ } {
317
345
  const parse = (val: string) => new SecretValue(Fq.fromHexString(val));
318
346
  return {
319
347
  parseEnv: parse,
320
348
  parseVal: parse,
321
- defaultValue: typeof defaultValue !== 'undefined' ? new SecretValue(defaultValue) : undefined,
322
- isBoolean: true,
349
+ defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
323
350
  };
324
351
  }
325
352
 
@@ -5,10 +5,13 @@ export const NetworkConfigSchema = z
5
5
  bootnodes: z.array(z.string()),
6
6
  snapshots: z.array(z.string()),
7
7
  blobFileStoreUrls: z.array(z.string()).optional(),
8
+ txCollectionFileStoreUrls: z.array(z.string()).optional(),
8
9
  registryAddress: z.string(),
9
10
  feeAssetHandlerAddress: z.string().optional(),
10
11
  l1ChainId: z.number(),
11
12
  blockDurationMs: z.number().positive().optional(),
13
+ txPublicSetupAllowListExtend: z.string().optional(),
14
+ nodeVersion: z.string().optional(),
12
15
  })
13
16
  .passthrough(); // Allow additional unknown fields to pass through
14
17
 
@@ -5,7 +5,8 @@ export type NetworkNames =
5
5
  | 'testnet'
6
6
  | 'mainnet'
7
7
  | 'next-net'
8
- | 'devnet';
8
+ | 'devnet'
9
+ | `v${number}-devnet-${number}`;
9
10
 
10
11
  export function getActiveNetworkName(name?: string): NetworkNames {
11
12
  const network = name || process.env.NETWORK;
@@ -23,6 +24,8 @@ export function getActiveNetworkName(name?: string): NetworkNames {
23
24
  return 'next-net';
24
25
  } else if (network === 'devnet') {
25
26
  return 'devnet';
27
+ } else if (/^v\d+-devnet-\d+$/.test(network)) {
28
+ return network as `v${number}-devnet-${number}`;
26
29
  }
27
30
  throw new Error(`Unknown network: ${network}`);
28
31
  }
@@ -59,10 +59,19 @@ export class Aes128 {
59
59
  * @param iv - AES initialization vector.
60
60
  * @param key - Key to decrypt with.
61
61
  * @returns Decrypted data.
62
+ * @throws If the decrypted buffer has invalid PKCS#7 padding.
62
63
  */
63
64
  public async decryptBufferCBC(data: Uint8Array, iv: Uint8Array, key: Uint8Array) {
64
65
  const paddedBuffer = await this.decryptBufferCBCKeepPadding(data, iv, key);
65
- const paddingToRemove = paddedBuffer[paddedBuffer.length - 1];
66
- return paddedBuffer.subarray(0, paddedBuffer.length - paddingToRemove);
66
+ const paddingLen = paddedBuffer[paddedBuffer.length - 1];
67
+ if (paddingLen === 0 || paddingLen > 16) {
68
+ throw new Error(`Invalid PKCS#7 padding length: ${paddingLen}`);
69
+ }
70
+ for (let i = paddedBuffer.length - paddingLen; i < paddedBuffer.length; i++) {
71
+ if (paddedBuffer[i] !== paddingLen) {
72
+ throw new Error('Invalid PKCS#7 padding');
73
+ }
74
+ }
75
+ return paddedBuffer.subarray(0, paddedBuffer.length - paddingLen);
67
76
  }
68
77
  }
@@ -262,26 +262,3 @@ export function decryptBn254KeystoreFromObject(keystore: Bn254Keystore, password
262
262
  throw new Bn254KeystoreError(`Failed to decrypt keystore: ${String(error)}`, error as Error);
263
263
  }
264
264
  }
265
-
266
- /**
267
- * Validates that a decrypted private key matches the public key in the keystore.
268
- *
269
- * @param privateKeyHex - Decrypted private key (0x-prefixed)
270
- * @param expectedPubkey - Expected public key from keystore
271
- * @param computePublicKey - Function to compute public key from private key
272
- * @returns true if keys match, false otherwise
273
- */
274
- export function verifyBn254Keypair(
275
- privateKeyHex: string,
276
- expectedPubkey: string,
277
- computePublicKey: (privateKey: string) => string,
278
- ): boolean {
279
- try {
280
- const computedPubkey = computePublicKey(privateKeyHex);
281
- const normalizedExpected = expectedPubkey.toLowerCase().replace(/^0x/i, '');
282
- const normalizedComputed = computedPubkey.toLowerCase().replace(/^0x/i, '');
283
- return normalizedExpected === normalizedComputed;
284
- } catch {
285
- return false;
286
- }
287
- }