@aztec/foundation 0.0.1-fake-ceab37513c → 0.0.2-commit.217f559981

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 (520) hide show
  1. package/dest/array/array.d.ts +1 -9
  2. package/dest/array/array.d.ts.map +1 -1
  3. package/dest/array/array.js +0 -11
  4. package/dest/array/index.d.ts +2 -1
  5. package/dest/array/index.d.ts.map +1 -1
  6. package/dest/array/index.js +1 -0
  7. package/dest/array/sorted_array.d.ts +15 -0
  8. package/dest/array/sorted_array.d.ts.map +1 -0
  9. package/dest/array/sorted_array.js +109 -0
  10. package/dest/async-map/index.d.ts +1 -1
  11. package/dest/async-pool/index.d.ts +1 -1
  12. package/dest/bigint/index.d.ts +1 -1
  13. package/dest/bigint-buffer/index.d.ts +1 -1
  14. package/dest/branded-types/block_number.d.ts +56 -0
  15. package/dest/branded-types/block_number.d.ts.map +1 -0
  16. package/dest/branded-types/block_number.js +78 -0
  17. package/dest/branded-types/checkpoint_number.d.ts +54 -0
  18. package/dest/branded-types/checkpoint_number.d.ts.map +1 -0
  19. package/dest/branded-types/checkpoint_number.js +77 -0
  20. package/dest/branded-types/epoch.d.ts +42 -0
  21. package/dest/branded-types/epoch.d.ts.map +1 -0
  22. package/dest/branded-types/epoch.js +59 -0
  23. package/dest/branded-types/index.d.ts +7 -0
  24. package/dest/branded-types/index.d.ts.map +1 -0
  25. package/dest/branded-types/index.js +5 -0
  26. package/dest/branded-types/index_within_checkpoint.d.ts +42 -0
  27. package/dest/branded-types/index_within_checkpoint.d.ts.map +1 -0
  28. package/dest/branded-types/index_within_checkpoint.js +59 -0
  29. package/dest/branded-types/slot.d.ts +42 -0
  30. package/dest/branded-types/slot.d.ts.map +1 -0
  31. package/dest/branded-types/slot.js +59 -0
  32. package/dest/branded-types/types.d.ts +5 -0
  33. package/dest/branded-types/types.d.ts.map +1 -0
  34. package/dest/branded-types/types.js +1 -0
  35. package/dest/buffer/buffer16.d.ts +2 -2
  36. package/dest/buffer/buffer16.d.ts.map +1 -1
  37. package/dest/buffer/buffer16.js +4 -2
  38. package/dest/buffer/buffer32.d.ts +2 -2
  39. package/dest/buffer/buffer32.d.ts.map +1 -1
  40. package/dest/buffer/buffer32.js +4 -2
  41. package/dest/buffer/index.d.ts +1 -1
  42. package/dest/collection/array.d.ts +14 -1
  43. package/dest/collection/array.d.ts.map +1 -1
  44. package/dest/collection/array.js +63 -3
  45. package/dest/collection/index.d.ts +1 -1
  46. package/dest/collection/object.d.ts +1 -1
  47. package/dest/committable/committable.d.ts +1 -1
  48. package/dest/committable/committable.d.ts.map +1 -1
  49. package/dest/committable/index.d.ts +1 -1
  50. package/dest/config/env_var.d.ts +2 -2
  51. package/dest/config/env_var.d.ts.map +1 -1
  52. package/dest/config/index.d.ts +15 -4
  53. package/dest/config/index.d.ts.map +1 -1
  54. package/dest/config/index.js +32 -9
  55. package/dest/config/network_config.d.ts +13 -1
  56. package/dest/config/network_config.d.ts.map +1 -1
  57. package/dest/config/network_config.js +3 -1
  58. package/dest/config/network_name.d.ts +2 -2
  59. package/dest/config/network_name.d.ts.map +1 -1
  60. package/dest/config/network_name.js +6 -0
  61. package/dest/config/parse-env.d.ts +3 -0
  62. package/dest/config/parse-env.d.ts.map +1 -0
  63. package/dest/config/parse-env.js +7 -0
  64. package/dest/config/secret_value.d.ts +1 -1
  65. package/dest/config/secret_value.d.ts.map +1 -1
  66. package/dest/config/secret_value.js +3 -1
  67. package/dest/crypto/aes128/index.d.ts +1 -1
  68. package/dest/crypto/aes128/index.d.ts.map +1 -1
  69. package/dest/crypto/aes128/index.js +19 -6
  70. package/dest/crypto/bls/bn254_keystore.d.ts +296 -0
  71. package/dest/crypto/bls/bn254_keystore.d.ts.map +1 -0
  72. package/dest/crypto/bls/bn254_keystore.js +218 -0
  73. package/dest/crypto/bls/index.d.ts +13 -0
  74. package/dest/crypto/bls/index.d.ts.map +1 -0
  75. package/dest/crypto/bls/index.js +87 -0
  76. package/dest/crypto/bn254/index.d.ts +39 -0
  77. package/dest/crypto/bn254/index.d.ts.map +1 -0
  78. package/dest/crypto/bn254/index.js +56 -0
  79. package/dest/crypto/ecdsa/index.d.ts +1 -1
  80. package/dest/crypto/ecdsa/index.d.ts.map +1 -1
  81. package/dest/crypto/ecdsa/index.js +58 -48
  82. package/dest/crypto/ecdsa/signature.d.ts +2 -2
  83. package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
  84. package/dest/crypto/ecdsa/signature.js +2 -2
  85. package/dest/crypto/grumpkin/index.d.ts +10 -13
  86. package/dest/crypto/grumpkin/index.d.ts.map +1 -1
  87. package/dest/crypto/grumpkin/index.js +61 -55
  88. package/dest/crypto/keccak/index.d.ts +1 -1
  89. package/dest/crypto/keys/index.d.ts +2 -2
  90. package/dest/crypto/keys/index.d.ts.map +1 -1
  91. package/dest/crypto/keys/index.js +8 -5
  92. package/dest/crypto/pedersen/index.d.ts +1 -1
  93. package/dest/crypto/pedersen/pedersen.noble.d.ts +1 -1
  94. package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
  95. package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
  96. package/dest/crypto/pedersen/pedersen.wasm.js +24 -14
  97. package/dest/crypto/poseidon/index.d.ts +2 -3
  98. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  99. package/dest/crypto/poseidon/index.js +27 -21
  100. package/dest/crypto/random/index.d.ts +1 -1
  101. package/dest/crypto/random/index.d.ts.map +1 -1
  102. package/dest/crypto/random/randomness_singleton.d.ts +4 -3
  103. package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
  104. package/dest/crypto/random/randomness_singleton.js +5 -5
  105. package/dest/crypto/schnorr/index.d.ts +3 -2
  106. package/dest/crypto/schnorr/index.d.ts.map +1 -1
  107. package/dest/crypto/schnorr/index.js +30 -38
  108. package/dest/crypto/schnorr/signature.d.ts +2 -2
  109. package/dest/crypto/schnorr/signature.d.ts.map +1 -1
  110. package/dest/crypto/schnorr/signature.js +2 -2
  111. package/dest/crypto/secp256k1/index.d.ts +1 -1
  112. package/dest/crypto/secp256k1/index.d.ts.map +1 -1
  113. package/dest/crypto/secp256k1/index.js +23 -18
  114. package/dest/crypto/secp256k1-signer/index.d.ts +1 -1
  115. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +1 -1
  116. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +1 -1
  117. package/dest/crypto/secp256k1-signer/utils.d.ts +43 -5
  118. package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
  119. package/dest/crypto/secp256k1-signer/utils.js +76 -8
  120. package/dest/crypto/serialize.d.ts +1 -1
  121. package/dest/crypto/sha256/index.d.ts +2 -2
  122. package/dest/crypto/sha256/index.d.ts.map +1 -1
  123. package/dest/crypto/sha256/index.js +1 -1
  124. package/dest/crypto/sha512/index.d.ts +3 -3
  125. package/dest/crypto/sha512/index.d.ts.map +1 -1
  126. package/dest/crypto/sha512/index.js +1 -1
  127. package/dest/crypto/signature/index.d.ts +2 -2
  128. package/dest/crypto/signature/index.d.ts.map +1 -1
  129. package/dest/crypto/sync/index.d.ts +1 -1
  130. package/dest/crypto/sync/index.js +1 -1
  131. package/dest/crypto/sync/pedersen/index.d.ts +2 -2
  132. package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
  133. package/dest/crypto/sync/pedersen/index.js +18 -11
  134. package/dest/crypto/sync/poseidon/index.d.ts +2 -3
  135. package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
  136. package/dest/crypto/sync/poseidon/index.js +23 -16
  137. package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
  138. package/dest/curves/bls12/field.d.ts.map +1 -0
  139. package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
  140. package/dest/curves/bls12/index.d.ts +3 -0
  141. package/dest/curves/bls12/index.d.ts.map +1 -0
  142. package/dest/curves/bls12/index.js +2 -0
  143. package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +11 -11
  144. package/dest/curves/bls12/point.d.ts.map +1 -0
  145. package/dest/{fields/bls12_point.js → curves/bls12/point.js} +17 -15
  146. package/dest/curves/bn254/field.d.ts +180 -0
  147. package/dest/curves/bn254/field.d.ts.map +1 -0
  148. package/dest/{fields/fields.js → curves/bn254/field.js} +71 -59
  149. package/dest/curves/bn254/index.d.ts +3 -0
  150. package/dest/curves/bn254/index.d.ts.map +1 -0
  151. package/dest/curves/bn254/index.js +2 -0
  152. package/dest/curves/bn254/point.d.ts +54 -0
  153. package/dest/curves/bn254/point.d.ts.map +1 -0
  154. package/dest/curves/bn254/point.js +143 -0
  155. package/dest/curves/grumpkin/index.d.ts +10 -0
  156. package/dest/curves/grumpkin/index.d.ts.map +1 -0
  157. package/dest/curves/grumpkin/index.js +3 -0
  158. package/dest/{fields → curves/grumpkin}/point.d.ts +12 -3
  159. package/dest/curves/grumpkin/point.d.ts.map +1 -0
  160. package/dest/{fields → curves/grumpkin}/point.js +24 -7
  161. package/dest/decorators/index.d.ts +1 -1
  162. package/dest/decorators/memoize.d.ts +1 -1
  163. package/dest/decorators/memoize.d.ts.map +1 -1
  164. package/dest/error/index.d.ts +1 -1
  165. package/dest/eth-address/index.d.ts +12 -2
  166. package/dest/eth-address/index.d.ts.map +1 -1
  167. package/dest/eth-address/index.js +27 -3
  168. package/dest/eth-signature/eth_signature.d.ts +1 -1
  169. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  170. package/dest/eth-signature/index.d.ts +1 -1
  171. package/dest/fs/index.d.ts +1 -1
  172. package/dest/fs/run_in_dir.d.ts +1 -1
  173. package/dest/fs/try_rm_dir.d.ts +1 -1
  174. package/dest/iterable/all.d.ts +1 -1
  175. package/dest/iterable/filter.d.ts +1 -1
  176. package/dest/iterable/index.d.ts +1 -1
  177. package/dest/iterable/isAsyncIt.d.ts +1 -1
  178. package/dest/iterable/map.d.ts +1 -1
  179. package/dest/iterable/peek.d.ts +1 -1
  180. package/dest/iterable/sort.d.ts +1 -1
  181. package/dest/iterable/take.d.ts +1 -1
  182. package/dest/iterable/toArray.d.ts +1 -1
  183. package/dest/iterator/filter.d.ts +3 -0
  184. package/dest/iterator/filter.d.ts.map +1 -0
  185. package/dest/iterator/filter.js +7 -0
  186. package/dest/iterator/index.d.ts +2 -0
  187. package/dest/iterator/index.d.ts.map +1 -0
  188. package/dest/iterator/index.js +1 -0
  189. package/dest/jest/setup.js +4 -1
  190. package/dest/json-rpc/client/fetch.d.ts +1 -1
  191. package/dest/json-rpc/client/index.d.ts +1 -1
  192. package/dest/json-rpc/client/safe_json_rpc_client.d.ts +2 -1
  193. package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
  194. package/dest/json-rpc/client/safe_json_rpc_client.js +10 -1
  195. package/dest/json-rpc/client/undici.d.ts +1 -1
  196. package/dest/json-rpc/client/undici.d.ts.map +1 -1
  197. package/dest/json-rpc/client/undici.js +21 -4
  198. package/dest/json-rpc/convert.d.ts +1 -1
  199. package/dest/json-rpc/errors.d.ts +1 -1
  200. package/dest/json-rpc/errors.d.ts.map +1 -1
  201. package/dest/json-rpc/fixtures/class_a.d.ts +1 -1
  202. package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
  203. package/dest/json-rpc/fixtures/class_b.d.ts +1 -1
  204. package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
  205. package/dest/json-rpc/fixtures/test_state.d.ts +1 -1
  206. package/dest/json-rpc/fixtures/test_state.d.ts.map +1 -1
  207. package/dest/json-rpc/index.d.ts +1 -1
  208. package/dest/json-rpc/js_utils.d.ts +1 -1
  209. package/dest/json-rpc/js_utils.d.ts.map +1 -1
  210. package/dest/json-rpc/server/api_key_auth.d.ts +19 -0
  211. package/dest/json-rpc/server/api_key_auth.d.ts.map +1 -0
  212. package/dest/json-rpc/server/api_key_auth.js +57 -0
  213. package/dest/json-rpc/server/index.d.ts +2 -1
  214. package/dest/json-rpc/server/index.d.ts.map +1 -1
  215. package/dest/json-rpc/server/index.js +1 -0
  216. package/dest/json-rpc/server/safe_json_rpc_server.d.ts +1 -1
  217. package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +1 -1
  218. package/dest/json-rpc/server/safe_json_rpc_server.js +1 -1
  219. package/dest/json-rpc/test/index.d.ts +1 -1
  220. package/dest/json-rpc/test/integration.d.ts +1 -1
  221. package/dest/log/bigint-utils.d.ts +5 -0
  222. package/dest/log/bigint-utils.d.ts.map +1 -0
  223. package/dest/log/bigint-utils.js +18 -0
  224. package/dest/log/console.d.ts +1 -1
  225. package/dest/log/gcloud-logger-config.d.ts +1 -1
  226. package/dest/log/gcloud-logger-config.d.ts.map +1 -1
  227. package/dest/log/gcloud-logger-config.js +3 -0
  228. package/dest/log/index.d.ts +1 -1
  229. package/dest/log/libp2p_logger.d.ts +5 -2
  230. package/dest/log/libp2p_logger.d.ts.map +1 -1
  231. package/dest/log/libp2p_logger.js +14 -4
  232. package/dest/log/log-filters.d.ts +17 -4
  233. package/dest/log/log-filters.d.ts.map +1 -1
  234. package/dest/log/log-filters.js +26 -12
  235. package/dest/log/log-levels.d.ts +1 -1
  236. package/dest/log/log_fn.d.ts +1 -1
  237. package/dest/log/noir_debug_log_util.d.ts +1 -1
  238. package/dest/log/pino-logger-server.d.ts +9 -0
  239. package/dest/log/pino-logger-server.d.ts.map +1 -0
  240. package/dest/log/pino-logger-server.js +18 -0
  241. package/dest/log/pino-logger.d.ts +38 -9
  242. package/dest/log/pino-logger.d.ts.map +1 -1
  243. package/dest/log/pino-logger.js +122 -30
  244. package/dest/message/index.d.ts +1 -1
  245. package/dest/message/index.d.ts.map +1 -1
  246. package/dest/mutex/index.d.ts +1 -1
  247. package/dest/mutex/index.d.ts.map +1 -1
  248. package/dest/mutex/mutex_database.d.ts +1 -1
  249. package/dest/noir/index.d.ts +1 -1
  250. package/dest/noir/noir_package_config.d.ts +9 -9
  251. package/dest/number/index.d.ts +1 -1
  252. package/dest/profiler/index.d.ts +2 -0
  253. package/dest/profiler/index.d.ts.map +1 -0
  254. package/dest/profiler/index.js +1 -0
  255. package/dest/profiler/profiler.d.ts +8 -0
  256. package/dest/profiler/profiler.d.ts.map +1 -0
  257. package/dest/profiler/profiler.js +97 -0
  258. package/dest/promise/index.d.ts +1 -1
  259. package/dest/promise/running-promise.d.ts +1 -1
  260. package/dest/promise/running-promise.d.ts.map +1 -1
  261. package/dest/promise/utils.d.ts +1 -1
  262. package/dest/queue/base_memory_queue.d.ts +2 -2
  263. package/dest/queue/base_memory_queue.d.ts.map +1 -1
  264. package/dest/queue/batch_queue.d.ts +1 -1
  265. package/dest/queue/batch_queue.d.ts.map +1 -1
  266. package/dest/queue/bounded_serial_queue.d.ts +1 -1
  267. package/dest/queue/bounded_serial_queue.d.ts.map +1 -1
  268. package/dest/queue/fifo_memory_queue.d.ts +1 -1
  269. package/dest/queue/fifo_memory_queue.d.ts.map +1 -1
  270. package/dest/queue/index.d.ts +1 -1
  271. package/dest/queue/priority_memory_queue.d.ts +1 -1
  272. package/dest/queue/priority_memory_queue.d.ts.map +1 -1
  273. package/dest/queue/priority_queue.d.ts +1 -1
  274. package/dest/queue/priority_queue.d.ts.map +1 -1
  275. package/dest/queue/semaphore.d.ts +5 -1
  276. package/dest/queue/semaphore.d.ts.map +1 -1
  277. package/dest/queue/serial_queue.d.ts +1 -1
  278. package/dest/queue/serial_queue.d.ts.map +1 -1
  279. package/dest/retry/index.d.ts +11 -1
  280. package/dest/retry/index.d.ts.map +1 -1
  281. package/dest/retry/index.js +11 -0
  282. package/dest/running-promise/index.d.ts +1 -1
  283. package/dest/schemas/api.d.ts +1 -1
  284. package/dest/schemas/index.d.ts +1 -1
  285. package/dest/schemas/parse.d.ts +1 -1
  286. package/dest/schemas/schemas.d.ts +15 -17
  287. package/dest/schemas/schemas.d.ts.map +1 -1
  288. package/dest/schemas/schemas.js +14 -10
  289. package/dest/schemas/types.d.ts +31 -1
  290. package/dest/schemas/types.d.ts.map +1 -1
  291. package/dest/schemas/types.js +25 -1
  292. package/dest/schemas/utils.d.ts +4 -4
  293. package/dest/schemas/utils.d.ts.map +1 -1
  294. package/dest/schemas/utils.js +15 -5
  295. package/dest/serialize/buffer_reader.d.ts +14 -4
  296. package/dest/serialize/buffer_reader.d.ts.map +1 -1
  297. package/dest/serialize/buffer_reader.js +26 -4
  298. package/dest/serialize/field_reader.d.ts +2 -2
  299. package/dest/serialize/field_reader.d.ts.map +1 -1
  300. package/dest/serialize/field_reader.js +1 -1
  301. package/dest/serialize/free_funcs.d.ts +2 -2
  302. package/dest/serialize/free_funcs.d.ts.map +1 -1
  303. package/dest/serialize/free_funcs.js +1 -1
  304. package/dest/serialize/index.d.ts +1 -1
  305. package/dest/serialize/serialize.d.ts +20 -2
  306. package/dest/serialize/serialize.d.ts.map +1 -1
  307. package/dest/serialize/serialize.js +32 -1
  308. package/dest/serialize/type_registry.d.ts +1 -1
  309. package/dest/serialize/type_registry.d.ts.map +1 -1
  310. package/dest/serialize/types.d.ts +1 -1
  311. package/dest/sleep/index.d.ts +3 -1
  312. package/dest/sleep/index.d.ts.map +1 -1
  313. package/dest/sleep/index.js +4 -0
  314. package/dest/string/index.d.ts +5 -1
  315. package/dest/string/index.d.ts.map +1 -1
  316. package/dest/string/index.js +1 -1
  317. package/dest/testing/files/index.d.ts +2 -1
  318. package/dest/testing/files/index.d.ts.map +1 -1
  319. package/dest/testing/files/index.js +1 -1
  320. package/dest/testing/formatting.d.ts +4 -0
  321. package/dest/testing/formatting.d.ts.map +1 -0
  322. package/dest/testing/formatting.js +3 -0
  323. package/dest/testing/index.d.ts +2 -1
  324. package/dest/testing/index.d.ts.map +1 -1
  325. package/dest/testing/index.js +1 -0
  326. package/dest/testing/port_allocator.d.ts +1 -1
  327. package/dest/testing/snapshot_serializer.d.ts +1 -1
  328. package/dest/testing/test_data.d.ts +1 -1
  329. package/dest/timer/date.d.ts +26 -1
  330. package/dest/timer/date.d.ts.map +1 -1
  331. package/dest/timer/date.js +36 -0
  332. package/dest/timer/elapsed.d.ts +1 -1
  333. package/dest/timer/index.d.ts +1 -1
  334. package/dest/timer/timeout.d.ts +1 -1
  335. package/dest/timer/timeout.d.ts.map +1 -1
  336. package/dest/timer/timer.d.ts +1 -1
  337. package/dest/timer/timer.d.ts.map +1 -1
  338. package/dest/transport/dispatch/create_dispatch_fn.d.ts +1 -1
  339. package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +1 -1
  340. package/dest/transport/dispatch/create_dispatch_proxy.d.ts +1 -1
  341. package/dest/transport/dispatch/messages.d.ts +1 -1
  342. package/dest/transport/index.d.ts +1 -1
  343. package/dest/transport/interface/connector.d.ts +1 -1
  344. package/dest/transport/interface/listener.d.ts +1 -1
  345. package/dest/transport/interface/socket.d.ts +1 -1
  346. package/dest/transport/interface/transferable.d.ts +1 -1
  347. package/dest/transport/node/index.d.ts +1 -1
  348. package/dest/transport/node/node_connector.d.ts +1 -1
  349. package/dest/transport/node/node_connector.d.ts.map +1 -1
  350. package/dest/transport/node/node_connector_socket.d.ts +1 -1
  351. package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
  352. package/dest/transport/node/node_listener.d.ts +1 -1
  353. package/dest/transport/node/node_listener.d.ts.map +1 -1
  354. package/dest/transport/node/node_listener_socket.d.ts +1 -1
  355. package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
  356. package/dest/transport/transport_client.d.ts +1 -1
  357. package/dest/transport/transport_client.d.ts.map +1 -1
  358. package/dest/transport/transport_server.d.ts +1 -10
  359. package/dest/transport/transport_server.d.ts.map +1 -1
  360. package/dest/trees/balanced_merkle_tree_root.d.ts +17 -0
  361. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -0
  362. package/dest/trees/balanced_merkle_tree_root.js +51 -0
  363. package/dest/trees/hasher.d.ts +3 -1
  364. package/dest/trees/hasher.d.ts.map +1 -1
  365. package/dest/trees/hasher.js +10 -5
  366. package/dest/trees/index.d.ts +4 -3
  367. package/dest/trees/index.d.ts.map +1 -1
  368. package/dest/trees/index.js +3 -2
  369. package/dest/trees/indexed_merkle_tree.d.ts +1 -1
  370. package/dest/trees/indexed_merkle_tree.d.ts.map +1 -1
  371. package/dest/trees/indexed_merkle_tree.js +1 -1
  372. package/dest/trees/indexed_merkle_tree_calculator.d.ts +1 -1
  373. package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
  374. package/dest/trees/indexed_tree_leaf.d.ts +1 -1
  375. package/dest/trees/membership_witness.d.ts +7 -18
  376. package/dest/trees/membership_witness.d.ts.map +1 -1
  377. package/dest/trees/membership_witness.js +10 -1
  378. package/dest/trees/merkle_tree.d.ts +1 -1
  379. package/dest/trees/merkle_tree.d.ts.map +1 -1
  380. package/dest/trees/merkle_tree_calculator.d.ts +2 -12
  381. package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
  382. package/dest/trees/merkle_tree_calculator.js +2 -32
  383. package/dest/trees/sibling_path.d.ts +5 -38
  384. package/dest/trees/sibling_path.d.ts.map +1 -1
  385. package/dest/trees/sibling_path.js +3 -3
  386. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +26 -23
  387. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
  388. package/dest/trees/unbalanced_merkle_tree_calculator.js +119 -97
  389. package/dest/trees/unbalanced_merkle_tree_root.d.ts +28 -0
  390. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -0
  391. package/dest/trees/unbalanced_merkle_tree_root.js +84 -0
  392. package/dest/trees/unbalanced_tree_store.d.ts +6 -1
  393. package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
  394. package/dest/trees/unbalanced_tree_store.js +55 -1
  395. package/dest/types/index.d.ts +6 -2
  396. package/dest/types/index.d.ts.map +1 -1
  397. package/dest/types/index.js +6 -0
  398. package/dest/url/index.d.ts +1 -1
  399. package/dest/validation/index.d.ts +1 -1
  400. package/package.json +53 -8
  401. package/src/array/array.ts +0 -16
  402. package/src/array/index.ts +1 -0
  403. package/src/array/sorted_array.ts +138 -0
  404. package/src/branded-types/block_number.ts +117 -0
  405. package/src/branded-types/checkpoint_number.ts +115 -0
  406. package/src/branded-types/epoch.ts +88 -0
  407. package/src/branded-types/index.ts +7 -0
  408. package/src/branded-types/index_within_checkpoint.ts +88 -0
  409. package/src/branded-types/slot.ts +88 -0
  410. package/src/branded-types/types.ts +2 -0
  411. package/src/buffer/buffer16.ts +2 -2
  412. package/src/buffer/buffer32.ts +2 -2
  413. package/src/collection/array.ts +67 -3
  414. package/src/config/env_var.ts +82 -15
  415. package/src/config/index.ts +39 -6
  416. package/src/config/network_config.ts +2 -0
  417. package/src/config/network_name.ts +15 -1
  418. package/src/config/parse-env.ts +4 -0
  419. package/src/crypto/aes128/index.ts +19 -10
  420. package/src/crypto/bls/bn254_keystore.ts +287 -0
  421. package/src/crypto/bls/index.ts +77 -0
  422. package/src/crypto/bn254/index.ts +64 -0
  423. package/src/crypto/ecdsa/index.ts +40 -37
  424. package/src/crypto/ecdsa/signature.ts +2 -2
  425. package/src/crypto/grumpkin/index.ts +38 -46
  426. package/src/crypto/keys/index.ts +6 -6
  427. package/src/crypto/pedersen/pedersen.wasm.ts +23 -19
  428. package/src/crypto/poseidon/index.ts +27 -29
  429. package/src/crypto/random/randomness_singleton.ts +6 -4
  430. package/src/crypto/schnorr/index.ts +22 -18
  431. package/src/crypto/schnorr/signature.ts +2 -2
  432. package/src/crypto/secp256k1/index.ts +15 -11
  433. package/src/crypto/secp256k1-signer/utils.ts +102 -10
  434. package/src/crypto/sha256/index.ts +1 -1
  435. package/src/crypto/sha512/index.ts +1 -1
  436. package/src/crypto/signature/index.ts +1 -1
  437. package/src/crypto/sync/index.ts +1 -1
  438. package/src/crypto/sync/pedersen/index.ts +17 -16
  439. package/src/crypto/sync/poseidon/index.ts +23 -27
  440. package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
  441. package/src/curves/bls12/index.ts +2 -0
  442. package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +14 -14
  443. package/src/{fields/fields.ts → curves/bn254/field.ts} +69 -62
  444. package/src/curves/bn254/index.ts +2 -0
  445. package/src/curves/bn254/point.ts +170 -0
  446. package/src/curves/grumpkin/index.ts +11 -0
  447. package/src/{fields → curves/grumpkin}/point.ts +26 -7
  448. package/src/eth-address/index.ts +27 -2
  449. package/src/iterator/filter.ts +11 -0
  450. package/src/iterator/index.ts +1 -0
  451. package/src/jest/setup.mjs +4 -1
  452. package/src/json-rpc/client/safe_json_rpc_client.ts +11 -0
  453. package/src/json-rpc/client/undici.ts +21 -3
  454. package/src/json-rpc/server/api_key_auth.ts +63 -0
  455. package/src/json-rpc/server/index.ts +1 -0
  456. package/src/json-rpc/server/safe_json_rpc_server.ts +1 -1
  457. package/src/log/bigint-utils.ts +22 -0
  458. package/src/log/gcloud-logger-config.ts +5 -0
  459. package/src/log/libp2p_logger.ts +12 -5
  460. package/src/log/log-filters.ts +29 -11
  461. package/src/log/pino-logger-server.ts +25 -0
  462. package/src/log/pino-logger.ts +144 -40
  463. package/src/profiler/index.ts +1 -0
  464. package/src/profiler/profiler.ts +125 -0
  465. package/src/queue/base_memory_queue.ts +1 -1
  466. package/src/queue/semaphore.ts +5 -0
  467. package/src/retry/index.ts +18 -0
  468. package/src/schemas/schemas.ts +24 -13
  469. package/src/schemas/types.ts +33 -0
  470. package/src/schemas/utils.ts +21 -8
  471. package/src/serialize/buffer_reader.ts +36 -9
  472. package/src/serialize/field_reader.ts +1 -1
  473. package/src/serialize/free_funcs.ts +1 -1
  474. package/src/serialize/serialize.ts +33 -1
  475. package/src/sleep/index.ts +6 -0
  476. package/src/string/index.ts +3 -0
  477. package/src/testing/files/index.ts +1 -1
  478. package/src/testing/formatting.ts +3 -0
  479. package/src/testing/index.ts +1 -0
  480. package/src/timer/date.ts +52 -0
  481. package/src/trees/balanced_merkle_tree_root.ts +68 -0
  482. package/src/trees/hasher.ts +9 -0
  483. package/src/trees/index.ts +3 -2
  484. package/src/trees/indexed_merkle_tree.ts +1 -1
  485. package/src/trees/membership_witness.ts +9 -1
  486. package/src/trees/merkle_tree_calculator.ts +2 -35
  487. package/src/trees/sibling_path.ts +3 -3
  488. package/src/trees/unbalanced_merkle_tree_calculator.ts +123 -93
  489. package/src/trees/unbalanced_merkle_tree_root.ts +115 -0
  490. package/src/trees/unbalanced_tree_store.ts +62 -3
  491. package/src/types/index.ts +11 -1
  492. package/dest/crypto/index.d.ts +0 -15
  493. package/dest/crypto/index.d.ts.map +0 -1
  494. package/dest/crypto/index.js +0 -14
  495. package/dest/fields/bls12_fields.d.ts.map +0 -1
  496. package/dest/fields/bls12_point.d.ts.map +0 -1
  497. package/dest/fields/coordinate.d.ts +0 -66
  498. package/dest/fields/coordinate.d.ts.map +0 -1
  499. package/dest/fields/coordinate.js +0 -96
  500. package/dest/fields/fields.d.ts +0 -174
  501. package/dest/fields/fields.d.ts.map +0 -1
  502. package/dest/fields/index.d.ts +0 -6
  503. package/dest/fields/index.d.ts.map +0 -1
  504. package/dest/fields/index.js +0 -5
  505. package/dest/fields/point.d.ts.map +0 -1
  506. package/dest/index.d.ts +0 -29
  507. package/dest/index.d.ts.map +0 -1
  508. package/dest/index.js +0 -29
  509. package/dest/json-rpc/server/telemetry.d.ts +0 -2
  510. package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
  511. package/dest/json-rpc/server/telemetry.js +0 -0
  512. package/dest/trees/unbalanced_merkle_tree.d.ts +0 -29
  513. package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
  514. package/dest/trees/unbalanced_merkle_tree.js +0 -99
  515. package/src/crypto/index.ts +0 -14
  516. package/src/fields/coordinate.ts +0 -104
  517. package/src/fields/index.ts +0 -5
  518. package/src/index.ts +0 -29
  519. package/src/json-rpc/server/telemetry.ts +0 -0
  520. package/src/trees/unbalanced_merkle_tree.ts +0 -111
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+
3
+ import type { Branded } from './types.js';
4
+
5
+ /**
6
+ * A branded type representing the index of a block within a checkpoint.
7
+ * The first block in a checkpoint has index 0, the second has index 1, etc.
8
+ *
9
+ * This is a nominal type backed by a number, but TypeScript will treat it as
10
+ * incompatible with plain numbers and other branded numeric types.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const index = IndexWithinCheckpoint(0);
15
+ * const plainNumber: number = index; // OK - IndexWithinCheckpoint is assignable to number
16
+ * const indexFromNumber: IndexWithinCheckpoint = 0; // ERROR - number is not assignable to IndexWithinCheckpoint
17
+ * ```
18
+ */
19
+ export type IndexWithinCheckpoint = Branded<number, 'IndexWithinCheckpoint'>;
20
+
21
+ /**
22
+ * Creates an IndexWithinCheckpoint from a number.
23
+ * @param value - The index (must be a non-negative integer)
24
+ * @returns The branded IndexWithinCheckpoint value
25
+ * @throws If the value is negative or not an integer
26
+ */
27
+ export function IndexWithinCheckpoint(value: number): IndexWithinCheckpoint {
28
+ if (!Number.isInteger(value)) {
29
+ throw new Error(`IndexWithinCheckpoint must be an integer, got ${value}`);
30
+ }
31
+ if (value < 0) {
32
+ throw new Error(`IndexWithinCheckpoint must be non-negative, got ${value}`);
33
+ }
34
+ return value as IndexWithinCheckpoint;
35
+ }
36
+
37
+ /**
38
+ * Creates an IndexWithinCheckpoint from a bigint.
39
+ * @param value - The index as bigint (must be a non-negative integer within safe integer range)
40
+ * @returns The branded IndexWithinCheckpoint value
41
+ * @throws If the value is negative or exceeds Number.MAX_SAFE_INTEGER
42
+ */
43
+ IndexWithinCheckpoint.fromBigInt = function (value: bigint): IndexWithinCheckpoint {
44
+ if (value < 0n) {
45
+ throw new Error(`IndexWithinCheckpoint must be non-negative, got ${value}`);
46
+ }
47
+ if (value > BigInt(Number.MAX_SAFE_INTEGER)) {
48
+ throw new Error(`IndexWithinCheckpoint ${value} exceeds MAX_SAFE_INTEGER`);
49
+ }
50
+ return Number(value) as IndexWithinCheckpoint;
51
+ };
52
+
53
+ /**
54
+ * Creates an IndexWithinCheckpoint from a string.
55
+ * @param value - The index as a string
56
+ * @returns The branded IndexWithinCheckpoint value
57
+ * @throws If the string cannot be parsed as a valid index
58
+ */
59
+ IndexWithinCheckpoint.fromString = function (value: string): IndexWithinCheckpoint {
60
+ const parsed = parseInt(value, 10);
61
+ if (isNaN(parsed)) {
62
+ throw new Error(`Cannot parse IndexWithinCheckpoint from string: ${value}`);
63
+ }
64
+ return IndexWithinCheckpoint(parsed);
65
+ };
66
+
67
+ /**
68
+ * Type guard to check if a value is a valid IndexWithinCheckpoint.
69
+ * Note: At runtime, an IndexWithinCheckpoint is just a number, so this checks if the value
70
+ * is a non-negative integer.
71
+ */
72
+ IndexWithinCheckpoint.isValid = function (value: unknown): value is IndexWithinCheckpoint {
73
+ return typeof value === 'number' && Number.isInteger(value) && value >= 0;
74
+ };
75
+
76
+ /**
77
+ * The zero index value (first block in checkpoint).
78
+ */
79
+ IndexWithinCheckpoint.ZERO = IndexWithinCheckpoint(0);
80
+
81
+ /**
82
+ * Zod schema for parsing and validating IndexWithinCheckpoint values.
83
+ * Accepts numbers, bigints, or strings and coerces them to IndexWithinCheckpoint.
84
+ */
85
+ export const IndexWithinCheckpointSchema = z
86
+ .union([z.number(), z.bigint(), z.string()])
87
+ .pipe(z.coerce.number().int().min(0))
88
+ .transform(value => IndexWithinCheckpoint(value));
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+
3
+ import type { Branded } from './types.js';
4
+
5
+ /**
6
+ * A branded type representing a slot number.
7
+ * Slots are the fundamental time unit in the Aztec protocol, with multiple slots comprising an epoch.
8
+ *
9
+ * This is a nominal type backed by a number, but TypeScript will treat it as
10
+ * incompatible with plain numbers and other branded numeric types (like EpochNumber, BlockNumber, etc.).
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const slot = SlotNumber(5);
15
+ * const plainNumber: number = slot; // OK - SlotNumber is assignable to number
16
+ * const slotFromNumber: SlotNumber = 5; // ERROR - number is not assignable to SlotNumber
17
+ * ```
18
+ */
19
+ export type SlotNumber = Branded<number, 'SlotNumber'>;
20
+
21
+ /**
22
+ * Creates a SlotNumber from a number.
23
+ * @param value - The slot number (must be a non-negative integer)
24
+ * @returns The branded SlotNumber value
25
+ * @throws If the value is negative or not an integer
26
+ */
27
+ export function SlotNumber(value: number): SlotNumber {
28
+ if (!Number.isInteger(value)) {
29
+ throw new Error(`SlotNumber must be an integer, got ${value}`);
30
+ }
31
+ if (value < 0) {
32
+ throw new Error(`SlotNumber must be non-negative, got ${value}`);
33
+ }
34
+ return value as SlotNumber;
35
+ }
36
+
37
+ /**
38
+ * Creates a SlotNumber from a bigint.
39
+ * @param value - The slot number as bigint (must be a non-negative integer within safe integer range)
40
+ * @returns The branded SlotNumber value
41
+ * @throws If the value is negative or exceeds Number.MAX_SAFE_INTEGER
42
+ */
43
+ SlotNumber.fromBigInt = function (value: bigint): SlotNumber {
44
+ if (value < 0n) {
45
+ throw new Error(`SlotNumber must be non-negative, got ${value}`);
46
+ }
47
+ if (value > BigInt(Number.MAX_SAFE_INTEGER)) {
48
+ throw new Error(`SlotNumber ${value} exceeds MAX_SAFE_INTEGER`);
49
+ }
50
+ return Number(value) as SlotNumber;
51
+ };
52
+
53
+ /**
54
+ * Creates a SlotNumber from a string.
55
+ * @param value - The slot number as a string
56
+ * @returns The branded SlotNumber value
57
+ * @throws If the string cannot be parsed as a valid slot
58
+ */
59
+ SlotNumber.fromString = function (value: string): SlotNumber {
60
+ const parsed = parseInt(value, 10);
61
+ if (isNaN(parsed)) {
62
+ throw new Error(`Cannot parse SlotNumber from string: ${value}`);
63
+ }
64
+ return SlotNumber(parsed);
65
+ };
66
+
67
+ /**
68
+ * Type guard to check if a value is a valid SlotNumber.
69
+ * Note: At runtime, a SlotNumber is just a number, so this checks if the value
70
+ * is a non-negative integer.
71
+ */
72
+ SlotNumber.isValid = function (value: unknown): value is SlotNumber {
73
+ return typeof value === 'number' && Number.isInteger(value) && value >= 0;
74
+ };
75
+
76
+ /**
77
+ * The zero slot value.
78
+ */
79
+ SlotNumber.ZERO = SlotNumber(0);
80
+
81
+ /**
82
+ * Zod schema for parsing and validating SlotNumber values.
83
+ * Accepts numbers, bigints, or strings and coerces them to SlotNumber.
84
+ */
85
+ export const SlotNumberSchema = z
86
+ .union([z.number(), z.bigint(), z.string()])
87
+ .pipe(z.coerce.number().int().min(0))
88
+ .transform(value => SlotNumber(value));
@@ -0,0 +1,2 @@
1
+ /** Adds a branding to a type for nominal typing. */
2
+ export type Branded<T, Brand> = T & { _branding: Brand };
@@ -1,5 +1,5 @@
1
- import { randomBytes } from '@aztec/foundation/crypto';
2
- import type { Fr } from '@aztec/foundation/fields';
1
+ import { randomBytes } from '@aztec/foundation/crypto/random';
2
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { BufferReader, deserializeBigInt, serializeBigInt } from '@aztec/foundation/serialize';
4
4
 
