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

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 (270) 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/config/env_var.d.ts +2 -2
  26. package/dest/config/env_var.d.ts.map +1 -1
  27. package/dest/config/index.d.ts +15 -4
  28. package/dest/config/index.d.ts.map +1 -1
  29. package/dest/config/index.js +32 -9
  30. package/dest/config/network_config.d.ts +13 -1
  31. package/dest/config/network_config.d.ts.map +1 -1
  32. package/dest/config/network_config.js +3 -1
  33. package/dest/config/parse-env.d.ts +3 -0
  34. package/dest/config/parse-env.d.ts.map +1 -0
  35. package/dest/config/parse-env.js +7 -0
  36. package/dest/config/secret_value.js +3 -1
  37. package/dest/crypto/bls/bn254_keystore.js +1 -1
  38. package/dest/crypto/bls/index.js +1 -1
  39. package/dest/crypto/bn254/index.d.ts +35 -51
  40. package/dest/crypto/bn254/index.d.ts.map +1 -1
  41. package/dest/crypto/bn254/index.js +51 -140
  42. package/dest/crypto/ecdsa/signature.d.ts +11 -2
  43. package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
  44. package/dest/crypto/ecdsa/signature.js +2 -2
  45. package/dest/crypto/grumpkin/index.d.ts +4 -2
  46. package/dest/crypto/grumpkin/index.d.ts.map +1 -1
  47. package/dest/crypto/grumpkin/index.js +2 -1
  48. package/dest/crypto/keys/index.d.ts +2 -2
  49. package/dest/crypto/keys/index.d.ts.map +1 -1
  50. package/dest/crypto/keys/index.js +1 -1
  51. package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
  52. package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
  53. package/dest/crypto/pedersen/pedersen.wasm.js +1 -1
  54. package/dest/crypto/poseidon/index.d.ts +2 -2
  55. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  56. package/dest/crypto/poseidon/index.js +1 -1
  57. package/dest/crypto/random/randomness_singleton.d.ts +2 -2
  58. package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
  59. package/dest/crypto/random/randomness_singleton.js +3 -3
  60. package/dest/crypto/schnorr/index.d.ts +3 -2
  61. package/dest/crypto/schnorr/index.d.ts.map +1 -1
  62. package/dest/crypto/schnorr/index.js +1 -1
  63. package/dest/crypto/schnorr/signature.d.ts +2 -2
  64. package/dest/crypto/schnorr/signature.d.ts.map +1 -1
  65. package/dest/crypto/schnorr/signature.js +2 -2
  66. package/dest/crypto/sha256/index.d.ts +2 -2
  67. package/dest/crypto/sha256/index.d.ts.map +1 -1
  68. package/dest/crypto/sha256/index.js +1 -1
  69. package/dest/crypto/sha512/index.d.ts +2 -2
  70. package/dest/crypto/sha512/index.d.ts.map +1 -1
  71. package/dest/crypto/sha512/index.js +1 -1
  72. package/dest/crypto/signature/index.d.ts +2 -2
  73. package/dest/crypto/signature/index.d.ts.map +1 -1
  74. package/dest/crypto/sync/pedersen/index.d.ts +2 -2
  75. package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
  76. package/dest/crypto/sync/pedersen/index.js +1 -1
  77. package/dest/crypto/sync/poseidon/index.d.ts +2 -2
  78. package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
  79. package/dest/crypto/sync/poseidon/index.js +1 -1
  80. package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
  81. package/dest/curves/bls12/field.d.ts.map +1 -0
  82. package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
  83. package/dest/curves/bls12/index.d.ts +3 -0
  84. package/dest/curves/bls12/index.d.ts.map +1 -0
  85. package/dest/curves/bls12/index.js +2 -0
  86. package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +13 -4
  87. package/dest/curves/bls12/point.d.ts.map +1 -0
  88. package/dest/{fields/bls12_point.js → curves/bls12/point.js} +10 -8
  89. package/dest/{fields/fields.d.ts → curves/bn254/field.d.ts} +7 -15
  90. package/dest/curves/bn254/field.d.ts.map +1 -0
  91. package/dest/{fields/fields.js → curves/bn254/field.js} +35 -49
  92. package/dest/curves/bn254/index.d.ts +3 -0
  93. package/dest/curves/bn254/index.d.ts.map +1 -0
  94. package/dest/curves/bn254/index.js +2 -0
  95. package/dest/curves/bn254/point.d.ts +54 -0
  96. package/dest/curves/bn254/point.d.ts.map +1 -0
  97. package/dest/curves/bn254/point.js +143 -0
  98. package/dest/curves/grumpkin/index.d.ts +10 -0
  99. package/dest/curves/grumpkin/index.d.ts.map +1 -0
  100. package/dest/curves/grumpkin/index.js +3 -0
  101. package/dest/{fields → curves/grumpkin}/point.d.ts +13 -4
  102. package/dest/curves/grumpkin/point.d.ts.map +1 -0
  103. package/dest/{fields → curves/grumpkin}/point.js +7 -7
  104. package/dest/error/index.d.ts +4 -4
  105. package/dest/error/index.d.ts.map +1 -1
  106. package/dest/eth-address/index.d.ts +3 -2
  107. package/dest/eth-address/index.d.ts.map +1 -1
  108. package/dest/eth-address/index.js +10 -3
  109. package/dest/eth-signature/eth_signature.d.ts +4 -1
  110. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  111. package/dest/iterator/filter.d.ts +3 -0
  112. package/dest/iterator/filter.d.ts.map +1 -0
  113. package/dest/iterator/filter.js +7 -0
  114. package/dest/iterator/index.d.ts +2 -0
  115. package/dest/iterator/index.d.ts.map +1 -0
  116. package/dest/iterator/index.js +1 -0
  117. package/dest/json-rpc/fixtures/class_a.d.ts +3 -3
  118. package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
  119. package/dest/json-rpc/fixtures/class_b.d.ts +3 -3
  120. package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
  121. package/dest/log/pino-logger.d.ts +1 -1
  122. package/dest/log/pino-logger.d.ts.map +1 -1
  123. package/dest/log/pino-logger.js +1 -1
  124. package/dest/retry/index.d.ts +11 -1
  125. package/dest/retry/index.d.ts.map +1 -1
  126. package/dest/retry/index.js +11 -0
  127. package/dest/schemas/schemas.d.ts +7 -3
  128. package/dest/schemas/schemas.d.ts.map +1 -1
  129. package/dest/schemas/schemas.js +9 -3
  130. package/dest/schemas/types.d.ts +31 -1
  131. package/dest/schemas/types.d.ts.map +1 -1
  132. package/dest/schemas/types.js +25 -1
  133. package/dest/serialize/buffer_reader.d.ts +7 -4
  134. package/dest/serialize/buffer_reader.d.ts.map +1 -1
  135. package/dest/serialize/buffer_reader.js +13 -4
  136. package/dest/serialize/field_reader.d.ts +2 -2
  137. package/dest/serialize/field_reader.d.ts.map +1 -1
  138. package/dest/serialize/field_reader.js +1 -1
  139. package/dest/serialize/free_funcs.d.ts +2 -2
  140. package/dest/serialize/free_funcs.d.ts.map +1 -1
  141. package/dest/serialize/free_funcs.js +1 -1
  142. package/dest/serialize/serialize.d.ts +2 -2
  143. package/dest/serialize/serialize.d.ts.map +1 -1
  144. package/dest/serialize/serialize.js +1 -1
  145. package/dest/sleep/index.d.ts +3 -1
  146. package/dest/sleep/index.d.ts.map +1 -1
  147. package/dest/sleep/index.js +4 -0
  148. package/dest/timer/date.d.ts +2 -1
  149. package/dest/timer/date.d.ts.map +1 -1
  150. package/dest/timer/date.js +3 -0
  151. package/dest/trees/{balanced_merkle_tree.d.ts → balanced_merkle_tree_root.d.ts} +1 -5
  152. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -0
  153. package/dest/trees/{balanced_merkle_tree.js → balanced_merkle_tree_root.js} +1 -13
  154. package/dest/trees/hasher.d.ts +4 -1
  155. package/dest/trees/hasher.d.ts.map +1 -1
  156. package/dest/trees/hasher.js +15 -5
  157. package/dest/trees/index.d.ts +4 -4
  158. package/dest/trees/index.d.ts.map +1 -1
  159. package/dest/trees/index.js +3 -3
  160. package/dest/trees/indexed_merkle_tree.js +1 -1
  161. package/dest/trees/membership_witness.d.ts +8 -2
  162. package/dest/trees/membership_witness.d.ts.map +1 -1
  163. package/dest/trees/membership_witness.js +1 -1
  164. package/dest/trees/merkle_tree_calculator.js +1 -1
  165. package/dest/trees/sibling_path.d.ts +3 -2
  166. package/dest/trees/sibling_path.d.ts.map +1 -1
  167. package/dest/trees/sibling_path.js +2 -2
  168. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +2 -3
  169. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
  170. package/dest/trees/unbalanced_merkle_tree_calculator.js +1 -5
  171. package/dest/trees/{unbalanced_merkle_tree.d.ts → unbalanced_merkle_tree_root.d.ts} +3 -5
  172. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -0
  173. package/dest/trees/{unbalanced_merkle_tree.js → unbalanced_merkle_tree_root.js} +11 -49
  174. package/dest/trees/unbalanced_tree_store.d.ts +5 -1
  175. package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
  176. package/dest/trees/unbalanced_tree_store.js +49 -1
  177. package/dest/types/index.d.ts +4 -2
  178. package/dest/types/index.d.ts.map +1 -1
  179. package/dest/types/index.js +3 -0
  180. package/package.json +25 -7
  181. package/src/array/index.ts +1 -0
  182. package/src/array/sorted_array.ts +133 -0
  183. package/src/branded-types/block_number.ts +5 -0
  184. package/src/branded-types/checkpoint_number.ts +22 -7
  185. package/src/branded-types/index.ts +2 -1
  186. package/src/branded-types/index_within_checkpoint.ts +88 -0
  187. package/src/buffer/buffer16.ts +2 -2
  188. package/src/buffer/buffer32.ts +2 -2
  189. package/src/config/env_var.ts +30 -11
  190. package/src/config/index.ts +39 -6
  191. package/src/config/network_config.ts +2 -0
  192. package/src/config/parse-env.ts +4 -0
  193. package/src/crypto/bls/bn254_keystore.ts +1 -1
  194. package/src/crypto/bls/index.ts +1 -1
  195. package/src/crypto/bn254/index.ts +50 -159
  196. package/src/crypto/ecdsa/signature.ts +2 -2
  197. package/src/crypto/grumpkin/index.ts +3 -1
  198. package/src/crypto/keys/index.ts +1 -1
  199. package/src/crypto/pedersen/pedersen.wasm.ts +1 -1
  200. package/src/crypto/poseidon/index.ts +1 -1
  201. package/src/crypto/random/randomness_singleton.ts +2 -4
  202. package/src/crypto/schnorr/index.ts +2 -1
  203. package/src/crypto/schnorr/signature.ts +2 -2
  204. package/src/crypto/sha256/index.ts +1 -1
  205. package/src/crypto/sha512/index.ts +1 -1
  206. package/src/crypto/signature/index.ts +1 -1
  207. package/src/crypto/sync/pedersen/index.ts +1 -1
  208. package/src/crypto/sync/poseidon/index.ts +1 -1
  209. package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
  210. package/src/curves/bls12/index.ts +2 -0
  211. package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +7 -7
  212. package/src/{fields/fields.ts → curves/bn254/field.ts} +33 -56
  213. package/src/curves/bn254/index.ts +2 -0
  214. package/src/curves/bn254/point.ts +170 -0
  215. package/src/curves/grumpkin/index.ts +11 -0
  216. package/src/{fields → curves/grumpkin}/point.ts +7 -7
  217. package/src/eth-address/index.ts +8 -2
  218. package/src/iterator/filter.ts +11 -0
  219. package/src/iterator/index.ts +1 -0
  220. package/src/log/pino-logger.ts +2 -1
  221. package/src/retry/index.ts +18 -0
  222. package/src/schemas/schemas.ts +14 -3
  223. package/src/schemas/types.ts +33 -0
  224. package/src/serialize/buffer_reader.ts +21 -9
  225. package/src/serialize/field_reader.ts +1 -1
  226. package/src/serialize/free_funcs.ts +1 -1
  227. package/src/serialize/serialize.ts +1 -1
  228. package/src/sleep/index.ts +6 -0
  229. package/src/timer/date.ts +4 -0
  230. package/src/trees/{balanced_merkle_tree.ts → balanced_merkle_tree_root.ts} +1 -12
  231. package/src/trees/hasher.ts +13 -0
  232. package/src/trees/index.ts +3 -3
  233. package/src/trees/indexed_merkle_tree.ts +1 -1
  234. package/src/trees/membership_witness.ts +1 -1
  235. package/src/trees/merkle_tree_calculator.ts +1 -1
  236. package/src/trees/sibling_path.ts +2 -2
  237. package/src/trees/unbalanced_merkle_tree_calculator.ts +1 -12
  238. package/src/trees/{unbalanced_merkle_tree.ts → unbalanced_merkle_tree_root.ts} +17 -61
  239. package/src/trees/unbalanced_tree_store.ts +57 -2
  240. package/src/types/index.ts +6 -1
  241. package/dest/crypto/bn254/bn254_utils.d.ts +0 -39
  242. package/dest/crypto/bn254/bn254_utils.d.ts.map +0 -1
  243. package/dest/crypto/bn254/bn254_utils.js +0 -56
  244. package/dest/crypto/index.d.ts +0 -17
  245. package/dest/crypto/index.d.ts.map +0 -1
  246. package/dest/crypto/index.js +0 -16
  247. package/dest/fields/bls12_fields.d.ts.map +0 -1
  248. package/dest/fields/bls12_point.d.ts.map +0 -1
  249. package/dest/fields/coordinate.d.ts +0 -63
  250. package/dest/fields/coordinate.d.ts.map +0 -1
  251. package/dest/fields/coordinate.js +0 -96
  252. package/dest/fields/fields.d.ts.map +0 -1
  253. package/dest/fields/index.d.ts +0 -6
  254. package/dest/fields/index.d.ts.map +0 -1
  255. package/dest/fields/index.js +0 -5
  256. package/dest/fields/point.d.ts.map +0 -1
  257. package/dest/index.d.ts +0 -31
  258. package/dest/index.d.ts.map +0 -1
  259. package/dest/index.js +0 -31
  260. package/dest/json-rpc/server/telemetry.d.ts +0 -2
  261. package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
  262. package/dest/json-rpc/server/telemetry.js +0 -0
  263. package/dest/trees/balanced_merkle_tree.d.ts.map +0 -1
  264. package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
  265. package/src/crypto/bn254/bn254_utils.ts +0 -64
  266. package/src/crypto/index.ts +0 -16
  267. package/src/fields/coordinate.ts +0 -104
  268. package/src/fields/index.ts +0 -5
  269. package/src/index.ts +0 -31
  270. package/src/json-rpc/server/telemetry.ts +0 -0
