@aztec/foundation 0.0.1-commit.04852196a → 0.0.1-commit.04d373f

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 (253) hide show
  1. package/dest/bigint-buffer/index.d.ts +1 -1
  2. package/dest/bigint-buffer/index.d.ts.map +1 -1
  3. package/dest/bigint-buffer/index.js +6 -1
  4. package/dest/branded-types/block_number.d.ts +3 -3
  5. package/dest/branded-types/block_number.d.ts.map +1 -1
  6. package/dest/branded-types/block_number.js +15 -4
  7. package/dest/branded-types/buffer32_hash.d.ts +27 -0
  8. package/dest/branded-types/buffer32_hash.d.ts.map +1 -0
  9. package/dest/branded-types/buffer32_hash.js +12 -0
  10. package/dest/branded-types/checkpoint_number.d.ts +9 -3
  11. package/dest/branded-types/checkpoint_number.d.ts.map +1 -1
  12. package/dest/branded-types/checkpoint_number.js +11 -0
  13. package/dest/branded-types/epoch.d.ts +2 -2
  14. package/dest/branded-types/epoch.d.ts.map +1 -1
  15. package/dest/branded-types/index.d.ts +2 -1
  16. package/dest/branded-types/index.d.ts.map +1 -1
  17. package/dest/branded-types/index.js +1 -0
  18. package/dest/branded-types/index_within_checkpoint.d.ts +2 -2
  19. package/dest/branded-types/index_within_checkpoint.d.ts.map +1 -1
  20. package/dest/branded-types/slot.d.ts +5 -2
  21. package/dest/branded-types/slot.d.ts.map +1 -1
  22. package/dest/branded-types/slot.js +3 -0
  23. package/dest/buffer/buffer16.d.ts +3 -1
  24. package/dest/buffer/buffer16.d.ts.map +1 -1
  25. package/dest/buffer/buffer32.d.ts +28 -61
  26. package/dest/buffer/buffer32.d.ts.map +1 -1
  27. package/dest/buffer/buffer32.js +29 -63
  28. package/dest/buffer/index.d.ts +2 -1
  29. package/dest/buffer/index.d.ts.map +1 -1
  30. package/dest/buffer/index.js +1 -0
  31. package/dest/buffer/utils.d.ts +3 -0
  32. package/dest/buffer/utils.d.ts.map +1 -0
  33. package/dest/buffer/utils.js +7 -0
  34. package/dest/collection/array.d.ts +11 -1
  35. package/dest/collection/array.d.ts.map +1 -1
  36. package/dest/collection/array.js +33 -0
  37. package/dest/collection/index.d.ts +3 -1
  38. package/dest/collection/index.d.ts.map +1 -1
  39. package/dest/collection/index.js +2 -0
  40. package/dest/collection/lru_map.d.ts +41 -0
  41. package/dest/collection/lru_map.d.ts.map +1 -0
  42. package/dest/collection/lru_map.js +119 -0
  43. package/dest/collection/lru_set.d.ts +35 -0
  44. package/dest/collection/lru_set.d.ts.map +1 -0
  45. package/dest/collection/lru_set.js +95 -0
  46. package/dest/committable/committable.js +1 -1
  47. package/dest/config/env_var.d.ts +2 -2
  48. package/dest/config/env_var.d.ts.map +1 -1
  49. package/dest/config/index.d.ts +47 -30
  50. package/dest/config/index.d.ts.map +1 -1
  51. package/dest/config/index.js +30 -45
  52. package/dest/config/network_config.d.ts +11 -49
  53. package/dest/config/network_config.d.ts.map +1 -1
  54. package/dest/config/network_config.js +1 -0
  55. package/dest/config/network_name.d.ts +2 -2
  56. package/dest/config/network_name.d.ts.map +1 -1
  57. package/dest/config/network_name.js +0 -2
  58. package/dest/config/secret_value.d.ts +2 -2
  59. package/dest/config/secret_value.d.ts.map +1 -1
  60. package/dest/crypto/aes128/index.d.ts +2 -1
  61. package/dest/crypto/aes128/index.d.ts.map +1 -1
  62. package/dest/crypto/aes128/index.js +11 -2
  63. package/dest/crypto/bls/bn254_keystore.d.ts +9 -176
  64. package/dest/crypto/bls/bn254_keystore.d.ts.map +1 -1
  65. package/dest/crypto/bls/bn254_keystore.js +0 -17
  66. package/dest/crypto/poseidon/index.d.ts +1 -1
  67. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  68. package/dest/crypto/poseidon/index.js +40 -33
  69. package/dest/crypto/schnorr/index.d.ts +8 -7
  70. package/dest/crypto/schnorr/index.d.ts.map +1 -1
  71. package/dest/crypto/schnorr/index.js +6 -6
  72. package/dest/crypto/schnorr/signature.d.ts +9 -29
  73. package/dest/crypto/schnorr/signature.d.ts.map +1 -1
  74. package/dest/crypto/schnorr/signature.js +20 -36
  75. package/dest/curves/bls12/field.d.ts +3 -3
  76. package/dest/curves/bls12/field.d.ts.map +1 -1
  77. package/dest/curves/bls12/field.js +0 -5
  78. package/dest/curves/bls12/point.d.ts +2 -2
  79. package/dest/curves/bls12/point.d.ts.map +1 -1
  80. package/dest/curves/bn254/field.d.ts +23 -19
  81. package/dest/curves/bn254/field.d.ts.map +1 -1
  82. package/dest/curves/bn254/field.js +23 -17
  83. package/dest/curves/grumpkin/point.d.ts +14 -28
  84. package/dest/curves/grumpkin/point.d.ts.map +1 -1
  85. package/dest/curves/grumpkin/point.js +29 -43
  86. package/dest/eth-address/index.d.ts +2 -2
  87. package/dest/eth-address/index.d.ts.map +1 -1
  88. package/dest/eth-address/index.js +0 -3
  89. package/dest/eth-signature/eth_signature.d.ts +2 -2
  90. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  91. package/dest/fifo/fifo_frame_reader.d.ts +41 -0
  92. package/dest/fifo/fifo_frame_reader.d.ts.map +1 -0
  93. package/dest/fifo/fifo_frame_reader.js +74 -0
  94. package/dest/fifo/index.d.ts +2 -0
  95. package/dest/fifo/index.d.ts.map +1 -0
  96. package/dest/fifo/index.js +1 -0
  97. package/dest/fifo_set/fifo_set.d.ts +15 -0
  98. package/dest/fifo_set/fifo_set.d.ts.map +1 -0
  99. package/dest/fifo_set/fifo_set.js +39 -0
  100. package/dest/fifo_set/index.d.ts +2 -0
  101. package/dest/fifo_set/index.d.ts.map +1 -0
  102. package/dest/fifo_set/index.js +1 -0
  103. package/dest/json-rpc/client/fetch.d.ts +1 -1
  104. package/dest/json-rpc/client/fetch.d.ts.map +1 -1
  105. package/dest/json-rpc/client/fetch.js +4 -3
  106. package/dest/json-rpc/client/safe_json_rpc_client.d.ts +1 -1
  107. package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
  108. package/dest/json-rpc/client/safe_json_rpc_client.js +2 -2
  109. package/dest/json-rpc/client/undici.d.ts +1 -1
  110. package/dest/json-rpc/client/undici.d.ts.map +1 -1
  111. package/dest/json-rpc/client/undici.js +5 -3
  112. package/dest/json-rpc/fixtures/test_state.d.ts +4 -8
  113. package/dest/json-rpc/fixtures/test_state.d.ts.map +1 -1
  114. package/dest/json-rpc/fixtures/test_state.js +57 -17
  115. package/dest/json-rpc/server/safe_json_rpc_server.d.ts +8 -3
  116. package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +1 -1
  117. package/dest/json-rpc/server/safe_json_rpc_server.js +27 -13
  118. package/dest/log/pino-logger.d.ts +1 -1
  119. package/dest/log/pino-logger.d.ts.map +1 -1
  120. package/dest/log/pino-logger.js +17 -2
  121. package/dest/noir/noir_package_config.d.ts +19 -104
  122. package/dest/noir/noir_package_config.d.ts.map +1 -1
  123. package/dest/noir/noir_package_config.js +1 -1
  124. package/dest/queue/batch_queue.d.ts +1 -1
  125. package/dest/queue/batch_queue.d.ts.map +1 -1
  126. package/dest/queue/batch_queue.js +1 -0
  127. package/dest/retry/index.d.ts +12 -1
  128. package/dest/retry/index.d.ts.map +1 -1
  129. package/dest/retry/index.js +21 -0
  130. package/dest/schemas/api.d.ts +12 -10
  131. package/dest/schemas/api.d.ts.map +1 -1
  132. package/dest/schemas/api.js +7 -1
  133. package/dest/schemas/parse.d.ts +4 -4
  134. package/dest/schemas/parse.d.ts.map +1 -1
  135. package/dest/schemas/parse.js +6 -5
  136. package/dest/schemas/schemas.d.ts +15 -15
  137. package/dest/schemas/types.d.ts +3 -3
  138. package/dest/schemas/types.d.ts.map +1 -1
  139. package/dest/schemas/utils.d.ts +7 -11
  140. package/dest/schemas/utils.d.ts.map +1 -1
  141. package/dest/schemas/utils.js +2 -18
  142. package/dest/serialize/buffer_sink.d.ts +134 -0
  143. package/dest/serialize/buffer_sink.d.ts.map +1 -0
  144. package/dest/serialize/buffer_sink.js +297 -0
  145. package/dest/serialize/index.d.ts +2 -1
  146. package/dest/serialize/index.d.ts.map +1 -1
  147. package/dest/serialize/index.js +1 -0
  148. package/dest/string/index.js +1 -1
  149. package/dest/timer/index.d.ts +2 -2
  150. package/dest/timer/index.d.ts.map +1 -1
  151. package/dest/timer/index.js +1 -1
  152. package/dest/timer/timeout.d.ts +3 -1
  153. package/dest/timer/timeout.d.ts.map +1 -1
  154. package/dest/timer/timeout.js +26 -0
  155. package/dest/transport/dispatch/create_dispatch_proxy.d.ts +11 -2
  156. package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +1 -1
  157. package/dest/transport/index.d.ts +1 -2
  158. package/dest/transport/index.d.ts.map +1 -1
  159. package/dest/transport/index.js +0 -1
  160. package/dest/trees/balanced_merkle_tree_root.d.ts +2 -3
  161. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -1
  162. package/dest/trees/balanced_merkle_tree_root.js +2 -3
  163. package/dest/trees/hasher.d.ts +3 -2
  164. package/dest/trees/hasher.d.ts.map +1 -1
  165. package/dest/trees/hasher.js +5 -5
  166. package/dest/trees/indexed_merkle_tree_calculator.d.ts +1 -1
  167. package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
  168. package/dest/trees/indexed_merkle_tree_calculator.js +5 -1
  169. package/dest/trees/membership_witness.d.ts +2 -2
  170. package/dest/trees/membership_witness.d.ts.map +1 -1
  171. package/dest/trees/merkle_tree_calculator.d.ts +4 -2
  172. package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
  173. package/dest/trees/merkle_tree_calculator.js +1 -5
  174. package/dest/trees/sibling_path.d.ts +5 -4
  175. package/dest/trees/sibling_path.d.ts.map +1 -1
  176. package/dest/trees/sibling_path.js +10 -8
  177. package/dest/trees/unbalanced_merkle_tree_root.d.ts +2 -3
  178. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -1
  179. package/dest/trees/unbalanced_merkle_tree_root.js +2 -3
  180. package/dest/types/index.d.ts +9 -1
  181. package/dest/types/index.d.ts.map +1 -1
  182. package/package.json +6 -4
  183. package/src/bigint-buffer/index.ts +6 -1
  184. package/src/branded-types/block_number.ts +20 -2
  185. package/src/branded-types/buffer32_hash.ts +38 -0
  186. package/src/branded-types/checkpoint_number.ts +16 -1
  187. package/src/branded-types/epoch.ts +1 -1
  188. package/src/branded-types/index.ts +1 -0
  189. package/src/branded-types/index_within_checkpoint.ts +1 -1
  190. package/src/branded-types/slot.ts +6 -1
  191. package/src/buffer/buffer16.ts +3 -0
  192. package/src/buffer/buffer32.ts +39 -68
  193. package/src/buffer/index.ts +1 -0
  194. package/src/buffer/utils.ts +8 -0
  195. package/src/collection/array.ts +34 -0
  196. package/src/collection/index.ts +2 -0
  197. package/src/collection/lru_map.ts +143 -0
  198. package/src/collection/lru_set.ts +115 -0
  199. package/src/committable/committable.ts +1 -1
  200. package/src/config/env_var.ts +31 -20
  201. package/src/config/index.ts +102 -97
  202. package/src/config/network_config.ts +1 -0
  203. package/src/config/network_name.ts +0 -3
  204. package/src/config/secret_value.ts +1 -1
  205. package/src/crypto/aes128/index.ts +11 -2
  206. package/src/crypto/bls/bn254_keystore.ts +0 -23
  207. package/src/crypto/poseidon/index.ts +42 -34
  208. package/src/crypto/schnorr/index.ts +9 -8
  209. package/src/crypto/schnorr/signature.ts +17 -46
  210. package/src/curves/bls12/field.ts +0 -7
  211. package/src/curves/bn254/field.ts +35 -34
  212. package/src/curves/grumpkin/point.ts +23 -40
  213. package/src/eth-address/index.ts +0 -4
  214. package/src/fifo/fifo_frame_reader.ts +98 -0
  215. package/src/fifo/index.ts +1 -0
  216. package/src/fifo_set/fifo_set.ts +52 -0
  217. package/src/fifo_set/index.ts +1 -0
  218. package/src/json-rpc/client/fetch.ts +4 -3
  219. package/src/json-rpc/client/safe_json_rpc_client.ts +2 -2
  220. package/src/json-rpc/client/undici.ts +5 -3
  221. package/src/json-rpc/fixtures/test_state.ts +10 -10
  222. package/src/json-rpc/server/safe_json_rpc_server.ts +31 -13
  223. package/src/log/pino-logger.ts +19 -2
  224. package/src/noir/noir_package_config.ts +32 -20
  225. package/src/queue/batch_queue.ts +1 -0
  226. package/src/retry/index.ts +30 -0
  227. package/src/schemas/api.ts +25 -25
  228. package/src/schemas/parse.ts +9 -6
  229. package/src/schemas/schemas.ts +4 -4
  230. package/src/schemas/types.ts +2 -2
  231. package/src/schemas/utils.ts +4 -38
  232. package/src/serialize/buffer_sink.ts +350 -0
  233. package/src/serialize/index.ts +1 -0
  234. package/src/string/index.ts +1 -1
  235. package/src/timer/index.ts +1 -1
  236. package/src/timer/timeout.ts +31 -0
  237. package/src/transport/dispatch/create_dispatch_proxy.ts +11 -1
  238. package/src/transport/index.ts +0 -1
  239. package/src/trees/balanced_merkle_tree_root.ts +2 -5
  240. package/src/trees/hasher.ts +6 -3
  241. package/src/trees/indexed_merkle_tree_calculator.ts +5 -1
  242. package/src/trees/merkle_tree_calculator.ts +4 -10
  243. package/src/trees/sibling_path.ts +11 -6
  244. package/src/trees/unbalanced_merkle_tree_root.ts +2 -5
  245. package/src/types/index.ts +14 -0
  246. package/dest/crypto/serialize.d.ts +0 -51
  247. package/dest/crypto/serialize.d.ts.map +0 -1
  248. package/dest/crypto/serialize.js +0 -68
  249. package/dest/transport/dispatch/create_dispatch_fn.d.ts +0 -25
  250. package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +0 -1
  251. package/dest/transport/dispatch/create_dispatch_fn.js +0 -17
  252. package/src/crypto/serialize.ts +0 -85
  253. package/src/transport/dispatch/create_dispatch_fn.ts +0 -35