5
5
  import { inspect } from 'util';
@@ -1,5 +1,5 @@
1
- import { randomBytes } from '@aztec/foundation/crypto';
2
- import type { Fr } from '@aztec/foundation/fields';
1
+ import { randomBytes } from '@aztec/foundation/crypto/random';
2
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { BufferReader, deserializeBigInt, serializeBigInt } from '@aztec/foundation/serialize';
4
4
 
5
5
  import { inspect } from 'util';
@@ -178,13 +178,25 @@ export function sum(arr: number[]): number {
178
178
  }
179
179
 
180
180
  /** Computes the median of a numeric array. Returns undefined if array is empty. */
181
- export function median(arr: number[]) {
181
+ export function median(arr: number[]): number | undefined;
182
+ /** Computes the median of a bigint array. Returns undefined if array is empty. */
183
+ export function median(arr: bigint[]): bigint | undefined;
184
+ export function median(arr: number[] | bigint[]): number | bigint | undefined {
182
185
  if (arr.length === 0) {
183
186
  return undefined;
184
187
  }
185
- const sorted = [...arr].sort((a, b) => a - b);
188
+
189
+ // Handle number array
190
+ if (typeof arr[0] === 'number') {
191
+ const sorted = [...(arr as number[])].sort((a, b) => a - b);
192
+ const mid = Math.floor(sorted.length / 2);
193
+ return sorted.length % 2 !== 0 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
194
+ }
195
+
196
+ // Handle bigint array
197
+ const sorted = [...(arr as bigint[])].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
186
198
  const mid = Math.floor(sorted.length / 2);
187
- return sorted.length % 2 !== 0 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
199
+ return sorted.length % 2 !== 0 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2n;
188
200
  }
189
201
 
190
202
  /** Computes the mean of a numeric array. Returns undefined if the array is empty. */
@@ -238,6 +250,58 @@ export function chunk<T>(items: T[], chunkSize: number): T[][] {
238
250
  return chunks;
239
251
  }
240
252
 
253
+ /**
254
+ * Splits the given array into chunks of the given size, wrapping around to the beginning
255
+ * if the last chunk would be smaller than the requested size.
256
+ * Returns empty array for empty input. Returns single chunk with all items if chunkSize <= 0.
257
+ */
258
+ export function chunkWrapAround<T>(items: T[], chunkSize: number): T[][] {
259
+ if (items.length === 0) {
260
+ return [];
261
+ }
262
+ if (chunkSize <= 0 || items.length <= chunkSize) {
263
+ return [items];
264
+ }
265
+ const remainder = items.length % chunkSize;
266
+ if (remainder === 0) {
267
+ return chunk(items, chunkSize);
268
+ }
269
+ const wrapAroundCount = chunkSize - remainder;
270
+ const wrappedItems = [...items, ...items.slice(0, wrapAroundCount)];
271
+ return chunk(wrappedItems, chunkSize);
272
+ }
273
+
274
+ const UNINITIALIZED = Symbol('uninitialized');
275
+
276
+ /**
277
+ * Splits the given iterable into chunks based on the key returned by the given function.
278
+ * Items must be contiguous to be included in the same chunk.
279
+ */
280
+ export function chunkBy<T, U>(items: T[], fn: (item: T) => U): T[][] {
281
+ const chunks: T[][] = [];
282
+ let currentChunk: T[] = [];
283
+ let currentKey: U | typeof UNINITIALIZED = UNINITIALIZED;
284
+
285
+ for (const item of items) {
286
+ const key = fn(item);
287
+ if (currentKey === UNINITIALIZED || key !== currentKey) {
288
+ if (currentChunk.length > 0) {
289
+ chunks.push(currentChunk);
290
+ }
291
+ currentChunk = [item];
292
+ currentKey = key;
293
+ } else {
294
+ currentChunk.push(item);
295
+ }
296
+ }
297
+
298
+ if (currentChunk.length > 0) {
299
+ chunks.push(currentChunk);
300
+ }
301
+
302
+ return chunks;
303
+ }
304
+
241
305
  /** Partitions the given iterable into two arrays based on the predicate. */
242
306
  export function partition<T>(items: T[], predicate: (item: T) => boolean): [T[], T[]] {
243
307
  const pass: T[] = [];
@@ -12,6 +12,9 @@ export type EnvVar =
12
12
  | 'ARCHIVER_VIEM_POLLING_INTERVAL_MS'
13
13
  | 'ARCHIVER_BATCH_SIZE'
14
14
  | 'AZTEC_ADMIN_PORT'
15
+ | 'AZTEC_ADMIN_API_KEY_HASH'
16
+ | 'AZTEC_DISABLE_ADMIN_API_KEY'
17
+ | 'AZTEC_RESET_ADMIN_API_KEY'
15
18
  | 'AZTEC_NODE_ADMIN_URL'
16
19
  | 'AZTEC_NODE_URL'
17
20
  | 'AZTEC_PORT'
@@ -21,11 +24,13 @@ export type EnvVar =
21
24
  | 'BB_NUM_IVC_VERIFIERS'
22
25
  | 'BB_IVC_CONCURRENCY'
23
26
  | 'BOOTSTRAP_NODES'
24
- | 'BLOB_SINK_ARCHIVE_API_URL'
25
- | 'BLOB_SINK_PORT'
26
- | 'BLOB_SINK_URL'
27
+ | 'BLOB_ARCHIVE_API_URL'
28
+ | 'BLOB_FILE_STORE_URLS'
29
+ | 'BLOB_FILE_STORE_UPLOAD_URL'
30
+ | 'BLOB_HEALTHCHECK_UPLOAD_INTERVAL_MINUTES'
27
31
  | 'BOT_DA_GAS_LIMIT'
28
32
  | 'BOT_FEE_PAYMENT_METHOD'
33
+ | 'BOT_MIN_FEE_PADDING'
29
34
  | 'BOT_FLUSH_SETUP_TRANSACTIONS'
30
35
  | 'BOT_FOLLOW_CHAIN'
31
36
  | 'BOT_L2_GAS_LIMIT'
@@ -38,7 +43,6 @@ export type EnvVar =
38
43
  | 'BOT_ACCOUNT_SALT'
39
44
  | 'BOT_PRIVATE_TRANSFERS_PER_TX'
40
45
  | 'BOT_PUBLIC_TRANSFERS_PER_TX'
41
- | 'BOT_PXE_URL'
42
46
  | 'BOT_RECIPIENT_ENCRYPTION_SECRET'
43
47
  | 'BOT_TOKEN_CONTRACT'
44
48
  | 'BOT_TOKEN_SALT'
@@ -46,7 +50,10 @@ export type EnvVar =
46
50
  | 'BOT_TX_MINED_WAIT_SECONDS'
47
51
  | 'BOT_MAX_CONSECUTIVE_ERRORS'
48
52
  | 'BOT_STOP_WHEN_UNHEALTHY'
49
- | 'BOT_AMM_TXS'
53
+ | 'BOT_MODE'
54
+ | 'BOT_L2_TO_L1_MESSAGES_PER_TX'
55
+ | 'BOT_L1_TO_L2_SEED_COUNT'
56
+ | 'BOT_L1_TO_L2_SEED_INTERVAL'
50
57
  | 'COINBASE'
51
58
  | 'CRS_PATH'
52
59
  | 'DATA_DIRECTORY'
@@ -63,8 +70,10 @@ export type EnvVar =
63
70
  | 'PUBLIC_DATA_TREE_MAP_SIZE_KB'
64
71
  | 'DEBUG'
65
72
  | 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
66
- | 'DEPLOY_AZTEC_CONTRACTS_SALT'
73
+ | 'ENABLE_PROVER_NODE'
67
74
  | 'ETHEREUM_HOSTS'
75
+ | 'ETHEREUM_DEBUG_HOSTS'
76
+ | 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS'
68
77
  | 'FEE_RECIPIENT'
69
78
  | 'FORCE_COLOR'
70
79
  | 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS'
@@ -75,6 +84,7 @@ export type EnvVar =
75
84
  | 'L1_CONSENSUS_HOST_API_KEY_HEADERS'
76
85
  | 'LOG_JSON'
77
86
  | 'LOG_MULTILINE'
87
+ | 'LOG_NO_COLOR_PER_ACTOR'
78
88
  | 'LOG_LEVEL'
79
89
  | 'MNEMONIC'
80
90
  | 'NETWORK'
@@ -86,12 +96,18 @@ export type EnvVar =
86
96
  | 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT'
87
97
  | 'OTEL_COLLECT_INTERVAL_MS'
88
98
  | 'OTEL_EXCLUDE_METRICS'
99
+ | 'OTEL_INCLUDE_METRICS'
89
100
  | 'OTEL_EXPORT_TIMEOUT_MS'
90
101
  | 'PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'
91
102
  | 'PUBLIC_OTEL_INCLUDE_METRICS'
92
103
  | 'PUBLIC_OTEL_COLLECT_FROM'
93
104
  | 'PUBLIC_OTEL_OPT_OUT'
105
+ | 'P2P_BATCH_TX_REQUESTER_SMART_PARALLEL_WORKER_COUNT'
106
+ | 'P2P_BATCH_TX_REQUESTER_DUMB_PARALLEL_WORKER_COUNT'
107
+ | 'P2P_BATCH_TX_REQUESTER_TX_BATCH_SIZE'
108
+ | 'P2P_BATCH_TX_REQUESTER_BAD_PEER_THRESHOLD'
94
109
  | 'P2P_BLOCK_CHECK_INTERVAL_MS'
110
+ | 'P2P_SLOT_CHECK_INTERVAL_MS'
95
111
  | 'P2P_BLOCK_REQUEST_BATCH_SIZE'
96
112
  | 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK'
97
113
  | 'P2P_BOOTSTRAP_NODES_AS_FULL_PEERS'
@@ -130,12 +146,12 @@ export type EnvVar =
130
146
  | 'P2P_TRUSTED_PEERS'
131
147
  | 'P2P_PRIVATE_PEERS'
132
148
  | 'P2P_PREFERRED_PEERS'
133
- | 'P2P_MAX_TX_POOL_SIZE'
134
- | 'P2P_TX_POOL_OVERFLOW_FACTOR'
149
+ | 'P2P_MAX_PENDING_TX_COUNT'
135
150
  | 'P2P_SEEN_MSG_CACHE_SIZE'
136
- | 'P2P_DROP_TX'
137
151
  | 'P2P_DROP_TX_CHANCE'
138
152
  | 'P2P_TX_POOL_DELETE_TXS_AFTER_REORG'
153
+ | 'P2P_MIN_TX_POOL_AGE_MS'
154
+ | 'DEBUG_P2P_INSTRUMENT_MESSAGES'
139
155
  | 'PEER_ID_PRIVATE_KEY'
140
156
  | 'PEER_ID_PRIVATE_KEY_PATH'
141
157
  | 'PROVER_AGENT_COUNT'
@@ -148,7 +164,10 @@ export type EnvVar =
148
164
  | 'PROVER_BROKER_BATCH_INTERVAL_MS'
149
165
  | 'PROVER_BROKER_BATCH_SIZE'
150
166
  | 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
167
+ | 'PROVER_BROKER_DEBUG_REPLAY_ENABLED'
168
+ | 'PROVER_CANCEL_JOBS_ON_STOP'
151
169
  | 'PROVER_COORDINATION_NODE_URLS'
170
+ | 'PROVER_PROOF_STORE'
152
171
  | 'PROVER_FAILED_PROOF_STORE'
153
172
  | 'PROVER_NODE_FAILED_EPOCH_STORE'
154
173
  | 'PROVER_NODE_DISABLE_PROOF_PUBLISH'
@@ -164,15 +183,19 @@ export type EnvVar =
164
183
  | 'PROVER_PUBLISHER_PRIVATE_KEYS'
165
184
  | 'PROVER_PUBLISHER_ADDRESSES'
166
185
  | 'PROVER_PUBLISHER_ALLOW_INVALID_STATES'
186
+ | 'PROVER_PUBLISHER_FORWARDER_ADDRESS'
167
187
  | 'PROVER_REAL_PROOFS'
168
188
  | 'PROVER_TEST_DELAY_FACTOR'
169
189
  | 'PROVER_TEST_DELAY_MS'
170
190
  | 'PROVER_TEST_DELAY_TYPE'
191
+ | 'PROVER_TEST_VERIFICATION_DELAY_MS'
171
192
  | 'PXE_L2_BLOCK_BATCH_SIZE'
172
193
  | 'PXE_PROVER_ENABLED'
194
+ | 'PXE_SYNC_CHAIN_TIP'
173
195
  | 'RPC_MAX_BATCH_SIZE'
174
196
  | 'RPC_MAX_BODY_SIZE'
175
197
  | 'RPC_SIMULATE_PUBLIC_MAX_GAS_LIMIT'
198
+ | 'RPC_SIMULATE_PUBLIC_MAX_DEBUG_LOG_MEMORY_READS'
176
199
  | 'SENTINEL_ENABLED'
177
200
  | 'SENTINEL_HISTORY_LENGTH_IN_EPOCHS'
178
201
  | 'SENTINEL_HISTORIC_PROVEN_PERFORMANCE_LENGTH_IN_EPOCHS'
@@ -186,12 +209,17 @@ export type EnvVar =
186
209
  | 'SEQ_PUBLISHER_PRIVATE_KEYS'
187
210
  | 'SEQ_PUBLISHER_ADDRESSES'
188
211
  | 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
189
- | 'SEQ_TX_POLLING_INTERVAL_MS'
212
+ | 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
213
+ | 'SEQ_POLLING_INTERVAL_MS'
190
214
  | 'SEQ_ENFORCE_TIME_TABLE'
191
- | 'SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT'
215
+ | 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
192
216
  | 'SEQ_ATTESTATION_PROPAGATION_TIME'
217
+ | 'SEQ_BLOCK_DURATION_MS'
218
+ | 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT'
219
+ | 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
193
220
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
194
221
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
222
+ | 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT'
195
223
  | 'SLASH_MIN_PENALTY_PERCENTAGE'
196
224
  | 'SLASH_MAX_PENALTY_PERCENTAGE'
197
225
  | 'SLASH_VALIDATORS_ALWAYS'
@@ -202,6 +230,8 @@ export type EnvVar =
202
230
  | 'SLASH_INACTIVITY_TARGET_PERCENTAGE'
203
231
  | 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD'
204
232
  | 'SLASH_INVALID_BLOCK_PENALTY'
233
+ | 'SLASH_DUPLICATE_PROPOSAL_PENALTY'
234
+ | 'SLASH_DUPLICATE_ATTESTATION_PENALTY'
205
235
  | 'SLASH_OVERRIDE_PAYLOAD'
206
236
  | 'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY'
207
237
  | 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY'
@@ -226,6 +256,20 @@ export type EnvVar =
226
256
  | 'TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE'
227
257
  | 'TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE'
228
258
  | 'TX_COLLECTION_NODE_RPC_URLS'
259
+ | 'TX_COLLECTION_MISSING_TXS_COLLECTOR_TYPE'
260
+ | 'TX_COLLECTION_FILE_STORE_URLS'
261
+ | 'TX_COLLECTION_FILE_STORE_SLOW_DELAY_MS'
262
+ | 'TX_COLLECTION_FILE_STORE_FAST_DELAY_MS'
263
+ | 'TX_COLLECTION_FILE_STORE_FAST_WORKER_COUNT'
264
+ | 'TX_COLLECTION_FILE_STORE_SLOW_WORKER_COUNT'
265
+ | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_BASE_MS'
266
+ | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_BASE_MS'
267
+ | 'TX_COLLECTION_FILE_STORE_FAST_BACKOFF_MAX_MS'
268
+ | 'TX_COLLECTION_FILE_STORE_SLOW_BACKOFF_MAX_MS'
269
+ | 'TX_FILE_STORE_URL'
270
+ | 'TX_FILE_STORE_UPLOAD_CONCURRENCY'
271
+ | 'TX_FILE_STORE_MAX_QUEUE_SIZE'
272
+ | 'TX_FILE_STORE_ENABLED'
229
273
  | 'TX_PUBLIC_SETUP_ALLOWLIST'
230
274
  | 'TXE_PORT'
231
275
  | 'TRANSACTIONS_DISABLED'
@@ -237,22 +281,25 @@ export type EnvVar =
237
281
  | 'VALIDATOR_ADDRESSES'
238
282
  | 'ROLLUP_VERSION'
239
283
  | 'WS_BLOCK_CHECK_INTERVAL_MS'
240
- | 'WS_PROVEN_BLOCKS_ONLY'
241
284
  | 'WS_BLOCK_REQUEST_BATCH_SIZE'
242
285
  | 'L1_READER_VIEM_POLLING_INTERVAL_MS'
243
286
  | 'WS_DATA_DIRECTORY'
287
+ | 'WS_NUM_HISTORIC_CHECKPOINTS'
244
288
  | 'WS_NUM_HISTORIC_BLOCKS'
245
289
  | 'ETHEREUM_SLOT_DURATION'
246
290
  | 'AZTEC_SLOT_DURATION'
247
291
  | 'AZTEC_EPOCH_DURATION'
248
292
  | 'AZTEC_TARGET_COMMITTEE_SIZE'
249
- | 'AZTEC_LAG_IN_EPOCHS'
293
+ | 'AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET'
294
+ | 'AZTEC_LAG_IN_EPOCHS_FOR_RANDAO'
295
+ | 'AZTEC_INBOX_LAG'
250
296
  | 'AZTEC_PROOF_SUBMISSION_EPOCHS'
251
297
  | 'AZTEC_ACTIVATION_THRESHOLD'
252
298
  | 'AZTEC_EJECTION_THRESHOLD'
253
299
  | 'AZTEC_LOCAL_EJECTION_THRESHOLD'
254
300
  | 'AZTEC_MANA_TARGET'
255
301
  | 'AZTEC_PROVING_COST_PER_MANA'
302
+ | 'AZTEC_INITIAL_ETH_PER_FEE_ASSET'
256
303
  | 'AZTEC_SLASHING_QUORUM'
257
304
  | 'AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS'
258
305
  | 'AZTEC_SLASHING_LIFETIME_IN_ROUNDS'
@@ -266,13 +313,18 @@ export type EnvVar =
266
313
  | 'AZTEC_SLASHER_FLAVOR'
267
314
  | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
268
315
  | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
316
+ | 'AZTEC_GOVERNANCE_VOTING_DURATION'
269
317
  | 'AZTEC_EXIT_DELAY_SECONDS'
270
318
  | 'L1_GAS_LIMIT_BUFFER_PERCENTAGE'
271
319
  | 'L1_GAS_PRICE_MAX'
320
+ | 'L1_FEE_PER_GAS_GWEI_MAX'
272
321
  | 'L1_BLOB_FEE_PER_GAS_MAX'
322
+ | 'L1_BLOB_FEE_PER_GAS_GWEI_MAX'
273
323
  | 'L1_PRIORITY_FEE_BUMP_PERCENTAGE'
274
324
  | 'L1_PRIORITY_FEE_RETRY_BUMP_PERCENTAGE'
325
+ | 'L1_MINIMUM_PRIORITY_FEE_PER_GAS_GWEI'
275
326
  | 'L1_FIXED_PRIORITY_FEE_PER_GAS'
327
+ | 'L1_FIXED_PRIORITY_FEE_PER_GAS_GWEI'
276
328
  | 'L1_TX_MONITOR_MAX_ATTEMPTS'
277
329
  | 'L1_TX_MONITOR_CHECK_INTERVAL_MS'
278
330
  | 'L1_TX_MONITOR_STALL_TIME_MS'
@@ -288,9 +340,24 @@ export type EnvVar =
288
340
  | 'K8S_POD_UID'
289
341
  | 'K8S_NAMESPACE_NAME'
290
342
  | 'VALIDATOR_REEXECUTE_DEADLINE_MS'
291
- | 'ALWAYS_REEXECUTE_BLOCK_PROPOSALS'
292
343
  | 'AUTO_UPDATE'
293
344
  | 'AUTO_UPDATE_URL'
294
345
  | 'WEB3_SIGNER_URL'
295
346
  | 'SKIP_ARCHIVER_INITIAL_SYNC'
296
- | 'BLOB_ALLOW_EMPTY_SOURCES';
347
+ | 'BLOB_ALLOW_EMPTY_SOURCES'
348
+ | 'FISHERMAN_MODE'
349
+ | 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
350
+ | 'LEGACY_BLS_CLI'
351
+ | 'DEBUG_FORCE_TX_PROOF_VERIFICATION'
352
+ | 'VALIDATOR_HA_SIGNING_ENABLED'
353
+ | 'VALIDATOR_HA_NODE_ID'
354
+ | 'VALIDATOR_HA_POLLING_INTERVAL_MS'
355
+ | 'VALIDATOR_HA_SIGNING_TIMEOUT_MS'
356
+ | 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS'
357
+ | 'VALIDATOR_HA_OLD_DUTIES_MAX_AGE_H'
358
+ | 'VALIDATOR_HA_DATABASE_URL'
359
+ | 'VALIDATOR_HA_RUN_MIGRATIONS'
360
+ | 'VALIDATOR_HA_POOL_MAX'
361
+ | 'VALIDATOR_HA_POOL_MIN'
362
+ | 'VALIDATOR_HA_POOL_IDLE_TIMEOUT_MS'
363
+ | 'VALIDATOR_HA_POOL_CONNECTION_TIMEOUT_MS';
@@ -1,6 +1,8 @@
1
- import { Fq, Fr } from '../fields/fields.js';
1
+ import { Fq, Fr } from '../curves/bn254/field.js';
2
+ import { createConsoleLogger } from '../log/console.js';
2
3
  import type { EnvVar } from './env_var.js';
3
4
  import { type NetworkNames, getActiveNetworkName } from './network_name.js';
5
+ import { parseBooleanEnv } from './parse-env.js';
4
6
  import { SecretValue } from './secret_value.js';
5
7
 
6
8
  export { SecretValue, getActiveNetworkName };
@@ -17,6 +19,11 @@ export interface ConfigMapping {
17
19
  isBoolean?: boolean;
18
20
  nested?: Record<string, ConfigMapping>;
19
21
  fallback?: EnvVar[];
22
+ /**
23
+ * List of deprecated env vars that are still supported but will log a warning.
24
+ * These should also be included in the fallback array for parsing.
25
+ */
26
+ deprecatedFallback?: { env: EnvVar; message?: string }[];
20
27
  }
21
28
 
22
29
  export function isBooleanConfigValue<T>(obj: T, key: keyof T): boolean {
@@ -72,12 +79,24 @@ export function getConfigFromMappings<T>(configMappings: ConfigMappingsType<T>):
72
79
  const config = {} as T;
73
80
 
74
81
  for (const key in configMappings) {
75
- const { env, parseEnv, defaultValue, nested, fallback } = configMappings[key];
82
+ const { env, parseEnv, defaultValue, nested, fallback, deprecatedFallback } = configMappings[key];
76
83
  if (nested) {
77
84
  (config as any)[key] = getConfigFromMappings(nested);
78
85
  } else {
79
86
  // Use the shared utility function
80
87
  (config as any)[key] = getValueFromEnvWithFallback(env, parseEnv, defaultValue, fallback);
88
+
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
+ }
98
+ }
99
+ }
81
100
  }
82
101
  }
