@aztec/foundation 0.0.1-commit.d3ec352c → 0.0.1-commit.e3c1de76

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 (296) hide show
  1. package/dest/array/index.d.ts +2 -1
  2. package/dest/array/index.d.ts.map +1 -1
  3. package/dest/array/index.js +1 -0
  4. package/dest/array/sorted_array.d.ts +10 -0
  5. package/dest/array/sorted_array.d.ts.map +1 -0
  6. package/dest/array/sorted_array.js +106 -0
  7. package/dest/branded-types/block_number.d.ts +4 -1
  8. package/dest/branded-types/block_number.d.ts.map +1 -1
  9. package/dest/branded-types/block_number.js +3 -0
  10. package/dest/branded-types/checkpoint_number.d.ts +10 -2
  11. package/dest/branded-types/checkpoint_number.d.ts.map +1 -1
  12. package/dest/branded-types/checkpoint_number.js +17 -8
  13. package/dest/branded-types/index.d.ts +3 -2
  14. package/dest/branded-types/index.d.ts.map +1 -1
  15. package/dest/branded-types/index.js +2 -1
  16. package/dest/branded-types/index_within_checkpoint.d.ts +42 -0
  17. package/dest/branded-types/index_within_checkpoint.d.ts.map +1 -0
  18. package/dest/branded-types/index_within_checkpoint.js +59 -0
  19. package/dest/buffer/buffer16.d.ts +5 -2
  20. package/dest/buffer/buffer16.d.ts.map +1 -1
  21. package/dest/buffer/buffer16.js +4 -2
  22. package/dest/buffer/buffer32.d.ts +5 -2
  23. package/dest/buffer/buffer32.d.ts.map +1 -1
  24. package/dest/buffer/buffer32.js +4 -2
  25. package/dest/collection/array.d.ts +12 -1
  26. package/dest/collection/array.d.ts.map +1 -1
  27. package/dest/collection/array.js +51 -0
  28. package/dest/config/env_var.d.ts +2 -2
  29. package/dest/config/env_var.d.ts.map +1 -1
  30. package/dest/config/index.d.ts +15 -4
  31. package/dest/config/index.d.ts.map +1 -1
  32. package/dest/config/index.js +32 -9
  33. package/dest/config/network_config.d.ts +13 -1
  34. package/dest/config/network_config.d.ts.map +1 -1
  35. package/dest/config/network_config.js +3 -1
  36. package/dest/config/parse-env.d.ts +3 -0
  37. package/dest/config/parse-env.d.ts.map +1 -0
  38. package/dest/config/parse-env.js +7 -0
  39. package/dest/config/secret_value.js +3 -1
  40. package/dest/crypto/bls/bn254_keystore.js +1 -1
  41. package/dest/crypto/bls/index.js +1 -1
  42. package/dest/crypto/bn254/index.d.ts +35 -51
  43. package/dest/crypto/bn254/index.d.ts.map +1 -1
  44. package/dest/crypto/bn254/index.js +51 -140
  45. package/dest/crypto/ecdsa/signature.d.ts +11 -2
  46. package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
  47. package/dest/crypto/ecdsa/signature.js +2 -2
  48. package/dest/crypto/grumpkin/index.d.ts +4 -2
  49. package/dest/crypto/grumpkin/index.d.ts.map +1 -1
  50. package/dest/crypto/grumpkin/index.js +2 -1
  51. package/dest/crypto/keys/index.d.ts +2 -2
  52. package/dest/crypto/keys/index.d.ts.map +1 -1
  53. package/dest/crypto/keys/index.js +1 -1
  54. package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
  55. package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
  56. package/dest/crypto/pedersen/pedersen.wasm.js +1 -1
  57. package/dest/crypto/poseidon/index.d.ts +2 -3
  58. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  59. package/dest/crypto/poseidon/index.js +1 -10
  60. package/dest/crypto/random/randomness_singleton.d.ts +4 -3
  61. package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
  62. package/dest/crypto/random/randomness_singleton.js +5 -5
  63. package/dest/crypto/schnorr/index.d.ts +3 -2
  64. package/dest/crypto/schnorr/index.d.ts.map +1 -1
  65. package/dest/crypto/schnorr/index.js +1 -1
  66. package/dest/crypto/schnorr/signature.d.ts +2 -2
  67. package/dest/crypto/schnorr/signature.d.ts.map +1 -1
  68. package/dest/crypto/schnorr/signature.js +2 -2
  69. package/dest/crypto/sha256/index.d.ts +2 -2
  70. package/dest/crypto/sha256/index.d.ts.map +1 -1
  71. package/dest/crypto/sha256/index.js +1 -1
  72. package/dest/crypto/sha512/index.d.ts +2 -2
  73. package/dest/crypto/sha512/index.d.ts.map +1 -1
  74. package/dest/crypto/sha512/index.js +1 -1
  75. package/dest/crypto/signature/index.d.ts +2 -2
  76. package/dest/crypto/signature/index.d.ts.map +1 -1
  77. package/dest/crypto/sync/pedersen/index.d.ts +2 -2
  78. package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
  79. package/dest/crypto/sync/pedersen/index.js +1 -1
  80. package/dest/crypto/sync/poseidon/index.d.ts +2 -3
  81. package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
  82. package/dest/crypto/sync/poseidon/index.js +1 -9
  83. package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
  84. package/dest/curves/bls12/field.d.ts.map +1 -0
  85. package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
  86. package/dest/curves/bls12/index.d.ts +3 -0
  87. package/dest/curves/bls12/index.d.ts.map +1 -0
  88. package/dest/curves/bls12/index.js +2 -0
  89. package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +13 -4
  90. package/dest/curves/bls12/point.d.ts.map +1 -0
  91. package/dest/{fields/bls12_point.js → curves/bls12/point.js} +10 -8
  92. package/dest/{fields/fields.d.ts → curves/bn254/field.d.ts} +7 -15
  93. package/dest/curves/bn254/field.d.ts.map +1 -0
  94. package/dest/{fields/fields.js → curves/bn254/field.js} +35 -49
  95. package/dest/curves/bn254/index.d.ts +3 -0
  96. package/dest/curves/bn254/index.d.ts.map +1 -0
  97. package/dest/curves/bn254/index.js +2 -0
  98. package/dest/curves/bn254/point.d.ts +54 -0
  99. package/dest/curves/bn254/point.d.ts.map +1 -0
  100. package/dest/curves/bn254/point.js +143 -0
  101. package/dest/curves/grumpkin/index.d.ts +10 -0
  102. package/dest/curves/grumpkin/index.d.ts.map +1 -0
  103. package/dest/curves/grumpkin/index.js +3 -0
  104. package/dest/{fields → curves/grumpkin}/point.d.ts +13 -4
  105. package/dest/curves/grumpkin/point.d.ts.map +1 -0
  106. package/dest/{fields → curves/grumpkin}/point.js +7 -7
  107. package/dest/error/index.d.ts +4 -4
  108. package/dest/error/index.d.ts.map +1 -1
  109. package/dest/eth-address/index.d.ts +3 -2
  110. package/dest/eth-address/index.d.ts.map +1 -1
  111. package/dest/eth-address/index.js +10 -3
  112. package/dest/eth-signature/eth_signature.d.ts +4 -1
  113. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  114. package/dest/iterator/filter.d.ts +3 -0
  115. package/dest/iterator/filter.d.ts.map +1 -0
  116. package/dest/iterator/filter.js +7 -0
  117. package/dest/iterator/index.d.ts +2 -0
  118. package/dest/iterator/index.d.ts.map +1 -0
  119. package/dest/iterator/index.js +1 -0
  120. package/dest/jest/setup.js +4 -1
  121. package/dest/json-rpc/client/undici.d.ts +1 -1
  122. package/dest/json-rpc/client/undici.d.ts.map +1 -1
  123. package/dest/json-rpc/client/undici.js +21 -4
  124. package/dest/json-rpc/fixtures/class_a.d.ts +3 -3
  125. package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
  126. package/dest/json-rpc/fixtures/class_b.d.ts +3 -3
  127. package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
  128. package/dest/json-rpc/server/safe_json_rpc_server.js +1 -1
  129. package/dest/log/libp2p_logger.d.ts +5 -2
  130. package/dest/log/libp2p_logger.d.ts.map +1 -1
  131. package/dest/log/libp2p_logger.js +14 -4
  132. package/dest/log/pino-logger-server.d.ts +9 -0
  133. package/dest/log/pino-logger-server.d.ts.map +1 -0
  134. package/dest/log/pino-logger-server.js +18 -0
  135. package/dest/log/pino-logger.d.ts +37 -8
  136. package/dest/log/pino-logger.d.ts.map +1 -1
  137. package/dest/log/pino-logger.js +116 -27
  138. package/dest/queue/semaphore.d.ts +5 -1
  139. package/dest/queue/semaphore.d.ts.map +1 -1
  140. package/dest/retry/index.d.ts +11 -1
  141. package/dest/retry/index.d.ts.map +1 -1
  142. package/dest/retry/index.js +11 -0
  143. package/dest/schemas/schemas.d.ts +7 -3
  144. package/dest/schemas/schemas.d.ts.map +1 -1
  145. package/dest/schemas/schemas.js +9 -3
  146. package/dest/schemas/types.d.ts +31 -1
  147. package/dest/schemas/types.d.ts.map +1 -1
  148. package/dest/schemas/types.js +25 -1
  149. package/dest/serialize/buffer_reader.d.ts +7 -4
  150. package/dest/serialize/buffer_reader.d.ts.map +1 -1
  151. package/dest/serialize/buffer_reader.js +13 -4
  152. package/dest/serialize/field_reader.d.ts +2 -2
  153. package/dest/serialize/field_reader.d.ts.map +1 -1
  154. package/dest/serialize/field_reader.js +1 -1
  155. package/dest/serialize/free_funcs.d.ts +2 -2
  156. package/dest/serialize/free_funcs.d.ts.map +1 -1
  157. package/dest/serialize/free_funcs.js +1 -1
  158. package/dest/serialize/serialize.d.ts +2 -2
  159. package/dest/serialize/serialize.d.ts.map +1 -1
  160. package/dest/serialize/serialize.js +1 -1
  161. package/dest/sleep/index.d.ts +3 -1
  162. package/dest/sleep/index.d.ts.map +1 -1
  163. package/dest/sleep/index.js +4 -0
  164. package/dest/timer/date.d.ts +2 -1
  165. package/dest/timer/date.d.ts.map +1 -1
  166. package/dest/timer/date.js +3 -0
  167. package/dest/trees/balanced_merkle_tree_root.d.ts +17 -0
  168. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -0
  169. package/dest/trees/{balanced_merkle_tree.js → balanced_merkle_tree_root.js} +2 -15
  170. package/dest/trees/hasher.d.ts +3 -1
  171. package/dest/trees/hasher.d.ts.map +1 -1
  172. package/dest/trees/hasher.js +10 -5
  173. package/dest/trees/index.d.ts +4 -4
  174. package/dest/trees/index.d.ts.map +1 -1
  175. package/dest/trees/index.js +3 -3
  176. package/dest/trees/indexed_merkle_tree.js +1 -1
  177. package/dest/trees/membership_witness.d.ts +12 -2
  178. package/dest/trees/membership_witness.d.ts.map +1 -1
  179. package/dest/trees/membership_witness.js +10 -1
  180. package/dest/trees/merkle_tree_calculator.d.ts +1 -1
  181. package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
  182. package/dest/trees/merkle_tree_calculator.js +2 -2
  183. package/dest/trees/sibling_path.d.ts +3 -2
  184. package/dest/trees/sibling_path.d.ts.map +1 -1
  185. package/dest/trees/sibling_path.js +3 -3
  186. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +2 -3
  187. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
  188. package/dest/trees/unbalanced_merkle_tree_calculator.js +1 -5
  189. package/dest/trees/{unbalanced_merkle_tree.d.ts → unbalanced_merkle_tree_root.d.ts} +3 -5
  190. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -0
  191. package/dest/trees/{unbalanced_merkle_tree.js → unbalanced_merkle_tree_root.js} +11 -49
  192. package/dest/trees/unbalanced_tree_store.d.ts +5 -1
  193. package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
  194. package/dest/trees/unbalanced_tree_store.js +49 -1
  195. package/dest/types/index.d.ts +6 -2
  196. package/dest/types/index.d.ts.map +1 -1
  197. package/dest/types/index.js +6 -0
  198. package/package.json +26 -7
  199. package/src/array/index.ts +1 -0
  200. package/src/array/sorted_array.ts +133 -0
  201. package/src/branded-types/block_number.ts +5 -0
  202. package/src/branded-types/checkpoint_number.ts +22 -7
  203. package/src/branded-types/index.ts +2 -1
  204. package/src/branded-types/index_within_checkpoint.ts +88 -0
  205. package/src/buffer/buffer16.ts +2 -2
  206. package/src/buffer/buffer32.ts +2 -2
  207. package/src/collection/array.ts +52 -0
  208. package/src/config/env_var.ts +39 -12
  209. package/src/config/index.ts +39 -6
  210. package/src/config/network_config.ts +2 -0
  211. package/src/config/parse-env.ts +4 -0
  212. package/src/crypto/bls/bn254_keystore.ts +1 -1
  213. package/src/crypto/bls/index.ts +1 -1
  214. package/src/crypto/bn254/index.ts +50 -159
  215. package/src/crypto/ecdsa/signature.ts +2 -2
  216. package/src/crypto/grumpkin/index.ts +3 -1
  217. package/src/crypto/keys/index.ts +1 -1
  218. package/src/crypto/pedersen/pedersen.wasm.ts +1 -1
  219. package/src/crypto/poseidon/index.ts +1 -11
  220. package/src/crypto/random/randomness_singleton.ts +6 -4
  221. package/src/crypto/schnorr/index.ts +2 -1
  222. package/src/crypto/schnorr/signature.ts +2 -2
  223. package/src/crypto/sha256/index.ts +1 -1
  224. package/src/crypto/sha512/index.ts +1 -1
  225. package/src/crypto/signature/index.ts +1 -1
  226. package/src/crypto/sync/pedersen/index.ts +1 -1
  227. package/src/crypto/sync/poseidon/index.ts +1 -10
  228. package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
  229. package/src/curves/bls12/index.ts +2 -0
  230. package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +7 -7
  231. package/src/{fields/fields.ts → curves/bn254/field.ts} +33 -56
  232. package/src/curves/bn254/index.ts +2 -0
  233. package/src/curves/bn254/point.ts +170 -0
  234. package/src/curves/grumpkin/index.ts +11 -0
  235. package/src/{fields → curves/grumpkin}/point.ts +7 -7
  236. package/src/eth-address/index.ts +8 -2
  237. package/src/iterator/filter.ts +11 -0
  238. package/src/iterator/index.ts +1 -0
  239. package/src/jest/setup.mjs +4 -1
  240. package/src/json-rpc/client/undici.ts +21 -3
  241. package/src/json-rpc/server/safe_json_rpc_server.ts +1 -1
  242. package/src/log/libp2p_logger.ts +12 -5
  243. package/src/log/pino-logger-server.ts +25 -0
  244. package/src/log/pino-logger.ts +138 -37
  245. package/src/queue/semaphore.ts +5 -0
  246. package/src/retry/index.ts +18 -0
  247. package/src/schemas/schemas.ts +14 -3
  248. package/src/schemas/types.ts +33 -0
  249. package/src/serialize/buffer_reader.ts +21 -9
  250. package/src/serialize/field_reader.ts +1 -1
  251. package/src/serialize/free_funcs.ts +1 -1
  252. package/src/serialize/serialize.ts +1 -1
  253. package/src/sleep/index.ts +6 -0
  254. package/src/timer/date.ts +4 -0
  255. package/src/trees/{balanced_merkle_tree.ts → balanced_merkle_tree_root.ts} +2 -16
  256. package/src/trees/hasher.ts +9 -0
  257. package/src/trees/index.ts +3 -3
  258. package/src/trees/indexed_merkle_tree.ts +1 -1
  259. package/src/trees/membership_witness.ts +9 -1
  260. package/src/trees/merkle_tree_calculator.ts +2 -2
  261. package/src/trees/sibling_path.ts +3 -3
  262. package/src/trees/unbalanced_merkle_tree_calculator.ts +1 -12
  263. package/src/trees/{unbalanced_merkle_tree.ts → unbalanced_merkle_tree_root.ts} +17 -61
  264. package/src/trees/unbalanced_tree_store.ts +57 -2
  265. package/src/types/index.ts +11 -1
  266. package/dest/crypto/bn254/bn254_utils.d.ts +0 -39
  267. package/dest/crypto/bn254/bn254_utils.d.ts.map +0 -1
  268. package/dest/crypto/bn254/bn254_utils.js +0 -56
  269. package/dest/crypto/index.d.ts +0 -17
  270. package/dest/crypto/index.d.ts.map +0 -1
  271. package/dest/crypto/index.js +0 -16
  272. package/dest/fields/bls12_fields.d.ts.map +0 -1
  273. package/dest/fields/bls12_point.d.ts.map +0 -1
  274. package/dest/fields/coordinate.d.ts +0 -63
  275. package/dest/fields/coordinate.d.ts.map +0 -1
  276. package/dest/fields/coordinate.js +0 -96
  277. package/dest/fields/fields.d.ts.map +0 -1
  278. package/dest/fields/index.d.ts +0 -6
  279. package/dest/fields/index.d.ts.map +0 -1
  280. package/dest/fields/index.js +0 -5
  281. package/dest/fields/point.d.ts.map +0 -1
  282. package/dest/index.d.ts +0 -31
  283. package/dest/index.d.ts.map +0 -1
  284. package/dest/index.js +0 -31
  285. package/dest/json-rpc/server/telemetry.d.ts +0 -2
  286. package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
  287. package/dest/json-rpc/server/telemetry.js +0 -0
  288. package/dest/trees/balanced_merkle_tree.d.ts +0 -22
  289. package/dest/trees/balanced_merkle_tree.d.ts.map +0 -1
  290. package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
  291. package/src/crypto/bn254/bn254_utils.ts +0 -64
  292. package/src/crypto/index.ts +0 -16
  293. package/src/fields/coordinate.ts +0 -104
  294. package/src/fields/index.ts +0 -5
  295. package/src/index.ts +0 -31
  296. package/src/json-rpc/server/telemetry.ts +0 -0