@@ -1,3 +1,6 @@
1
1
  /** Strips methods of a type. */ /** Removes readonly modifiers for an object. */ export function unfreeze(obj) {
2
2
  return obj;
3
3
  }
4
+ /** Is defined type guard */ export function isDefined(value) {
5
+ return value !== undefined;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/foundation",
3
- "version": "0.0.1-commit.d3ec352c",
3
+ "version": "0.0.1-commit.d431d1c",
4
4
  "type": "module",
5
5
  "main": "./dest/index.js",
6
6
  "types": "./dest/index.d.ts",
@@ -15,9 +15,27 @@
15
15
  "./branded-types": "./dest/branded-types/index.js",
16
16
  "./collection": "./dest/collection/index.js",
17
17
  "./config": "./dest/config/index.js",
18
- "./crypto": "./dest/crypto/index.js",
19
- "./crypto/sync": "./dest/crypto/sync/index.js",
18
+ "./crypto/aes128": "./dest/crypto/aes128/index.js",
19
+ "./crypto/bls": "./dest/crypto/bls/index.js",
20
20
  "./crypto/bls/bn254_keystore": "./dest/crypto/bls/bn254_keystore.js",
21
+ "./crypto/bn254": "./dest/crypto/bn254/index.js",
22
+ "./crypto/ecdsa": "./dest/crypto/ecdsa/index.js",
23
+ "./crypto/grumpkin": "./dest/crypto/grumpkin/index.js",
24
+ "./crypto/keccak": "./dest/crypto/keccak/index.js",
25
+ "./crypto/keys": "./dest/crypto/keys/index.js",
26
+ "./crypto/pedersen": "./dest/crypto/pedersen/index.js",
27
+ "./crypto/poseidon": "./dest/crypto/poseidon/index.js",
28
+ "./crypto/random": "./dest/crypto/random/index.js",
29
+ "./crypto/schnorr": "./dest/crypto/schnorr/index.js",
30
+ "./crypto/secp256k1": "./dest/crypto/secp256k1/index.js",
31
+ "./crypto/secp256k1-signer": "./dest/crypto/secp256k1-signer/index.js",
32
+ "./crypto/sha256": "./dest/crypto/sha256/index.js",
33
+ "./crypto/sha512": "./dest/crypto/sha512/index.js",
34
+ "./crypto/signature": "./dest/crypto/signature/index.js",
35
+ "./crypto/sync": "./dest/crypto/sync/index.js",
36
+ "./curves/bn254": "./dest/curves/bn254/index.js",
37
+ "./curves/grumpkin": "./dest/curves/grumpkin/index.js",
38
+ "./curves/bls12": "./dest/curves/bls12/index.js",
21
39
  "./decorators": "./dest/decorators/index.js",
22
40
  "./error": "./dest/error/index.js",
23
41
  "./eth-address": "./dest/eth-address/index.js",
@@ -31,9 +49,9 @@
31
49
  "./json-rpc/undici": "./dest/json-rpc/client/undici.js",
32
50
  "./json-rpc/test": "./dest/json-rpc/test/index.js",
33
51
  "./iterable": "./dest/iterable/index.js",
52
+ "./iterator": "./dest/iterator/index.js",
34
53
  "./log": "./dest/log/index.js",
35
54
  "./mutex": "./dest/mutex/index.js",
36
- "./fields": "./dest/fields/index.js",
37
55
  "./retry": "./dest/retry/index.js",
38
56
  "./running-promise": "./dest/running-promise/index.js",
39
57
  "./serialize": "./dest/serialize/index.js",
@@ -105,7 +123,7 @@
105
123
  "testEnvironment": "../../foundation/src/jest/env.mjs"
106
124
  },