@@ -1,17 +1,18 @@
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
- | 'ARCHIVER_MAX_LOGS'
10
8
  | 'ARCHIVER_POLLING_INTERVAL_MS'
9
+ | 'ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK'
11
10
  | 'ARCHIVER_URL'
12
11
  | 'ARCHIVER_VIEM_POLLING_INTERVAL_MS'
13
12
  | 'ARCHIVER_BATCH_SIZE'
13
+ | 'ARCHIVER_ORPHAN_PROPOSED_BLOCK_PRUNE_GRACE_SECONDS'
14
14
  | 'AZTEC_ADMIN_PORT'
15
+ | 'AZTEC_NODE_DEBUG'
15
16
  | 'AZTEC_ADMIN_API_KEY_HASH'
16
17
  | 'AZTEC_DISABLE_ADMIN_API_KEY'
17
18
  | 'AZTEC_RESET_ADMIN_API_KEY'
@@ -23,6 +24,9 @@ export type EnvVar =
23
24
  | 'BB_WORKING_DIRECTORY'
24
25
  | 'BB_NUM_IVC_VERIFIERS'
25
26
  | 'BB_IVC_CONCURRENCY'
27
+ | 'BB_CHONK_VERIFY_MAX_BATCH'
28
+ | 'BB_CHONK_VERIFY_BATCH_CONCURRENCY'
29
+ | 'BB_DEBUG_OUTPUT_DIR'
26
30
  | 'BOOTSTRAP_NODES'