83
102
 
@@ -130,6 +149,23 @@ export function floatConfigHelper(
130
149
  };
131
150
  }
132
151
 
152
+ /**
153
+ * Parses an environment variable to a 0-1 percentage value
154
+ */
155
+ export function percentageConfigHelper(defaultVal: number): Pick<ConfigMapping, 'parseEnv' | 'defaultValue'> {
156
+ return {
157
+ parseEnv: (val: string): number => {
158
+ const parsed = safeParseFloat(val, defaultVal);
159
+ if (parsed < 0 || parsed > 1) {
160
+ throw new TypeError(`Invalid percentage value: ${parsed} should be between 0 and 1`);
161
+ }
162
+
163
+ return parsed;
164
+ },
165
+ defaultValue: defaultVal,
166
+ };
167
+ }
168
+
133
169
  /**
134
170
  * Generates parseEnv and default values for a numerical config value.
135
171
  * @param defaultVal - The default numerical value to use if the environment variable is not set or is invalid
@@ -213,10 +249,7 @@ export function secretValueConfigHelper<T>(parse: (val: string | undefined) => T
213
249
  };
214
250
  }
215
251
 
216
- /** Parses an env var as boolean. Returns true only if value is 1, true, or TRUE. */
217
- export function parseBooleanEnv(val: string | undefined): boolean {
218
- return val !== undefined && ['1', 'true', 'TRUE'].includes(val);
219
- }
252
+ export { parseBooleanEnv } from './parse-env.js';
220
253
 