107
125
  "dependencies": {
108
- "@aztec/bb.js": "0.0.1-commit.d3ec352c",
126
+ "@aztec/bb.js": "0.0.1-commit.d431d1c",
109
127
  "@koa/cors": "^5.0.0",
110
128
  "@noble/curves": "=1.7.0",
111
129
  "@noble/hashes": "^1.6.1",
@@ -144,11 +162,11 @@
144
162
  "@types/node": "^22.15.17",
145
163
  "@types/pako": "^2.0.0",
146
164
  "@types/supertest": "^2.0.12",
147
- "@typescript/native-preview": "7.0.0-dev.20251126.1",
165
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
148
166
  "comlink": "^4.4.1",
149
167
  "eslint": "^9.26.0",
150
168
  "eslint-config-prettier": "^10.1.5",
151
- "eslint-plugin-import": "^2.31.0",
169
+ "eslint-plugin-import-x": "^4.6.1",
152
170
  "eslint-plugin-jsdoc": "^50.6.14",
153
171
  "eslint-plugin-no-only-tests": "^3.3.0",
154
172
  "eslint-plugin-tsdoc": "^0.4.0",
@@ -1 +1,2 @@
1
1
  export * from './array.js';
2
+ export * from './sorted_array.js';
@@ -0,0 +1,133 @@
1
+ type Cmp<T> = (a: T, b: T) => -1 | 0 | 1;
2
+
3
+ export function dedupeSortedArray<T>(arr: T[], cmp: Cmp<T>): void {
4
+ for (let i = 0; i < arr.length; i++) {
5
+ let j = i + 1;
6
+ for (; j < arr.length; j++) {
7
+ const res = cmp(arr[i], arr[j]);
8
+ if (res === 0) {
9
+ continue;
10
+ } else if (res < 0) {
11
+ break;
12
+ } else {
13
+ throw new Error('Array not sorted');
14
+ }
15
+ }
16
+
17
+ if (j - i > 1) {
18
+ arr.splice(i + 1, j - i - 1);
19
+ }
20
+ }
21
+ }
22
+
23
+ export function insertIntoSortedArray<T>(arr: T[], item: T, cmp: Cmp<T>, allowDuplicates = true): boolean {
24
+ let start = 0;
25
+ let end = arr.length;
26
+
27
+ while (start < end) {
28
+ const mid = start + (((end - start) / 2) | 0);
29
+ const comparison = cmp(arr[mid], item);
30
+
31
+ if (comparison < 0) {
32
+ start = mid + 1;
33
+ } else {
34
+ end = mid;
35
+ }
36
+ }
37
+
38
+ if (!allowDuplicates) {
39
+ // Check element at insertion point
40
+ if (start < arr.length && cmp(arr[start], item) === 0) {
41
+ return false;
42
+ }
43
+
44
+ // Check element before insertion point (in case we landed after duplicates)
45
+ if (start > 0 && cmp(arr[start - 1], item) === 0) {
46
+ return false;
47
+ }
48
+ }
49
+
50
+ arr.splice(start, 0, item);
51
+ return true;
52
+ }
53
+
54
+ export function findIndexInSortedArray<T, N>(values: T[], needle: N, cmp: (a: T, b: N) => number): number {
55
+ let start = 0;
56
+ let end = values.length - 1;
57
+
58
+ while (start <= end) {
59
+ const mid = start + (((end - start) / 2) | 0);
60
+ const comparison = cmp(values[mid], needle);
61
+
62
+ if (comparison === 0) {
63
+ return mid;
64
+ }
65
+
66
+ if (comparison > 0) {
67
+ end = mid - 1;
68
+ } else {
69
+ start = mid + 1;
70
+ }
71
+ }
72
+
73
+ return -1;
74
+ }
75
+
76
+ export function findInSortedArray<T, N>(values: T[], needle: N, cmp: (a: T, b: N) => number): T | undefined {
77
+ const idx = findIndexInSortedArray(values, needle, cmp);
78
+ return idx > -1 ? values[idx] : undefined;
79
+ }
80
+
81
+ export function removeAnyOf<T, N>(arr: T[], vals: N[], cmp: (a: T, b: N) => -1 | 0 | 1): void {
82
+ let writeIdx = 0;
83
+ let readIdx = 0;
84
+ let valIdx = 0;
85
+
86
+ while (readIdx < arr.length && valIdx < vals.length) {
87
+ const comparison = cmp(arr[readIdx], vals[valIdx]);
88
+
89
+ if (comparison < 0) {
90
+ arr[writeIdx++] = arr[readIdx++];
91
+ } else if (comparison > 0) {
92
+ valIdx++;
93
+ } else {
94
+ readIdx++;
95
+ }
96
+ }
97
+
98
+ while (readIdx < arr.length) {
99
+ arr[writeIdx++] = arr[readIdx++];
100
+ }
101
+
102
+ arr.length = writeIdx;
103
+ }
104
+
105
+ export function removeFromSortedArray<T, N>(arr: T[], val: N, cmp: (a: T, b: N) => -1 | 0 | 1) {
106
+ const idx = findIndexInSortedArray(arr, val, cmp);
107
+ if (idx > -1) {
108
+ arr.splice(idx, 1);
109
+ }
110
+ }
111
+
112
+ export function merge<T>(arr: T[], toInsert: T[], cmp: (a: T, b: T) => -1 | 0 | 1): void {
113
+ const result = new Array<T>(arr.length + toInsert.length);
114
+ let i = 0,
115
+ j = 0,
116
+ k = 0;
117
+
118
+ while (i < arr.length && j < toInsert.length) {
119
+ result[k++] = cmp(arr[i], toInsert[j]) <= 0 ? arr[i++] : toInsert[j++];
120
+ }
121
+
122
+ while (i < arr.length) {
123
+ result[k++] = arr[i++];
124
+ }
125
+ while (j < toInsert.length) {
126
+ result[k++] = toInsert[j++];
127
+ }
128
+
129
+ for (i = 0; i < result.length; i++) {
130
+ arr[i] = result[i];
131
+ }
132
+ arr.length = result.length;
133
+ }
@@ -87,6 +87,11 @@ BlockNumber.isValid = function (value: unknown): value is BlockNumber {
87
87
  return typeof value === 'number' && Number.isInteger(value) && value >= 0;
88
88
  };
89
89
 
90
+ /** Increments a BlockNumber by a given value. */
91
+ BlockNumber.add = function (bn: BlockNumber, increment: number): BlockNumber {
92
+ return BlockNumber(bn + increment);
93
+ };
94
+
90
95
  /**
91
96
  * The zero block value (genesis block).
92
97
  */
@@ -85,16 +85,31 @@ CheckpointNumber.isValid = function (value: unknown): value is CheckpointNumber
85
85
  return typeof value === 'number' && Number.isInteger(value) && value >= 0;
86
86
  };