@@ -21,12 +21,13 @@ export type EnvVar =
21
21
  | 'BB_NUM_IVC_VERIFIERS'
22
22
  | 'BB_IVC_CONCURRENCY'
23
23
  | 'BOOTSTRAP_NODES'
24
- | 'BLOB_SINK_ARCHIVE_API_URL'
25
- | 'BLOB_SINK_PORT'
26
- | 'BLOB_SINK_URL'
24
+ | 'BLOB_ARCHIVE_API_URL'
25
+ | 'BLOB_FILE_STORE_URLS'
26
+ | 'BLOB_FILE_STORE_UPLOAD_URL'
27
+ | 'BLOB_HEALTHCHECK_UPLOAD_INTERVAL_MINUTES'
27
28
  | 'BOT_DA_GAS_LIMIT'
28
29
  | 'BOT_FEE_PAYMENT_METHOD'
29
- | 'BOT_BASE_FEE_PADDING'
30
+ | 'BOT_MIN_FEE_PADDING'
30
31
  | 'BOT_FLUSH_SETUP_TRANSACTIONS'
31
32
  | 'BOT_FOLLOW_CHAIN'
32
33
  | 'BOT_L2_GAS_LIMIT'
@@ -63,8 +64,9 @@ export type EnvVar =
63
64
  | 'PUBLIC_DATA_TREE_MAP_SIZE_KB'