27
31
  | 'BLOB_ARCHIVE_API_URL'
28
32
  | 'BLOB_FILE_STORE_URLS'
@@ -72,6 +76,7 @@ export type EnvVar =
72
76
  | 'DEBUG'
73
77
  | 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
74
78
  | 'ENABLE_PROVER_NODE'
79
+ | 'USE_AUTOMINE_SEQUENCER'
75
80
  | 'ETHEREUM_HOSTS'
76
81
  | 'ETHEREUM_DEBUG_HOSTS'
77
82
  | 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS'
@@ -81,6 +86,7 @@ export type EnvVar =
81
86
  | 'KEY_STORE_DIRECTORY'
82
87
  | 'L1_CHAIN_ID'
83
88
  | 'L1_CONSENSUS_HOST_URLS'
89
+ | 'ETHEREUM_HTTP_TIMEOUT_MS'
84
90
  | 'L1_CONSENSUS_HOST_API_KEYS'
85
91
  | 'L1_CONSENSUS_HOST_API_KEY_HEADERS'
86
92
  | 'L1_TX_FAILED_STORE'
@@ -91,14 +97,15 @@ export type EnvVar =
91
97
  | 'MNEMONIC'
92
98
  | 'NETWORK'
93
99
  | 'NETWORK_CONFIG_LOCATION'