87
87
 
88
- /**
89
- * The zero checkpoint value.
90
- */
88
+ /** The zero checkpoint value. */
91
89
  CheckpointNumber.ZERO = CheckpointNumber(0);
92
90
 
91
+ /** Initial checkpoint. */
92
+ CheckpointNumber.INITIAL = CheckpointNumber(1);
93
+
93
94
  /**
94
95
  * Zod schema for parsing and validating CheckpointNumber values.
95
96
  * Accepts numbers, bigints, or strings and coerces them to CheckpointNumber.
96
97
  */
97
- export const CheckpointNumberSchema = z
98
- .union([z.number(), z.bigint(), z.string()])
99
- .pipe(z.coerce.number().int().min(0))
100
- .transform(value => CheckpointNumber(value));
98
+ function makeCheckpointNumberSchema(minValue: number) {
99
+ return z
100
+ .union([z.number(), z.bigint(), z.string()])
101
+ .pipe(z.coerce.number().int().min(minValue))
102
+ .transform(value => CheckpointNumber(value));
103
+ }
104
+
105
+ /**
106
+ * Zod schema for parsing and validating Checkpoint values.
107
+ * Accepts numbers, bigints, or strings and coerces them to CheckpointNumber.
108
+ */
109
+ export const CheckpointNumberSchema = makeCheckpointNumberSchema(0);
110
+
111
+ /**
112
+ * Zod schema for parsing and validating CheckpointNumber values that are strictly positive.
113
+ * Accepts numbers, bigints, or strings and coerces them to CheckpointNumber.
114
+ */
115
+ export const CheckpointNumberPositiveSchema = makeCheckpointNumberSchema(1);
@@ -1,6 +1,7 @@
1
1
  export { BlockNumber, BlockNumberSchema, BlockNumberPositiveSchema } from './block_number.js';