64
65
  | 'DEBUG'
65
66
  | 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
66
- | 'DEPLOY_AZTEC_CONTRACTS_SALT'
67
67
  | 'ETHEREUM_HOSTS'
68
+ | 'ETHEREUM_DEBUG_HOSTS'
69
+ | 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS'
68
70
  | 'FEE_RECIPIENT'
69
71
  | 'FORCE_COLOR'
70
72
  | 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS'
@@ -75,6 +77,7 @@ export type EnvVar =
75
77
  | 'L1_CONSENSUS_HOST_API_KEY_HEADERS'
76
78
  | 'LOG_JSON'
77
79
  | 'LOG_MULTILINE'
80
+ | 'LOG_NO_COLOR_PER_ACTOR'
78
81
  | 'LOG_LEVEL'
79
82
  | 'MNEMONIC'
80
83
  | 'NETWORK'
@@ -92,6 +95,10 @@ export type EnvVar =
92
95
  | 'PUBLIC_OTEL_INCLUDE_METRICS'
93
96
  | 'PUBLIC_OTEL_COLLECT_FROM'
94
97
  | 'PUBLIC_OTEL_OPT_OUT'
98
+ | 'P2P_BATCH_TX_REQUESTER_SMART_PARALLEL_WORKER_COUNT'
99
+ | 'P2P_BATCH_TX_REQUESTER_DUMB_PARALLEL_WORKER_COUNT'
100
+ | 'P2P_BATCH_TX_REQUESTER_TX_BATCH_SIZE'
101
+ | 'P2P_BATCH_TX_REQUESTER_BAD_PEER_THRESHOLD'
95
102
  | 'P2P_BLOCK_CHECK_INTERVAL_MS'