94
- | 'NO_PXE'
95
100
  | 'USE_GCLOUD_LOGGING'
96
101
  | 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'
97
102
  | 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT'
98
103
  | 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT'
99
104
  | 'OTEL_COLLECT_INTERVAL_MS'
105
+ | 'OTEL_BSP_MAX_QUEUE_SIZE'
100
106
  | 'OTEL_EXCLUDE_METRICS'
101
107
  | 'OTEL_INCLUDE_METRICS'
108
+ | 'OTEL_MIN_TRACE_DURATION_MS'
102
109
  | 'OTEL_EXPORT_TIMEOUT_MS'
103
110
  | 'PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'
104
111
  | 'PUBLIC_OTEL_INCLUDE_METRICS'
@@ -130,8 +137,10 @@ export type EnvVar =
130
137
  | 'P2P_L2_QUEUE_SIZE'
131
138
  | 'P2P_MAX_PEERS'
132
139
  | 'P2P_PEER_CHECK_INTERVAL_MS'
140
+ | 'P2P_PEER_FAILED_BAN_TIME_MS'
133
141
  | 'P2P_PEER_PENALTY_VALUES'
134
142
  | 'P2P_QUERY_FOR_IP'
143
+ | 'P2P_PUBLIC_IP_SERVICES'
135
144
  | 'P2P_REQRESP_INDIVIDUAL_REQUEST_TIMEOUT_MS'
136
145
  | 'P2P_REQRESP_DIAL_TIMEOUT_MS'
137
146
  | 'P2P_REQRESP_OVERALL_REQUEST_TIMEOUT_MS'
@@ -153,7 +162,9 @@ export type EnvVar =
153
162
  | 'P2P_DROP_TX_CHANCE'
154
163
  | 'P2P_TX_POOL_DELETE_TXS_AFTER_REORG'
155
164
  | 'P2P_MIN_TX_POOL_AGE_MS'
165
+ | 'P2P_MISSING_TX_COLLECTION_DEADLINE_SLOTS'
156
166
  | 'P2P_RPC_PRICE_BUMP_PERCENTAGE'
167
+ | 'P2P_TX_VALIDATION_CACHE_SIZE'
157
168
  | 'DEBUG_P2P_INSTRUMENT_MESSAGES'
158
169
  | 'PEER_ID_PRIVATE_KEY'
159
170
  | 'PEER_ID_PRIVATE_KEY_PATH'
@@ -169,6 +180,7 @@ export type EnvVar =
169
180
  | 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
170
181
  | 'PROVER_BROKER_DEBUG_REPLAY_ENABLED'
171
182
  | 'PROVER_CANCEL_JOBS_ON_STOP'
183
+ | 'PROVER_ENQUEUE_CONCURRENCY'
172
184
  | 'PROVER_COORDINATION_NODE_URLS'
173
185
  | 'PROVER_PROOF_STORE'
174
186
  | 'PROVER_FAILED_PROOF_STORE'
@@ -192,6 +204,7 @@ export type EnvVar =
192
204
  | 'PROVER_TEST_DELAY_MS'
193
205
  | 'PROVER_TEST_DELAY_TYPE'
194
206
  | 'PROVER_TEST_VERIFICATION_DELAY_MS'
207
+ | 'PXE_AUTO_SYNC'
195
208
  | 'PXE_L2_BLOCK_BATCH_SIZE'
196
209
  | 'PXE_PROVER_ENABLED'
197
210
  | 'PXE_SYNC_CHAIN_TIP'
@@ -201,7 +214,9 @@ export type EnvVar =
201
214
  | 'RPC_SIMULATE_PUBLIC_MAX_DEBUG_LOG_MEMORY_READS'
202
215
  | 'SENTINEL_ENABLED'
203
216
  | 'SENTINEL_HISTORY_LENGTH_IN_EPOCHS'