2
- export { CheckpointNumber, CheckpointNumberSchema } from './checkpoint_number.js';
2
+ export { CheckpointNumber, CheckpointNumberSchema, CheckpointNumberPositiveSchema } from './checkpoint_number.js';
3
3
  export { EpochNumber, EpochNumberSchema } from './epoch.js';
4
+ export { IndexWithinCheckpoint, IndexWithinCheckpointSchema } from './index_within_checkpoint.js';
4
5
  export { SlotNumber, SlotNumberSchema } from './slot.js';
5
6
 
6
7
  export type { Branded } from './types.js';
@@ -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));
@@ -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';
@@ -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'
@@ -131,8 +133,7 @@ export type EnvVar =
131
133
  | 'P2P_TRUSTED_PEERS'
132
134
  | 'P2P_PRIVATE_PEERS'
133
135
  | 'P2P_PREFERRED_PEERS'
134
- | 'P2P_MAX_TX_POOL_SIZE'
135
- | 'P2P_TX_POOL_OVERFLOW_FACTOR'
136
+ | 'P2P_MAX_PENDING_TX_COUNT'
136
137
  | 'P2P_SEEN_MSG_CACHE_SIZE'
137
138
  | 'P2P_DROP_TX'
138
139
  | 'P2P_DROP_TX_CHANCE'