96
103
  | 'P2P_BLOCK_REQUEST_BATCH_SIZE'
97
104
  | 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK'
@@ -131,8 +138,7 @@ export type EnvVar =
131
138
  | 'P2P_TRUSTED_PEERS'
132
139
  | 'P2P_PRIVATE_PEERS'
133
140
  | 'P2P_PREFERRED_PEERS'
134
- | 'P2P_MAX_TX_POOL_SIZE'
135
- | 'P2P_TX_POOL_OVERFLOW_FACTOR'
141
+ | 'P2P_MAX_PENDING_TX_COUNT'
136
142
  | 'P2P_SEEN_MSG_CACHE_SIZE'
137
143
  | 'P2P_DROP_TX'
138
144
  | 'P2P_DROP_TX_CHANCE'
@@ -150,6 +156,7 @@ export type EnvVar =
150
156
  | 'PROVER_BROKER_BATCH_INTERVAL_MS'
151
157
  | 'PROVER_BROKER_BATCH_SIZE'
152
158
  | 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
159
+ | 'PROVER_CANCEL_JOBS_ON_STOP'
153
160
  | 'PROVER_COORDINATION_NODE_URLS'
154
161
  | 'PROVER_FAILED_PROOF_STORE'
155
162
  | 'PROVER_NODE_FAILED_EPOCH_STORE'
@@ -166,6 +173,7 @@ export type EnvVar =
166
173
  | 'PROVER_PUBLISHER_PRIVATE_KEYS'
167
174
  | 'PROVER_PUBLISHER_ADDRESSES'
168
175
  | 'PROVER_PUBLISHER_ALLOW_INVALID_STATES'