204
- | 'SENTINEL_HISTORIC_PROVEN_PERFORMANCE_LENGTH_IN_EPOCHS'
217
+ | 'SENTINEL_HISTORIC_EPOCH_PERFORMANCE_LENGTH_IN_EPOCHS'
218
+ | 'SENTINEL_EPOCH_END_BUFFER_SLOTS'
219
+ | 'SEQ_ENABLE_PROPOSER_PIPELINING'
205
220
  | 'SEQ_MAX_TX_PER_BLOCK'
206
221
  | 'SEQ_MAX_TX_PER_CHECKPOINT'
207
222
  | 'SEQ_MIN_TX_PER_BLOCK'
@@ -209,36 +224,40 @@ export type EnvVar =
209
224
  | 'SEQ_MAX_DA_BLOCK_GAS'
210
225
  | 'SEQ_MAX_L2_BLOCK_GAS'
211
226
  | 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER'
227
+ | 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET'
212
228
  | 'SEQ_PUBLISHER_PRIVATE_KEY'
213
229
  | 'SEQ_PUBLISHER_PRIVATE_KEYS'
214
230
  | 'SEQ_PUBLISHER_ADDRESSES'
215
231
  | 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
216
232
  | 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
233
+ | 'PUBLISHER_FUNDING_THRESHOLD'
234
+ | 'PUBLISHER_FUNDING_AMOUNT'
217
235
  | 'SEQ_POLLING_INTERVAL_MS'
218
236
  | 'SEQ_ENFORCE_TIME_TABLE'
219
237
  | 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
220
238
  | 'SEQ_ATTESTATION_PROPAGATION_TIME'
221
239
  | 'SEQ_BLOCK_DURATION_MS'
240
+ | 'SEQ_LAST_BLOCK_DURATION_MS'
222
241
  | 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT'
223
242
  | 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
224
243
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
225
244
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
226
245
  | 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT'
227
- | 'SLASH_MIN_PENALTY_PERCENTAGE'
228
- | 'SLASH_MAX_PENALTY_PERCENTAGE'
229
246
  | 'SLASH_VALIDATORS_ALWAYS'
230
247
  | 'SLASH_VALIDATORS_NEVER'
231
- | 'SLASH_PRUNE_PENALTY'
232
248
  | 'SLASH_DATA_WITHHOLDING_PENALTY'
249
+ | 'SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS'
233
250
  | 'SLASH_INACTIVITY_PENALTY'
234
251
  | 'SLASH_INACTIVITY_TARGET_PERCENTAGE'
235
252
  | 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD'
236
253
  | 'SLASH_INVALID_BLOCK_PENALTY'
254
+ | 'SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY'
237
255
  | 'SLASH_DUPLICATE_PROPOSAL_PENALTY'
238
256
  | 'SLASH_DUPLICATE_ATTESTATION_PENALTY'
239
257
  | 'SLASH_OVERRIDE_PAYLOAD'
240
258
  | 'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY'
241
- | 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY'
259
+ | 'SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY'
260
+ | 'SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY'
242
261
  | 'SLASH_UNKNOWN_PENALTY'
243
262
  | 'SLASH_GRACE_PERIOD_L2_SLOTS'
244
263
  | 'SLASH_OFFENSE_EXPIRATION_ROUNDS'
@@ -252,25 +271,16 @@ export type EnvVar =
252
271
  | 'SPONSORED_FPC'
253
272
  | 'PREFUND_ADDRESSES'
254
273
  | 'TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS'
255
- | 'TX_COLLECTION_SLOW_NODES_INTERVAL_MS'
256
- | 'TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS'
257
- | 'TX_COLLECTION_SLOW_REQ_RESP_TIMEOUT_MS'
258
- | 'TX_COLLECTION_RECONCILE_INTERVAL_MS'
259
- | 'TX_COLLECTION_DISABLE_SLOW_DURING_FAST_REQUESTS'
260
274
  | 'TX_COLLECTION_FAST_NODE_INTERVAL_MS'
261
275
  | 'TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE'
262
276
  | 'TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE'
263
277
  | 'TX_COLLECTION_NODE_RPC_URLS'
264
278
  | 'TX_COLLECTION_MISSING_TXS_COLLECTOR_TYPE'
265
279
  | 'TX_COLLECTION_FILE_STORE_URLS'
266
- | 'TX_COLLECTION_FILE_STORE_SLOW_DELAY_MS'
267
280
  | 'TX_COLLECTION_FILE_STORE_FAST_DELAY_MS'
268
281
  | 'TX_COLLECTION_FILE_STORE_FAST_WORKER_COUNT'
269
- | 'TX_COLLECTION_FILE_STORE_SLOW_WORKER_COUNT'
270
282
  | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_BASE_MS'
271
- | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_BASE_MS'
272
283
  | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_MAX_MS'
273
- | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_MAX_MS'
274
284
  | 'TX_FILE_STORE_URL'
275
285
  | 'TX_FILE_STORE_UPLOAD_CONCURRENCY'
276
286
  | 'TX_FILE_STORE_MAX_QUEUE_SIZE'
@@ -286,7 +296,6 @@ export type EnvVar =
286
296
  | 'VALIDATOR_MAX_TX_PER_CHECKPOINT'
287
297
  | 'VALIDATOR_PRIVATE_KEYS'
288
298
  | 'VALIDATOR_PRIVATE_KEY'
289
- | 'VALIDATOR_REEXECUTE'
290
299
  | 'VALIDATOR_ADDRESSES'
291
300
  | 'ROLLUP_VERSION'
292
301
  | 'WS_BLOCK_CHECK_INTERVAL_MS'
@@ -319,7 +328,7 @@ export type EnvVar =
319
328
  | 'AZTEC_SLASH_AMOUNT_SMALL'
320
329
  | 'AZTEC_SLASH_AMOUNT_MEDIUM'
321
330
  | 'AZTEC_SLASH_AMOUNT_LARGE'