@@ -166,6 +167,7 @@ export type EnvVar =
166
167
  | 'PROVER_PUBLISHER_PRIVATE_KEYS'
167
168
  | 'PROVER_PUBLISHER_ADDRESSES'
168
169
  | 'PROVER_PUBLISHER_ALLOW_INVALID_STATES'
170
+ | 'PROVER_PUBLISHER_FORWARDER_ADDRESS'
169
171
  | 'PROVER_REAL_PROOFS'
170
172
  | 'PROVER_TEST_DELAY_FACTOR'
171
173
  | 'PROVER_TEST_DELAY_MS'
@@ -190,10 +192,13 @@ export type EnvVar =
190
192
  | 'SEQ_PUBLISHER_PRIVATE_KEYS'
191
193
  | 'SEQ_PUBLISHER_ADDRESSES'
192
194
  | 'SEQ_PUBLISHER_ALLOW_INVALID_STATES'
193
- | 'SEQ_TX_POLLING_INTERVAL_MS'
195
+ | 'SEQ_PUBLISHER_FORWARDER_ADDRESS'
196
+ | 'SEQ_POLLING_INTERVAL_MS'
194
197
  | 'SEQ_ENFORCE_TIME_TABLE'
195
- | 'SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT'
198
+ | 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT'
196
199
  | 'SEQ_ATTESTATION_PROPAGATION_TIME'