176
+ | 'PROVER_PUBLISHER_FORWARDER_ADDRESS'
169
177
  | 'PROVER_REAL_PROOFS'
170
178
  | 'PROVER_TEST_DELAY_FACTOR'
171
179
  | 'PROVER_TEST_DELAY_MS'
@@ -173,6 +181,7 @@ export type EnvVar =
173
181
  | 'PROVER_TEST_VERIFICATION_DELAY_MS'
174
182
  | 'PXE_L2_BLOCK_BATCH_SIZE'
175
183
  | 'PXE_PROVER_ENABLED'
184
+ | 'PXE_SYNC_CHAIN_TIP'
176
185
  | 'RPC_MAX_BATCH_SIZE'
177
186
  | 'RPC_MAX_BODY_SIZE'
178
187
  | 'RPC_SIMULATE_PUBLIC_MAX_GAS_LIMIT'
@@ -190,10 +199,13 @@ export type EnvVar =
190
199
  | 'SEQ_PUBLISHER_PRIVATE_KEYS'
191
200
  | 'SEQ_PUBLISHER_ADDRESSES'
192
201
  | 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
193
- | 'SEQ_TX_POLLING_INTERVAL_MS'
202
+ | 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
203
+ | 'SEQ_POLLING_INTERVAL_MS'
194
204
  | 'SEQ_ENFORCE_TIME_TABLE'
195
- | 'SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT'
205
+ | 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
196
206
  | 'SEQ_ATTESTATION_PROPAGATION_TIME'
207
+ | 'SEQ_BLOCK_DURATION_MS'
208
+ | 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
197
209
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
198
210
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
199
211
  | 'SLASH_MIN_PENALTY_PERCENTAGE'
@@ -230,6 +242,7 @@ export type EnvVar =
230
242
  | 'TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE'
231
243
  | 'TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE'
232
244
  | 'TX_COLLECTION_NODE_RPC_URLS'
245
+ | 'TX_COLLECTION_PROPOSAL_TX_COLLECTOR_TYPE'
233
246
  | 'TX_PUBLIC_SETUP_ALLOWLIST'
234
247
  | 'TXE_PORT'
235
248
  | 'TRANSACTIONS_DISABLED'
@@ -241,7 +254,6 @@ export type EnvVar =
241
254
  | 'VALIDATOR_ADDRESSES'
242
255
  | 'ROLLUP_VERSION'
243
256
  | 'WS_BLOCK_CHECK_INTERVAL_MS'
244
- | 'WS_PROVEN_BLOCKS_ONLY'
245
257
  | 'WS_BLOCK_REQUEST_BATCH_SIZE'
246
258
  | 'L1_READER_VIEM_POLLING_INTERVAL_MS'
247
259
  | 'WS_DATA_DIRECTORY'
@@ -252,12 +264,14 @@ export type EnvVar =
252
264
  | 'AZTEC_TARGET_COMMITTEE_SIZE'
253
265
  | 'AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET'
254
266
  | 'AZTEC_LAG_IN_EPOCHS_FOR_RANDAO'
267
+ | 'AZTEC_INBOX_LAG'
255
268
  | 'AZTEC_PROOF_SUBMISSION_EPOCHS'
256
269
  | 'AZTEC_ACTIVATION_THRESHOLD'
257
270
  | 'AZTEC_EJECTION_THRESHOLD'
258
271
  | 'AZTEC_LOCAL_EJECTION_THRESHOLD'
259
272
  | 'AZTEC_MANA_TARGET'
260
273
  | 'AZTEC_PROVING_COST_PER_MANA'
274
+ | 'AZTEC_INITIAL_ETH_PER_FEE_ASSET'
261
275
  | 'AZTEC_SLASHING_QUORUM'
262
276
  | 'AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS'
263
277
  | 'AZTEC_SLASHING_LIFETIME_IN_ROUNDS'
@@ -271,6 +285,7 @@ export type EnvVar =
271
285
  | 'AZTEC_SLASHER_FLAVOR'
272
286
  | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
273
287
  | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
288
+ | 'AZTEC_GOVERNANCE_VOTING_DURATION'
274
289
  | 'AZTEC_EXIT_DELAY_SECONDS'
275
290
  | 'L1_GAS_LIMIT_BUFFER_PERCENTAGE'
276
291
  | 'L1_GAS_PRICE_MAX'
@@ -279,6 +294,7 @@ export type EnvVar =
279
294
  | 'L1_BLOB_FEE_PER_GAS_GWEI_MAX'
280
295
  | 'L1_PRIORITY_FEE_BUMP_PERCENTAGE'
281
296
  | 'L1_PRIORITY_FEE_RETRY_BUMP_PERCENTAGE'
297
+ | 'L1_MINIMUM_PRIORITY_FEE_PER_GAS_GWEI'
282
298
  | 'L1_FIXED_PRIORITY_FEE_PER_GAS'
283
299
  | 'L1_FIXED_PRIORITY_FEE_PER_GAS_GWEI'
284
300
  | 'L1_TX_MONITOR_MAX_ATTEMPTS'
@@ -296,7 +312,6 @@ export type EnvVar =
296
312
  | 'K8S_POD_UID'
297
313
  | 'K8S_NAMESPACE_NAME'
298
314
  | 'VALIDATOR_REEXECUTE_DEADLINE_MS'
299
- | 'ALWAYS_REEXECUTE_BLOCK_PROPOSALS'
300
315
  | 'AUTO_UPDATE'
301
316
  | 'AUTO_UPDATE_URL'
302
317
  | 'WEB3_SIGNER_URL'
@@ -304,4 +319,16 @@ export type EnvVar =
304
319
  | 'BLOB_ALLOW_EMPTY_SOURCES'
305
320
  | 'FISHERMAN_MODE'
306
321
  | 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