322
- | 'AZTEC_SLASHER_FLAVOR'
331
+ | 'AZTEC_SLASHER_ENABLED'
323
332
  | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
324
333
  | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
325
334
  | 'AZTEC_GOVERNANCE_VOTING_DURATION'
@@ -349,12 +358,14 @@ export type EnvVar =
349
358
  | 'K8S_POD_UID'
350
359
  | 'K8S_NAMESPACE_NAME'
351
360
  | 'ENABLE_VERSION_CHECK'
352
- | 'VALIDATOR_REEXECUTE_DEADLINE_MS'
353
361
  | 'WEB3_SIGNER_URL'
354
362
  | 'SKIP_ARCHIVER_INITIAL_SYNC'
355
363
  | 'BLOB_ALLOW_EMPTY_SOURCES'
364
+ | 'BLOB_PREFER_FILESTORES'
365
+ | 'BLOB_FILE_STORE_TIMEOUT_MS'
356
366
  | 'FISHERMAN_MODE'
357
367
  | 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
368
+ | 'MAX_BLOCKS_PER_CHECKPOINT'
358
369
  | 'LEGACY_BLS_CLI'
359
370
  | 'DEBUG_FORCE_TX_PROOF_VERIFICATION'
360
371
  | 'VALIDATOR_HA_SIGNING_ENABLED'
@@ -10,14 +10,14 @@ 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
21
  fallback?: EnvVar[];
22
22
  /**
23
23
  * List of deprecated env vars that are still supported but will log a warning.
@@ -30,7 +30,9 @@ export function isBooleanConfigValue<T>(obj: T, key: keyof T): boolean {
30
30
  return typeof obj[key] === 'boolean';
31
31
  }
32
32
 
33
- export type ConfigMappingsType<T> = Record<keyof T, ConfigMapping>;
33
+ export type ConfigMappingsType<T> = {
34
+ [K in keyof T]-?: ConfigMapping<Required<T>[K]>;
35
+ };
34
36
 
35
37
  /**
36
38
  * Shared utility function to get a value from environment variables with fallback support.
@@ -66,8 +68,8 @@ export function getValueFromEnvWithFallback<T>(
66
68
  }
67
69
  }
68
70
 
69
- // Parse the value if needed
70
- if (value !== undefined) {
71
+ // Parse the value if needed. Empty strings are treated as "not set".
72
+ if (value !== undefined && value !== '') {
71
73
  return parseFunc ? parseFunc(value) : (value as unknown as T);
72
74
  }
73
75
 
@@ -79,22 +81,20 @@ export function getConfigFromMappings<T>(configMappings: ConfigMappingsType<T>):
79
81
  const config = {} as T;
80
82
 
81
83
  for (const key in configMappings) {
82
- const { env, parseEnv, defaultValue, nested, fallback, deprecatedFallback } = configMappings[key];
83
- if (nested) {
84
- (config as any)[key] = getConfigFromMappings(nested);
85
- } else {
86
- // Use the shared utility function
84
+ const { env, parseEnv, defaultValue, fallback, deprecatedFallback } = configMappings[key];
85
+ try {
87
86
  (config as any)[key] = getValueFromEnvWithFallback(env, parseEnv, defaultValue, fallback);
87
+ } catch (e: any) {
88
+ throw new Error(`Failed to parse config '${key}' (env: ${env ?? 'none'}): ${e.message}`);
89
+ }
88
90
 
89
- // Check for deprecated env vars and warn if logger is set
90
- if (deprecatedFallback?.length) {
91
- const userLog = createConsoleLogger('[DEPRECATED]');
92
- for (const { env: deprecatedEnv, message } of deprecatedFallback) {
93
- if (process.env[deprecatedEnv]) {
94
- const warningMessage =
95
- message ?? `Environment variable ${deprecatedEnv} is deprecated. Please use ${env} instead.`;
96
- userLog(warningMessage, { deprecatedEnvVar: deprecatedEnv, newEnvVar: env });
97
- }
91
+ if (deprecatedFallback?.length) {
92
+ const userLog = createConsoleLogger('[DEPRECATED]');
93
+ for (const { env: deprecatedEnv, message } of deprecatedFallback) {
94
+ if (process.env[deprecatedEnv]) {
95
+ const warningMessage =
96
+ message ?? `Environment variable ${deprecatedEnv} is deprecated. Please use ${env} instead.`;
97
+ userLog(warningMessage, { deprecatedEnvVar: deprecatedEnv, newEnvVar: env });
98
98
  }
99
99
  }
100
100
  }
@@ -123,7 +123,7 @@ export function omitConfigMappings<T, K extends keyof T>(
123
123
  * @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
124
124
  * @returns Object with parseEnv and default values for a numerical config value
125
125
  */