200
+ | 'SEQ_BLOCK_DURATION_MS'
201
+ | 'SEQ_BUILD_CHECKPOINT_IF_EMPTY'
197
202
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER'
198
203
  | 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER'
199
204
  | 'SLASH_MIN_PENALTY_PERCENTAGE'
@@ -252,6 +257,7 @@ export type EnvVar =
252
257
  | 'AZTEC_TARGET_COMMITTEE_SIZE'
253
258
  | 'AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET'
254
259
  | 'AZTEC_LAG_IN_EPOCHS_FOR_RANDAO'
260
+ | 'AZTEC_INBOX_LAG'
255
261
  | 'AZTEC_PROOF_SUBMISSION_EPOCHS'
256
262
  | 'AZTEC_ACTIVATION_THRESHOLD'
257
263
  | 'AZTEC_EJECTION_THRESHOLD'
@@ -271,6 +277,7 @@ export type EnvVar =
271
277
  | 'AZTEC_SLASHER_FLAVOR'
272
278
  | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM'
273
279
  | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE'
280
+ | 'AZTEC_GOVERNANCE_VOTING_DURATION'
274
281
  | 'AZTEC_EXIT_DELAY_SECONDS'
275
282
  | 'L1_GAS_LIMIT_BUFFER_PERCENTAGE'