307
- | 'LEGACY_BLS_CLI';
322
+ | 'LEGACY_BLS_CLI'
323
+ | 'DEBUG_FORCE_TX_PROOF_VERIFICATION'
324
+ | 'VALIDATOR_HA_SIGNING_ENABLED'
325
+ | 'VALIDATOR_HA_NODE_ID'
326
+ | 'VALIDATOR_HA_POLLING_INTERVAL_MS'
327
+ | 'VALIDATOR_HA_SIGNING_TIMEOUT_MS'
328
+ | 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS'
329
+ | 'VALIDATOR_HA_DATABASE_URL'
330
+ | 'VALIDATOR_HA_RUN_MIGRATIONS'
331
+ | 'VALIDATOR_HA_POOL_MAX'
332
+ | 'VALIDATOR_HA_POOL_MIN'
333
+ | 'VALIDATOR_HA_POOL_IDLE_TIMEOUT_MS'
334
+ | '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
 
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- import { randomBytes } from '@aztec/foundation/crypto';
1
+ import { randomBytes } from '@aztec/foundation/crypto/random';
2
2
 
3
3
  import { createCipheriv, createDecipheriv, createHash, pbkdf2Sync, randomUUID } from 'crypto';
4
4
  import { readFileSync } from 'fs';
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { Hex } from '@aztec/foundation/string';
3
3
 
4
4
  import { mod } from '@noble/curves/abstract/modular';
@@ -1,173 +1,64 @@
1
- import {
2
- BN254_G1_GENERATOR,
3
- BN254_G2_GENERATOR,
4
- BarretenbergSync,
5
- type Bn254G1Point as BbApiBn254G1Point,
6
- type Bn254G2Point as BbApiBn254G2Point,
7
- } from '@aztec/bb.js';
8
-
9
- import { Fq, Fr } from '../../fields/fields.js';
1
+ import { Fr } from '../../curves/bn254/field.js';
2
+ import { Bn254G1Point, Bn254G2Point } from '../../curves/bn254/point.js';
10
3
 
11
4
  /**
12
- * BN254 G1 point using foundation field classes.
13
- * Represents a point on the BN254 elliptic curve in affine coordinates.
5
+ * BN254 utility functions for point operations.
6
+ * Provides compression, decompression, and public key generation for the BN254 curve.
7
+ * Uses the bb.js Barretenberg backend for point operations.
14
8
  */