126
- export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
126
+ export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
127
127
  return {
128
128
  parseEnv: (val: string) => safeParseNumber(val, defaultVal),
129
129
  defaultValue: defaultVal,
@@ -138,7 +138,7 @@ export function numberConfigHelper(defaultVal: number): Pick<ConfigMapping, 'par
138
138
  export function floatConfigHelper(
139
139
  defaultVal: number,
140
140
  validationFn?: (val: number) => void,
141
- ): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
141
+ ): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
142
142
  return {
143
143
  parseEnv: (val: string): number => {
144
144
  const parsed = safeParseFloat(val, defaultVal);
@@ -152,7 +152,7 @@ export function floatConfigHelper(
152
152
  /**
153
153
  * Parses an environment variable to a 0-1 percentage value
154
154
  */
155
- export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
155
+ export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping<number>, 'parseEnv' | 'defaultValue'> {
156
156
  return {
157
157
  parseEnv: (val: string): number => {
158
158
  const parsed = safeParseFloat(val, defaultVal);
@@ -171,12 +171,13 @@ export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping,
171
171
  * @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
172
172
  * @returns Object with parseEnv and default values for a numerical config value
173
173
  */
174
- export function bigintConfigHelper(defaultVal?: bigint): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
174
+ export function bigintConfigHelper(defaultVal: bigint): Pick<ConfigMapping<bigint>, 'parseEnv' | 'defaultValue'>;
175
+ export function bigintConfigHelper(): Pick<ConfigMapping<bigint | undefined>, 'parseEnv' | 'defaultValue'>;
176
+ export function bigintConfigHelper(
177
+ defaultVal?: bigint,
178
+ ): Pick<ConfigMapping<bigint | undefined>, 'parseEnv' | 'defaultValue'> {
175
179
  return {
176
180
  parseEnv: (val: string) => {
177
- if (val === '') {
178
- return defaultVal;
179
- }
180
181
  // Handle scientific notation (e.g. "1e+23", "2E23") which BigInt() doesn't accept directly.
181
182
  // We parse it losslessly using bigint arithmetic instead of going through float64.
182
183
  if (/[eE]/.test(val)) {
@@ -200,32 +201,37 @@ export function bigintConfigHelper(defaultVal?: bigint): Pick<ConfigMapping, 'pa
200
201
 
201
202
  /**
202
203
  * Generates parseEnv for an optional numerical config value.
204
+ * Empty strings are already handled by getValueFromEnvWithFallback.
203
205
  */
204
- export function optionalNumberConfigHelper(): Pick<ConfigMapping, 'parseEnv'> {
206
+ export function optionalNumberConfigHelper(): Pick<ConfigMapping<number>, 'parseEnv'> {
205
207
  return {
206
- parseEnv: (val: string | undefined) => {
207
- if (val !== undefined && val.length > 0) {
208
- const parsedValue = parseInt(val);
209
- return Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
208
+ parseEnv: (val: string) => {
209
+ const parsedValue = parseInt(val);
210
+ if (!Number.isSafeInteger(parsedValue)) {
211
+ throw new Error(`Invalid number: ${val}`);
210
212
  }
211
- return undefined;
213
+ return parsedValue;
212
214
  },
213
215
  };
214
216
  }
215
217
 
216
218
  /** Generates parseEnv for an enum-like config value. */
219
+ export function enumConfigHelper<T extends string>(
220
+ values: T[],
221
+ defaultValue: NoInfer<T>,
222
+ ): Pick<ConfigMapping<T>, 'parseEnv' | 'defaultValue'>;
223
+ export function enumConfigHelper<T extends string>(
224
+ values: T[],
225
+ ): Pick<ConfigMapping<T | undefined>, 'parseEnv' | 'defaultValue'>;
217
226
  export function enumConfigHelper<T extends string>(
218
227
  values: T[],
219
228
  defaultValue?: NoInfer<T>,
220
- ): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
229
+ ): Pick<ConfigMapping<T | undefined>, 'parseEnv' | 'defaultValue'> {
221
230
  return {
222
231
  parseEnv: (val: string) => {
223
- const sanitizedVal = (val ?? '').trim().toLowerCase();
224
- if (values.includes(sanitizedVal as T)) {
225
- return sanitizedVal as T;
226
- }
227
- if (!val && defaultValue) {
228
- return defaultValue;
232
+ const sanitizedVal = val.trim().toLowerCase();
233
+ if (values.some(v => v.toLowerCase() === sanitizedVal)) {
234
+ return values.find(v => v.toLowerCase() === sanitizedVal)!;
229
235
  }
230
236
  throw new Error(`Invalid config value '${val}' (must be one of ${values.join(', ')})`);
231
237
  },
@@ -240,7 +246,9 @@ export function enumConfigHelper<T extends string>(
240
246
  */
241
247
  export function booleanConfigHelper(
242
248
  defaultVal = false,
243
- ): Required<Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & { parseVal: (val: string) => boolean }> {
249
+ ): Required<
250
+ Pick<ConfigMapping<boolean>, 'parseEnv' | 'defaultValue' | 'isBoolean'> & { parseVal: (val: string) => boolean }
251
+ > {
244
252
  const parse = (val: string | boolean) => (typeof val === 'boolean' ? val : parseBooleanEnv(val));
245
253
  return {
246
254
  parseEnv: parse,
@@ -250,91 +258,88 @@ export function booleanConfigHelper(
250
258
  };
251
259
  }
252
260
 
253
- export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T): Required<
254
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
255
- parseVal: (val: string) => SecretValue<T>;
256
- }
257
- > {
261
+ export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T): Pick<
262
+ ConfigMapping<SecretValue<T>>,
263
+ 'parseEnv' | 'defaultValue'
264
+ > & {
265
+ parseVal: (val: string) => SecretValue<T>;
266
+ } {
258
267
  const wrap = (val: string) => new SecretValue(parse(val));
259
268
  return {
260
269
  parseEnv: wrap,
261
270
  parseVal: wrap,
262
271
  defaultValue: new SecretValue(parse(undefined)),
263
- isBoolean: true,
264
272
  };
265
273
  }
266
274
 
267
275
  export { parseBooleanEnv } from './parse-env.js';
268
276
 
269
- export function secretStringConfigHelper(): Required<
270
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
271
- parseVal: (val: string) => SecretValue<string | undefined>;
272
- }
273
- >;
274
- export function secretStringConfigHelper(defaultValue: string): Required<
275
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
276
- parseVal: (val: string) => SecretValue<string>;
277
- }
278
- >;
279
- export function secretStringConfigHelper(defaultValue?: string): Required<
280
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
281
- parseVal: (val: string) => SecretValue<string | typeof defaultValue>;
282
- }
283
- > {
277
+ export function secretStringConfigHelper(): {
278
+ parseEnv: (val: string) => SecretValue<string>;
279
+ parseVal: (val: string) => SecretValue<string>;
280
+ defaultValue: undefined;
281
+ };
282
+ export function secretStringConfigHelper(defaultValue: string): {
283
+ parseEnv: (val: string) => SecretValue<string>;
284
+ parseVal: (val: string) => SecretValue<string>;
285
+ defaultValue: SecretValue<string>;
286
+ };
287
+ export function secretStringConfigHelper(defaultValue?: string): {
288
+ parseEnv: (val: string) => SecretValue<string>;
289
+ parseVal: (val: string) => SecretValue<string>;
290
+ defaultValue: SecretValue<string> | undefined;
291
+ } {
284
292
  const parse = (val: string) => new SecretValue(val);
285
293
  return {
286
294
  parseEnv: parse,
287
295
  parseVal: parse,
288
296
  defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
289
- isBoolean: true,
290
297
  };
291
298
  }
292
299
 
293
- export function secretFrConfigHelper(): Required<
294
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
295
- parseVal: (val: string) => SecretValue<Fr | undefined>;
296
- }
297
- >;
298
- export function secretFrConfigHelper(defaultValue: Fr): Required<
299
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
300
- parseVal: (val: string) => SecretValue<Fr>;
301
- }
302
- >;
303
- export function secretFrConfigHelper(defaultValue?: Fr): Required<
304
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
305
- parseVal: (val: string) => SecretValue<Fr | typeof defaultValue>;
306
- }
307
- > {
300
+ export function secretFrConfigHelper(): {
301
+ parseEnv: (val: string) => SecretValue<Fr>;
302
+ parseVal: (val: string) => SecretValue<Fr>;
303
+ defaultValue: undefined;
304
+ };
305
+ export function secretFrConfigHelper(defaultValue: Fr): {
306
+ parseEnv: (val: string) => SecretValue<Fr>;
307
+ parseVal: (val: string) => SecretValue<Fr>;
308
+ defaultValue: SecretValue<Fr>;
309
+ };
310
+ export function secretFrConfigHelper(defaultValue?: Fr): {
311
+ parseEnv: (val: string) => SecretValue<Fr>;
312
+ parseVal: (val: string) => SecretValue<Fr>;
313
+ defaultValue: SecretValue<Fr> | undefined;
314
+ } {
308
315
  const parse = (val: string) => new SecretValue(Fr.fromHexString(val));
309
316
  return {
310
317
  parseEnv: parse,
311
318
  parseVal: parse,
312
319
  defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
313
- isBoolean: true,
314
320
  };
315
321
  }
316
322
 
317
- export function secretFqConfigHelper(defaultValue: Fq): Required<
318
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
319
- parseVal: (val: string) => SecretValue<Fq>;
320
- }
321
- >;
322
- export function secretFqConfigHelper(): Required<
323
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
324
- parseVal: (val: string) => SecretValue<Fq | undefined>;
325
- }
326
- >;
327
- export function secretFqConfigHelper(defaultValue?: Fq): Required<
328
- Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
329
- parseVal: (val: string) => SecretValue<Fq | typeof defaultValue>;
330
- }
331
- > {
323
+ export function secretFqConfigHelper(): {
324
+ parseEnv: (val: string) => SecretValue<Fq>;
325
+ parseVal: (val: string) => SecretValue<Fq>;
326
+ defaultValue: undefined;
327
+ };
328
+ export function secretFqConfigHelper(defaultValue: Fq): {
329
+ parseEnv: (val: string) => SecretValue<Fq>;
330
+ parseVal: (val: string) => SecretValue<Fq>;
331
+ defaultValue: SecretValue<Fq>;
332
+ };
333
+ export function secretFqConfigHelper(defaultValue?: Fq): {
334
+ parseEnv: (val: string) => SecretValue<Fq>;
335
+ parseVal: (val: string) => SecretValue<Fq>;
336
+ defaultValue: SecretValue<Fq> | undefined;
337
+ } {
332
338
  const parse = (val: string) => new SecretValue(Fq.fromHexString(val));
333
339
  return {
334
340
  parseEnv: parse,
335
341
  parseVal: parse,
336
- defaultValue: typeof defaultValue !== 'undefined' ? new SecretValue(defaultValue) : undefined,
337
- isBoolean: true,
342
+ defaultValue: defaultValue !== undefined ? new SecretValue(defaultValue) : undefined,
338
343
  };
339
344
  }
340
345
 
@@ -5,6 +5,7 @@ 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(),
@@ -1,6 +1,5 @@
1
1
  export type NetworkNames =
2
2
  | 'local'
3
- | 'staging-ignition'
4
3
  | 'staging-public'
5
4
  | 'testnet'
6
5
  | 'mainnet'
@@ -12,8 +11,6 @@ export function getActiveNetworkName(name?: string): NetworkNames {
12
11
  const network = name || process.env.NETWORK;
13
12
  if (!network || network === '' || network === 'local') {
14
13
  return 'local';
15
- } else if (network === 'staging-ignition') {
16
- return network;
17
14
  } else if (network === 'staging-public') {
18
15
  return network;
19
16
  } else if (network === 'testnet' || network === 'alpha-testnet') {
@@ -43,7 +43,7 @@ export class SecretValue<T> {
43
43
  /**
44
44
  * Returns a Zod schema
45
45
  */
46
- static schema<O>(valueSchema: ZodType<O, any, any>): ZodType<SecretValue<O>, any, any> {
46
+ static schema<O>(valueSchema: ZodType<O, any>): ZodType<SecretValue<O>, any> {
47
47
  return valueSchema.transform(value => new SecretValue<O>(value));
48
48
  }
49
49
  }
@@ -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
- }