276
283
  | 'L1_GAS_PRICE_MAX'
@@ -279,6 +286,7 @@ export type EnvVar =
279
286
  | 'L1_BLOB_FEE_PER_GAS_GWEI_MAX'
280
287
  | 'L1_PRIORITY_FEE_BUMP_PERCENTAGE'
281
288
  | 'L1_PRIORITY_FEE_RETRY_BUMP_PERCENTAGE'
289
+ | 'L1_MINIMUM_PRIORITY_FEE_PER_GAS_GWEI'
282
290
  | 'L1_FIXED_PRIORITY_FEE_PER_GAS'
283
291
  | 'L1_FIXED_PRIORITY_FEE_PER_GAS_GWEI'
284
292
  | 'L1_TX_MONITOR_MAX_ATTEMPTS'
@@ -296,7 +304,6 @@ export type EnvVar =
296
304
  | 'K8S_POD_UID'
297
305
  | 'K8S_NAMESPACE_NAME'
298
306
  | 'VALIDATOR_REEXECUTE_DEADLINE_MS'
299
- | 'ALWAYS_REEXECUTE_BLOCK_PROPOSALS'
300
307
  | 'AUTO_UPDATE'
301
308
  | 'AUTO_UPDATE_URL'
302
309
  | 'WEB3_SIGNER_URL'
@@ -304,4 +311,16 @@ export type EnvVar =
304
311
  | 'BLOB_ALLOW_EMPTY_SOURCES'
305
312
  | 'FISHERMAN_MODE'
306
313
  | 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS'
307
- | 'LEGACY_BLS_CLI';
314
+ | 'LEGACY_BLS_CLI'
315
+ | 'DEBUG_FORCE_TX_PROOF_VERIFICATION'
316
+ | 'VALIDATOR_HA_SIGNING_ENABLED'
317
+ | 'VALIDATOR_HA_NODE_ID'
318
+ | 'VALIDATOR_HA_POLLING_INTERVAL_MS'
319
+ | 'VALIDATOR_HA_SIGNING_TIMEOUT_MS'
320
+ | 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS'
321
+ | 'VALIDATOR_HA_DATABASE_URL'
322
+ | 'VALIDATOR_HA_RUN_MIGRATIONS'
323
+ | 'VALIDATOR_HA_POOL_MAX'
324
+ | 'VALIDATOR_HA_POOL_MIN'
325
+ | 'VALIDATOR_HA_POOL_IDLE_TIMEOUT_MS'
326
+ | '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';