15
- export class Bn254G1Point {
16
- constructor(
17
- public readonly x: Fq,
18
- public readonly y: Fq,
19
- ) {}
20
-
21
- private toBbApiPoint(): BbApiBn254G1Point {
22
- return {
23
- x: this.x.toBuffer(),
24
- y: this.y.toBuffer(),
25
- };
26
- }
27
-
28
- private static fromBbApiPoint(point: BbApiBn254G1Point): Bn254G1Point {
29
- return new Bn254G1Point(Fq.fromBuffer(Buffer.from(point.x)), Fq.fromBuffer(Buffer.from(point.y)));
30
- }
31
-
32
- async isOnCurve(): Promise<boolean> {
33
- await BarretenbergSync.initSingleton();
34
- const api = BarretenbergSync.getSingleton();
35
-
36
- const apiPoint = this.toBbApiPoint();
37
- const response = api.bn254G1IsOnCurve({ point: apiPoint });
38
- return response.isOnCurve;
39
- }
40
-
41
- /**
42
- * Get the generator point for BN254 G1, or perform scalar multiplication.
43
- * When called without arguments, returns the base generator point.
44
- * When called with a scalar, returns scalar * generator (useful for public key derivation).
45
- */
46
- static async generator(scalar?: Fr): Promise<Bn254G1Point> {
47
- if (!scalar) {
48
- return new Bn254G1Point(
49
- Fq.fromBuffer(Buffer.from(BN254_G1_GENERATOR.x)),
50
- Fq.fromBuffer(Buffer.from(BN254_G1_GENERATOR.y)),
51
- );
52
- }
53
-
54
- await BarretenbergSync.initSingleton();
55
- const api = BarretenbergSync.getSingleton();
56
-
57
- const response = api.bn254G1Mul({
58
- point: BN254_G1_GENERATOR,
59
- scalar: scalar.toBuffer(),
60
- });
61
-
62
- return Bn254G1Point.fromBbApiPoint(response.point);
63
- }
64
-
65
- /**
66
- * Decompress a BN254 G1 point from compressed form (32 bytes).
67
- * The compressed format encodes the x-coordinate and the sign bit of the y-coordinate
68
- * in the most significant bit.
69
- */
70
- static async fromCompressed(compressed: Buffer): Promise<Bn254G1Point> {
71
- if (compressed.length !== 32) {
72
- throw new Error('Invalid compressed point length');
73
- }
74
- await BarretenbergSync.initSingleton();
75
- const api = BarretenbergSync.getSingleton();
76
-
77
- const response = api.bn254G1FromCompressed({
78
- compressed: new Uint8Array(compressed),
79
- });
80
-
81
- return Bn254G1Point.fromBbApiPoint(response.point);
82
- }
83
9
 
84
- /**
85
- * Compress this BN254 G1 point to 32 bytes.
86
- * The compressed format encodes the x-coordinate and the sign bit of the y-coordinate
87
- * in the most significant bit (bit 255).
88
- */
89
- compress(): Buffer {
90
- const xBytes = this.x.toBuffer();
91
- // Get the least significant bit of y to determine the sign
92
- const yLsb = this.y.toBigInt() & 1n;
93
- // If y is odd, set the most significant bit (bit 255) of the output
94
- if (yLsb === 1n) {
95
- xBytes[0] |= 0x80;
96
- }
97
- return xBytes;
98
- }
10
+ /**
11
+ * Generate a compressed BN254 G1 public key from a private key.
12
+ *
13
+ * @param privateKeyHex - Private key as 0x-prefixed hex string
14
+ * @returns Compressed G1 point (32 bytes with sign bit in MSB)
15
+ */
16
+ export async function computeBn254G1PublicKeyCompressed(privateKeyHex: string): Promise<string> {
17
+ const sk = BigInt(privateKeyHex);
18
+ const skReduced = sk % Fr.MODULUS;
99
19
 
100
- equals(other: Bn254G1Point): boolean {
101
- return this.x.equals(other.x) && this.y.equals(other.y);
102
- }
20
+ // Generate G1 point on BN254 curve using bb.js
21
+ const scalar = Fr.fromString(skReduced.toString());
22
+ const pk1 = await Bn254G1Point.generator(scalar);
103
23
 
104
- toString(): string {
105
- return `Bn254G1Point(x: ${this.x.toString()}, y: ${this.y.toString()})`;
106
- }
24
+ // Compress the point using the primitive method
25
+ return '0x' + pk1.compress().toString('hex');
107
26
  }
108
27
 
109
28
  /**
110
- * BN254 G2 point using foundation field classes.
111
- * Represents a point on the BN254 G2 curve (twist curve) in affine coordinates.
112
- * G2 points use extension field coordinates (Fq2).
29
+ * Generate uncompressed BN254 G1 public key from a private key.
30
+ *
31
+ * @param privateKeyHex - Private key as 0x-prefixed hex string
32
+ * @returns G1 point in affine coordinates
113
33
  */
114
- export class Bn254G2Point {
115
- constructor(
116
- public readonly x: [Fq, Fq],
117
- public readonly y: [Fq, Fq],
118
- ) {}
119
-
120
- private toBbApiPoint(): BbApiBn254G2Point {
121
- return {
122
- x: [this.x[0].toBuffer(), this.x[1].toBuffer()],
123
- y: [this.y[0].toBuffer(), this.y[1].toBuffer()],
124
- };
125
- }
126
-
127
- private static fromBbApiPoint(point: BbApiBn254G2Point): Bn254G2Point {
128
- return new Bn254G2Point(
129
- [Fq.fromBuffer(Buffer.from(point.x[0])), Fq.fromBuffer(Buffer.from(point.x[1]))],
130
- [Fq.fromBuffer(Buffer.from(point.y[0])), Fq.fromBuffer(Buffer.from(point.y[1]))],
131
- );
132
- }
133
-
134
- /**
135
- * Get the generator point for BN254 G2, or perform scalar multiplication.
136
- * When called without arguments, returns the base generator point.
137
- * When called with a scalar, returns scalar * generator.
138
- */
139
- static async generator(scalar?: Fr): Promise<Bn254G2Point> {
140
- if (!scalar) {
141
- return new Bn254G2Point(
142
- [Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.x[0])), Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.x[1]))],
143
- [Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.y[0])), Fq.fromBuffer(Buffer.from(BN254_G2_GENERATOR.y[1]))],
144
- );
145
- }
146
-
147
- await BarretenbergSync.initSingleton();
148
- const api = BarretenbergSync.getSingleton();
34
+ export async function computeBn254G1PublicKey(privateKeyHex: string): Promise<{ x: bigint; y: bigint }> {
35
+ const sk = BigInt(privateKeyHex);
36
+ const skReduced = sk % Fr.MODULUS;
149
37
 
150
- const response = api.bn254G2Mul({
151
- point: BN254_G2_GENERATOR as BbApiBn254G2Point,
152
- scalar: scalar.toBuffer(),
153
- });
38
+ const scalar = Fr.fromString(skReduced.toString());
39
+ const pk1 = await Bn254G1Point.generator(scalar);
154
40
 
155
- return Bn254G2Point.fromBbApiPoint(response.point);
156
- }
157
-
158
- equals(other: Bn254G2Point): boolean {
159
- return (
160
- this.x[0].equals(other.x[0]) &&
161
- this.x[1].equals(other.x[1]) &&
162
- this.y[0].equals(other.y[0]) &&
163
- this.y[1].equals(other.y[1])
164
- );
165
- }
166
-
167
- toString(): string {
168
- return `Bn254G2Point(x: (${this.x[0].toString()}, ${this.x[1].toString()}), y: (${this.y[0].toString()}, ${this.y[1].toString()}))`;
169
- }
41
+ return { x: pk1.x.toBigInt(), y: pk1.y.toBigInt() };
170
42
  }
171
43
 
172
- // Re-export BN254 point utility functions
173
- export { computeBn254G1PublicKeyCompressed, computeBn254G1PublicKey, computeBn254G2PublicKey } from './bn254_utils.js';
44
+ /**
45
+ * Generate BN254 G2 public key from a private key.
46
+ *
47
+ * @param privateKeyHex - Private key as 0x-prefixed hex string
48
+ * @returns G2 point in affine coordinates
49
+ */
50
+ export async function computeBn254G2PublicKey(privateKeyHex: string): Promise<{
51
+ x: { c0: bigint; c1: bigint };
52
+ y: { c0: bigint; c1: bigint };
53
+ }> {
54
+ const sk = BigInt(privateKeyHex);
55
+ const skReduced = sk % Fr.MODULUS;
56
+
57
+ const scalar = Fr.fromString(skReduced.toString());
58
+ const pk2 = await Bn254G2Point.generator(scalar);
59
+
60
+ return {
61
+ x: { c0: pk2.x[0].toBigInt(), c1: pk2.x[1].toBigInt() },
62
+ y: { c0: pk2.y[0].toBigInt(), c1: pk2.y[1].toBigInt() },
63
+ };
64
+ }
@@ -1,6 +1,6 @@
1
1
  import { toBufferBE } from '@aztec/foundation/bigint-buffer';
2
- import { randomBytes } from '@aztec/foundation/crypto';
3
- import { Fr } from '@aztec/foundation/fields';
2
+ import { randomBytes } from '@aztec/foundation/crypto/random';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { mapTuple } from '@aztec/foundation/serialize';
5
5
 