221
254
  export function secretStringConfigHelper(): Required<
222
255
  Pick<ConfigMapping, 'parseEnv' | 'defaultValue' | 'isBoolean'> & {
@@ -4,9 +4,11 @@ export const NetworkConfigSchema = z
4
4
  .object({
5
5
  bootnodes: z.array(z.string()),
6
6
  snapshots: z.array(z.string()),
7
+ blobFileStoreUrls: z.array(z.string()).optional(),
7
8
  registryAddress: z.string(),
8
9
  feeAssetHandlerAddress: z.string().optional(),
9
10
  l1ChainId: z.number(),
11
+ blockDurationMs: z.number().positive().optional(),
10
12
  })
11
13
  .passthrough(); // Allow additional unknown fields to pass through
12
14
 
@@ -1,4 +1,12 @@
1
- export type NetworkNames = 'local' | 'staging-ignition' | 'staging-public' | 'testnet' | 'mainnet';
1
+ export type NetworkNames =
2
+ | 'local'
3
+ | 'staging-ignition'
4
+ | 'staging-public'
5
+ | 'testnet'
6
+ | 'mainnet'
7
+ | 'next-net'
8
+ | 'devnet'
9
+ | `v${number}-devnet-${number}`;
2
10
 
3
11
  export function getActiveNetworkName(name?: string): NetworkNames {
4
12
  const network = name || process.env.NETWORK;
@@ -12,6 +20,12 @@ export function getActiveNetworkName(name?: string): NetworkNames {
12
20
  return 'testnet';
13
21
  } else if (network === 'mainnet') {
14
22
  return 'mainnet';
23
+ } else if (network === 'next-net') {
24
+ return 'next-net';
25
+ } else if (network === 'devnet') {
26
+ return 'devnet';
27
+ } else if (/^v\d+-devnet-\d+$/.test(network)) {
28
+ return network as `v${number}-devnet-${number}`;
15
29
  }
16
30
  throw new Error(`Unknown network: ${network}`);
17
31
  }
@@ -0,0 +1,4 @@
1
+ /** Parses an env var as boolean. Returns true only if value is 1, true, or TRUE. */
2
+ export function parseBooleanEnv(val: string | undefined): boolean {
3
+ return val !== undefined && ['1', 'true', 'TRUE'].includes(val);
4
+ }