6
6
  import type { Signature } from '../signature/index.js';
@@ -1,5 +1,7 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
- import { Fr, type GrumpkinScalar, Point } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
4
+ import { Point } from '@aztec/foundation/curves/grumpkin';
3
5
 
4
6
  /**
5
7
  * Grumpkin elliptic curve operations.
@@ -1,6 +1,6 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
2
 
3
- import { Fr } from '../../fields/fields.js';
3
+ import { Fr } from '../../curves/bn254/field.js';
4
4
 
5
5
  export async function vkAsFieldsMegaHonk(input: Buffer): Promise<Fr[]> {
6
6
  await BarretenbergSync.initSingleton();
@@ -1,6 +1,6 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
2
 
3
- import { Fr } from '../../fields/fields.js';
3
+ import { Fr } from '../../curves/bn254/field.js';
4
4
  import { type Fieldable, serializeToFields } from '../../serialize/serialize.js';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
2
 
3
- import { Fr } from '../../fields/fields.js';
3
+ import { Fr } from '../../curves/bn254/field.js';
4
4
  import { type Fieldable, serializeToFields } from '../../serialize/serialize.js';
5
5
 
6
6
  /**
@@ -35,16 +35,6 @@ export async function poseidon2HashWithSeparator(input: Fieldable[], separator:
35
35
  return Fr.fromBuffer(Buffer.from(response.hash));
36
36
  }
37
37
 
38
- export async function poseidon2HashAccumulate(input: Fieldable[]): Promise<Fr> {
39
- const inputFields = serializeToFields(input);
40
- await BarretenbergSync.initSingleton();
41
- const api = BarretenbergSync.getSingleton();
42
- const response = api.poseidon2HashAccumulate({
43
- inputs: inputFields.map(i => i.toBuffer()),
44
- });
45
- return Fr.fromBuffer(Buffer.from(response.hash));
46
- }
47
-
48
38
  /**
49
39
  * Runs a Poseidon2 permutation.
50
40
  * @param input the input state. Expected to be of size 4.
@@ -1,4 +1,4 @@
1
- import { createLogger } from '../../log/pino-logger.js';
1
+ import { type Logger, type LoggerBindings, createLogger } from '../../log/pino-logger.js';
2
2
 
3
3
  /**
4
4
  * A number generator which is used as a source of randomness in the system. If the SEED env variable is set, the
@@ -12,11 +12,13 @@ export class RandomnessSingleton {
12
12
  private static instance: RandomnessSingleton;
13
13
 
14
14
  private counter = 0;
15
+ private log: Logger;
15
16
 
16
17
  private constructor(
17
18
  private readonly seed?: number,
18
- private readonly log = createLogger('foundation:randomness_singleton'),
19
+ bindings?: LoggerBindings,
19
20
  ) {
21
+ this.log = createLogger('foundation:randomness_singleton', bindings);
20
22
  if (seed !== undefined) {
21
23
  this.log.debug(`Using pseudo-randomness with seed: ${seed}`);
22
24
  this.counter = seed;
@@ -25,10 +27,10 @@ export class RandomnessSingleton {
25
27
  }
26
28
  }
27
29
 
28
- public static getInstance(): RandomnessSingleton {
30
+ public static getInstance(bindings?: LoggerBindings): RandomnessSingleton {
29
31
  if (!RandomnessSingleton.instance) {
30
32
  const seed = process.env.SEED ? Number(process.env.SEED) : undefined;
31
- RandomnessSingleton.instance = new RandomnessSingleton(seed);
33
+ RandomnessSingleton.instance = new RandomnessSingleton(seed, bindings);
32
34
  }
33
35
 
34
36
  return RandomnessSingleton.instance;
@@ -1,5 +1,6 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
- import { type GrumpkinScalar, Point } from '@aztec/foundation/fields';
2
+ import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
3
+ import { Point } from '@aztec/foundation/curves/grumpkin';
3
4
 
4
5
  import { SchnorrSignature } from './signature.js';
5
6
 
@@ -1,5 +1,5 @@
1
- import { randomBytes } from '@aztec/foundation/crypto';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { randomBytes } from '@aztec/foundation/crypto/random';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { BufferReader, mapTuple } from '@aztec/foundation/serialize';
4
4
 
5
5
  import type { Signature } from '../signature/index.js';
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable camelcase */
2
2
  import { default as hash } from 'hash.js';
3
3
 
4
- import { Fr } from '../../fields/fields.js';
4
+ import { Fr } from '../../curves/bn254/field.js';
5
5
  import { truncateAndPad } from '../../serialize/free_funcs.js';
6
6
  import { type Bufferable, serializeToBuffer } from '../../serialize/serialize.js';
7
7
  import type { Hasher } from '../../trees/hasher.js';
@@ -1,6 +1,6 @@
1
1
  import { default as hash } from 'hash.js';
2
2
 
3
- import { GrumpkinScalar } from '../../fields/fields.js';
3
+ import { GrumpkinScalar } from '../../curves/grumpkin/index.js';
4
4
  import { type Bufferable, serializeToBuffer } from '../../serialize/serialize.js';
5
5
 
6
6
  export const sha512 = (data: Buffer) => Buffer.from(hash.sha512().update(data).digest());
@@ -1,4 +1,4 @@
1
- import type { Fr } from '@aztec/foundation/fields';
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
2
 
3
3
  /**
4
4
  * Interface to represent a signature.
@@ -1,6 +1,6 @@
1
1
  import { BarretenbergSync } from '@aztec/bb.js';
2
2
 
3
- import { Fr } from '../../../fields/fields.js';
3
+ import { Fr } from '../../../curves/bn254/field.js';
4
4
  import { type Fieldable, serializeToFields } from '../../../serialize/serialize.js';
5
5
 
6
6
  /**