@aztec-labs/stdlib 6.0.0-rc.3 → 6.0.0-rc.4

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 (334) hide show
  1. package/dest/abi/abi.d.ts +2 -1
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +1 -0
  4. package/dest/abi/authorization_selector.d.ts +2 -1
  5. package/dest/abi/authorization_selector.d.ts.map +1 -1
  6. package/dest/abi/authorization_selector.js +1 -0
  7. package/dest/abi/buffer.d.ts +2 -1
  8. package/dest/abi/buffer.d.ts.map +1 -1
  9. package/dest/abi/buffer.js +1 -0
  10. package/dest/abi/contract_artifact.d.ts +2 -1
  11. package/dest/abi/contract_artifact.d.ts.map +1 -1
  12. package/dest/abi/contract_artifact.js +1 -0
  13. package/dest/abi/encoder.d.ts +1 -1
  14. package/dest/abi/encoder.d.ts.map +1 -1
  15. package/dest/abi/encoder.js +1 -0
  16. package/dest/abi/event_selector.d.ts +2 -1
  17. package/dest/abi/event_selector.d.ts.map +1 -1
  18. package/dest/abi/event_selector.js +1 -0
  19. package/dest/abi/function_selector.d.ts +2 -1
  20. package/dest/abi/function_selector.d.ts.map +1 -1
  21. package/dest/abi/function_selector.js +1 -0
  22. package/dest/abi/note_selector.d.ts +2 -1
  23. package/dest/abi/note_selector.d.ts.map +1 -1
  24. package/dest/abi/note_selector.js +1 -0
  25. package/dest/abi/selector.d.ts +2 -2
  26. package/dest/abi/selector.d.ts.map +1 -1
  27. package/dest/abi/selector.js +1 -1
  28. package/dest/abi/utils.d.ts +2 -1
  29. package/dest/abi/utils.d.ts.map +1 -1
  30. package/dest/abi/utils.js +1 -0
  31. package/dest/avm/avm.d.ts +212 -211
  32. package/dest/avm/avm.d.ts.map +1 -1
  33. package/dest/avm/avm.js +1 -0
  34. package/dest/avm/avm_accumulated_data.d.ts +2 -2
  35. package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
  36. package/dest/avm/avm_accumulated_data.js +1 -1
  37. package/dest/avm/avm_circuit_public_inputs.d.ts +2 -2
  38. package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
  39. package/dest/avm/avm_circuit_public_inputs.js +1 -1
  40. package/dest/avm/message_pack.js +1 -1
  41. package/dest/avm/revert_code.d.ts +3 -2
  42. package/dest/avm/revert_code.d.ts.map +1 -1
  43. package/dest/avm/revert_code.js +2 -1
  44. package/dest/aztec-address/index.d.ts +3 -2
  45. package/dest/aztec-address/index.d.ts.map +1 -1
  46. package/dest/aztec-address/index.js +2 -1
  47. package/dest/block/block_hash.d.ts +2 -2
  48. package/dest/block/block_hash.d.ts.map +1 -1
  49. package/dest/block/block_hash.js +1 -1
  50. package/dest/block/body.d.ts +2 -2
  51. package/dest/block/body.d.ts.map +1 -1
  52. package/dest/block/body.js +1 -1
  53. package/dest/block/l2_block_source.d.ts +19 -3
  54. package/dest/block/l2_block_source.d.ts.map +1 -1
  55. package/dest/block/proposal/attestations_and_signers.d.ts +2 -1
  56. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  57. package/dest/block/proposal/attestations_and_signers.js +1 -0
  58. package/dest/block/proposal/committee_attestation.d.ts +2 -1
  59. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  60. package/dest/block/proposal/committee_attestation.js +1 -0
  61. package/dest/checkpoint/checkpoint_data.d.ts +11 -3
  62. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  63. package/dest/checkpoint/checkpoint_data.js +3 -2
  64. package/dest/config/network-consensus-config.d.ts +1 -1
  65. package/dest/config/network-consensus-config.d.ts.map +1 -1
  66. package/dest/config/network-consensus-config.js +3 -2
  67. package/dest/contract/artifact_hash.d.ts +2 -1
  68. package/dest/contract/artifact_hash.d.ts.map +1 -1
  69. package/dest/contract/artifact_hash.js +1 -0
  70. package/dest/contract/complete_address.d.ts +2 -1
  71. package/dest/contract/complete_address.d.ts.map +1 -1
  72. package/dest/contract/complete_address.js +1 -0
  73. package/dest/contract/contract_class.d.ts +1 -1
  74. package/dest/contract/contract_class.d.ts.map +1 -1
  75. package/dest/contract/contract_class.js +1 -0
  76. package/dest/contract/contract_class_id.js +1 -1
  77. package/dest/contract/interfaces/contract_class.d.ts +2 -1
  78. package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
  79. package/dest/contract/interfaces/contract_class.js +1 -0
  80. package/dest/database-version/database_version.d.ts +2 -1
  81. package/dest/database-version/database_version.d.ts.map +1 -1
  82. package/dest/database-version/database_version.js +1 -0
  83. package/dest/fees/transaction_fee.js +1 -1
  84. package/dest/file-store/http.d.ts +2 -1
  85. package/dest/file-store/http.d.ts.map +1 -1
  86. package/dest/file-store/http.js +1 -0
  87. package/dest/file-store/memory.d.ts +2 -1
  88. package/dest/file-store/memory.d.ts.map +1 -1
  89. package/dest/file-store/memory.js +1 -0
  90. package/dest/file-store/s3.d.ts +2 -1
  91. package/dest/file-store/s3.d.ts.map +1 -1
  92. package/dest/file-store/s3.js +3 -1
  93. package/dest/gas/gas.d.ts +2 -2
  94. package/dest/gas/gas.d.ts.map +1 -1
  95. package/dest/gas/gas.js +1 -1
  96. package/dest/gas/gas_fees.d.ts +2 -2
  97. package/dest/gas/gas_fees.d.ts.map +1 -1
  98. package/dest/gas/gas_fees.js +1 -1
  99. package/dest/ha-signing/config.d.ts +4 -2
  100. package/dest/ha-signing/config.d.ts.map +1 -1
  101. package/dest/ha-signing/config.js +5 -3
  102. package/dest/ha-signing/index.d.ts +2 -2
  103. package/dest/ha-signing/index.d.ts.map +1 -1
  104. package/dest/ha-signing/index.js +1 -1
  105. package/dest/interfaces/aztec-node-admin.d.ts +9 -1
  106. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  107. package/dest/interfaces/aztec-node-admin.js +3 -1
  108. package/dest/interfaces/configs.d.ts +7 -1
  109. package/dest/interfaces/configs.d.ts.map +1 -1
  110. package/dest/interfaces/configs.js +1 -0
  111. package/dest/kernel/claimed_length_array.d.ts +2 -2
  112. package/dest/kernel/claimed_length_array.d.ts.map +1 -1
  113. package/dest/kernel/claimed_length_array.js +1 -1
  114. package/dest/kernel/hints/transient_data_squashing_hint.d.ts +2 -2
  115. package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -1
  116. package/dest/kernel/hints/transient_data_squashing_hint.js +1 -1
  117. package/dest/kernel/log_hash.d.ts +2 -2
  118. package/dest/kernel/log_hash.d.ts.map +1 -1
  119. package/dest/kernel/log_hash.js +1 -1
  120. package/dest/kernel/private_log_data.d.ts +2 -2
  121. package/dest/kernel/private_log_data.d.ts.map +1 -1
  122. package/dest/kernel/private_log_data.js +1 -1
  123. package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
  124. package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
  125. package/dest/kernel/private_to_avm_accumulated_data.js +1 -1
  126. package/dest/kernel/private_to_public_accumulated_data.d.ts +2 -2
  127. package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
  128. package/dest/kernel/private_to_public_accumulated_data.js +1 -1
  129. package/dest/kernel/private_to_rollup_accumulated_data.d.ts +2 -2
  130. package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
  131. package/dest/kernel/private_to_rollup_accumulated_data.js +1 -1
  132. package/dest/kernel/private_validation_requests.d.ts +2 -2
  133. package/dest/kernel/private_validation_requests.d.ts.map +1 -1
  134. package/dest/kernel/private_validation_requests.js +1 -1
  135. package/dest/kernel/public_call_request.d.ts +2 -2
  136. package/dest/kernel/public_call_request.d.ts.map +1 -1
  137. package/dest/kernel/public_call_request.js +1 -1
  138. package/dest/keys/public_keys.d.ts +2 -1
  139. package/dest/keys/public_keys.d.ts.map +1 -1
  140. package/dest/keys/public_keys.js +1 -0
  141. package/dest/logs/contract_class_log.d.ts +2 -2
  142. package/dest/logs/contract_class_log.d.ts.map +1 -1
  143. package/dest/logs/contract_class_log.js +1 -1
  144. package/dest/logs/log_cursor.d.ts +2 -1
  145. package/dest/logs/log_cursor.d.ts.map +1 -1
  146. package/dest/logs/log_cursor.js +1 -0
  147. package/dest/logs/private_log.d.ts +2 -2
  148. package/dest/logs/private_log.d.ts.map +1 -1
  149. package/dest/logs/private_log.js +1 -1
  150. package/dest/logs/public_log.d.ts +2 -2
  151. package/dest/logs/public_log.d.ts.map +1 -1
  152. package/dest/logs/public_log.js +1 -1
  153. package/dest/messaging/l1_to_l2_message.d.ts +2 -1
  154. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  155. package/dest/messaging/l1_to_l2_message.js +1 -0
  156. package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
  157. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  158. package/dest/messaging/l2_to_l1_membership.js +1 -0
  159. package/dest/messaging/out_hash.d.ts +1 -1
  160. package/dest/messaging/out_hash.d.ts.map +1 -1
  161. package/dest/messaging/out_hash.js +1 -0
  162. package/dest/note/note_dao.d.ts +2 -1
  163. package/dest/note/note_dao.d.ts.map +1 -1
  164. package/dest/note/note_dao.js +1 -0
  165. package/dest/proofs/chonk_proof.d.ts +2 -1
  166. package/dest/proofs/chonk_proof.d.ts.map +1 -1
  167. package/dest/proofs/chonk_proof.js +1 -0
  168. package/dest/proofs/proof.d.ts +2 -1
  169. package/dest/proofs/proof.d.ts.map +1 -1
  170. package/dest/proofs/proof.js +2 -1
  171. package/dest/rollup/block_headers_hash.d.ts +1 -1
  172. package/dest/rollup/block_headers_hash.d.ts.map +1 -1
  173. package/dest/rollup/block_headers_hash.js +1 -0
  174. package/dest/rollup/checkpoint_constant_data.d.ts +2 -2
  175. package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
  176. package/dest/rollup/checkpoint_constant_data.js +1 -1
  177. package/dest/rollup/checkpoint_header.d.ts +2 -2
  178. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  179. package/dest/rollup/checkpoint_header.js +1 -1
  180. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +2 -1
  181. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
  182. package/dest/rollup/checkpoint_root_rollup_private_inputs.js +1 -0
  183. package/dest/slashing/votes.d.ts +2 -1
  184. package/dest/slashing/votes.d.ts.map +1 -1
  185. package/dest/slashing/votes.js +1 -0
  186. package/dest/snapshots/download.d.ts +2 -2
  187. package/dest/snapshots/download.d.ts.map +1 -1
  188. package/dest/snapshots/download.js +8 -2
  189. package/dest/snapshots/index.d.ts +2 -2
  190. package/dest/snapshots/index.d.ts.map +1 -1
  191. package/dest/snapshots/index.js +1 -1
  192. package/dest/snapshots/upload.d.ts +1 -1
  193. package/dest/snapshots/upload.d.ts.map +1 -1
  194. package/dest/snapshots/upload.js +1 -0
  195. package/dest/tests/factories.d.ts +2 -1
  196. package/dest/tests/factories.d.ts.map +1 -1
  197. package/dest/tests/factories.js +1 -0
  198. package/dest/tests/mocks.d.ts +1 -1
  199. package/dest/tests/mocks.d.ts.map +1 -1
  200. package/dest/tests/mocks.js +1 -0
  201. package/dest/trees/append_only_tree_snapshot.d.ts +2 -2
  202. package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
  203. package/dest/trees/append_only_tree_snapshot.js +1 -1
  204. package/dest/trees/nullifier_leaf.d.ts +2 -1
  205. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  206. package/dest/trees/nullifier_leaf.js +1 -0
  207. package/dest/trees/public_data_leaf.d.ts +2 -1
  208. package/dest/trees/public_data_leaf.d.ts.map +1 -1
  209. package/dest/trees/public_data_leaf.js +1 -0
  210. package/dest/tx/block_header.d.ts +2 -2
  211. package/dest/tx/block_header.d.ts.map +1 -1
  212. package/dest/tx/block_header.js +1 -1
  213. package/dest/tx/call_context.d.ts +2 -2
  214. package/dest/tx/call_context.d.ts.map +1 -1
  215. package/dest/tx/call_context.js +1 -1
  216. package/dest/tx/global_variables.d.ts +2 -2
  217. package/dest/tx/global_variables.d.ts.map +1 -1
  218. package/dest/tx/global_variables.js +1 -1
  219. package/dest/tx/profiling.d.ts +1 -1
  220. package/dest/tx/profiling.d.ts.map +1 -1
  221. package/dest/tx/profiling.js +1 -0
  222. package/dest/tx/public_call_request_with_calldata.d.ts +2 -2
  223. package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
  224. package/dest/tx/public_call_request_with_calldata.js +1 -1
  225. package/dest/tx/state_reference.d.ts +2 -2
  226. package/dest/tx/state_reference.d.ts.map +1 -1
  227. package/dest/tx/state_reference.js +1 -1
  228. package/dest/tx/tree_snapshots.d.ts +2 -2
  229. package/dest/tx/tree_snapshots.d.ts.map +1 -1
  230. package/dest/tx/tree_snapshots.js +1 -1
  231. package/dest/tx/tx.d.ts +7 -1
  232. package/dest/tx/tx.d.ts.map +1 -1
  233. package/dest/tx/tx.js +8 -1
  234. package/dest/tx/tx_effect.d.ts +2 -2
  235. package/dest/tx/tx_effect.d.ts.map +1 -1
  236. package/dest/tx/tx_effect.js +1 -1
  237. package/dest/tx/tx_execution_request.d.ts +2 -2
  238. package/dest/tx/tx_execution_request.d.ts.map +1 -1
  239. package/dest/tx/tx_execution_request.js +1 -1
  240. package/dest/tx/validator/error_texts.d.ts +2 -1
  241. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  242. package/dest/tx/validator/error_texts.js +13 -0
  243. package/dest/vks/verification_key.d.ts +2 -1
  244. package/dest/vks/verification_key.d.ts.map +1 -1
  245. package/dest/vks/verification_key.js +1 -0
  246. package/dest/zkpassport/index.d.ts +2 -1
  247. package/dest/zkpassport/index.d.ts.map +1 -1
  248. package/dest/zkpassport/index.js +1 -0
  249. package/package.json +10 -9
  250. package/src/abi/abi.ts +1 -0
  251. package/src/abi/authorization_selector.ts +1 -0
  252. package/src/abi/buffer.ts +1 -0
  253. package/src/abi/contract_artifact.ts +1 -0
  254. package/src/abi/encoder.ts +1 -0
  255. package/src/abi/event_selector.ts +1 -0
  256. package/src/abi/function_selector.ts +1 -0
  257. package/src/abi/note_selector.ts +1 -0
  258. package/src/abi/selector.ts +1 -1
  259. package/src/abi/utils.ts +2 -0
  260. package/src/avm/avm.ts +1 -0
  261. package/src/avm/avm_accumulated_data.ts +1 -1
  262. package/src/avm/avm_circuit_public_inputs.ts +1 -1
  263. package/src/avm/message_pack.ts +1 -1
  264. package/src/avm/revert_code.ts +2 -1
  265. package/src/aztec-address/index.ts +2 -1
  266. package/src/block/block_hash.ts +1 -1
  267. package/src/block/body.ts +1 -1
  268. package/src/block/l2_block_source.ts +19 -2
  269. package/src/block/proposal/attestations_and_signers.ts +1 -0
  270. package/src/block/proposal/committee_attestation.ts +1 -0
  271. package/src/checkpoint/checkpoint_data.ts +9 -1
  272. package/src/config/network-consensus-config.ts +3 -2
  273. package/src/contract/artifact_hash.ts +1 -0
  274. package/src/contract/complete_address.ts +1 -0
  275. package/src/contract/contract_class.ts +1 -0
  276. package/src/contract/contract_class_id.ts +1 -1
  277. package/src/contract/interfaces/contract_class.ts +1 -0
  278. package/src/database-version/database_version.ts +1 -0
  279. package/src/fees/transaction_fee.ts +1 -1
  280. package/src/file-store/http.ts +1 -0
  281. package/src/file-store/memory.ts +1 -0
  282. package/src/file-store/s3.ts +3 -1
  283. package/src/gas/gas.ts +1 -1
  284. package/src/gas/gas_fees.ts +1 -1
  285. package/src/ha-signing/config.ts +8 -4
  286. package/src/ha-signing/index.ts +1 -0
  287. package/src/interfaces/aztec-node-admin.ts +8 -0
  288. package/src/interfaces/configs.ts +6 -0
  289. package/src/kernel/claimed_length_array.ts +1 -1
  290. package/src/kernel/hints/transient_data_squashing_hint.ts +1 -1
  291. package/src/kernel/log_hash.ts +1 -1
  292. package/src/kernel/private_log_data.ts +1 -1
  293. package/src/kernel/private_to_avm_accumulated_data.ts +1 -1
  294. package/src/kernel/private_to_public_accumulated_data.ts +1 -1
  295. package/src/kernel/private_to_rollup_accumulated_data.ts +1 -1
  296. package/src/kernel/private_validation_requests.ts +1 -1
  297. package/src/kernel/public_call_request.ts +1 -1
  298. package/src/keys/public_keys.ts +1 -0
  299. package/src/logs/contract_class_log.ts +1 -1
  300. package/src/logs/log_cursor.ts +1 -0
  301. package/src/logs/private_log.ts +1 -1
  302. package/src/logs/public_log.ts +1 -1
  303. package/src/messaging/l1_to_l2_message.ts +1 -0
  304. package/src/messaging/l2_to_l1_membership.ts +1 -0
  305. package/src/messaging/out_hash.ts +1 -0
  306. package/src/note/note_dao.ts +1 -0
  307. package/src/proofs/chonk_proof.ts +1 -0
  308. package/src/proofs/proof.ts +2 -1
  309. package/src/rollup/block_headers_hash.ts +1 -0
  310. package/src/rollup/checkpoint_constant_data.ts +1 -1
  311. package/src/rollup/checkpoint_header.ts +1 -1
  312. package/src/rollup/checkpoint_root_rollup_private_inputs.ts +1 -0
  313. package/src/slashing/votes.ts +1 -0
  314. package/src/snapshots/download.ts +28 -19
  315. package/src/snapshots/index.ts +7 -1
  316. package/src/snapshots/upload.ts +1 -0
  317. package/src/tests/factories.ts +1 -0
  318. package/src/tests/mocks.ts +1 -0
  319. package/src/trees/append_only_tree_snapshot.ts +1 -1
  320. package/src/trees/nullifier_leaf.ts +1 -0
  321. package/src/trees/public_data_leaf.ts +1 -0
  322. package/src/tx/block_header.ts +1 -1
  323. package/src/tx/call_context.ts +1 -1
  324. package/src/tx/global_variables.ts +1 -1
  325. package/src/tx/profiling.ts +1 -0
  326. package/src/tx/public_call_request_with_calldata.ts +1 -1
  327. package/src/tx/state_reference.ts +1 -1
  328. package/src/tx/tree_snapshots.ts +1 -1
  329. package/src/tx/tx.ts +10 -0
  330. package/src/tx/tx_effect.ts +1 -1
  331. package/src/tx/tx_execution_request.ts +1 -1
  332. package/src/tx/validator/error_texts.ts +18 -0
  333. package/src/vks/verification_key.ts +1 -0
  334. package/src/zkpassport/index.ts +1 -0
@@ -5,7 +5,9 @@ import {
5
5
  PutObjectCommand,
6
6
  S3Client,
7
7
  } from '@aws-sdk/client-s3';
8
+ import { getEnv } from '@aztec-labs/foundation/config/env';
8
9
  import { type Logger, createLogger } from '@aztec-labs/foundation/log';
10
+ import { Buffer } from 'buffer';
9
11
  import { createReadStream, createWriteStream } from 'fs';
10
12
  import { mkdir, mkdtemp, stat, unlink } from 'fs/promises';
11
13
  import { tmpdir } from 'os';
@@ -37,7 +39,7 @@ export class S3FileStore implements FileStore {
37
39
  private readonly log: Logger = createLogger('stdlib:s3-file-store'),
38
40
  ) {
39
41
  this.endpoint = opts.endpoint;
40
- this.region = this.endpoint ? 'auto' : (process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? 'us-east-1');
42
+ this.region = this.endpoint ? 'auto' : (getEnv().AWS_REGION ?? getEnv().AWS_DEFAULT_REGION ?? 'us-east-1');
41
43
  this.publicBaseUrl = opts.publicBaseUrl;
42
44
 
43
45
  const clientOptions: any = {};
package/src/gas/gas.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+ import { inspect } from '@aztec-labs/foundation/inspect';
2
3
  import { schemas } from '@aztec-labs/foundation/schemas';
3
4
  import {
4
5
  BufferReader,
@@ -8,7 +9,6 @@ import {
8
9
  serializeToSink,
9
10
  } from '@aztec-labs/foundation/serialize';
10
11
  import type { FieldsOf } from '@aztec-labs/foundation/types';
11
- import { inspect } from 'util';
12
12
  import { z } from 'zod';
13
13
 
14
14
  import type { UInt32 } from '../types/shared.js';
@@ -1,8 +1,8 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+ import { inspect } from '@aztec-labs/foundation/inspect';
2
3
  import { schemas } from '@aztec-labs/foundation/schemas';
3
4
  import { BufferReader, BufferSink, FieldReader, serializeToFields } from '@aztec-labs/foundation/serialize';
4
5
  import type { FieldsOf } from '@aztec-labs/foundation/types';
5
- import { inspect } from 'util';
6
6
  import { z } from 'zod';
7
7
 
8
8
  import type { UInt128 } from '../types/shared.js';
@@ -16,6 +16,9 @@ import {
16
16
  import type { ZodFor } from '@aztec-labs/foundation/schemas';
17
17
  import { z } from 'zod';
18
18
 
19
+ /** Default retention for signed duties, in hours. */
20
+ export const DEFAULT_SIGNED_DUTIES_RETENTION_HOURS = 24;
21
+
19
22
  /**
20
23
  * Base signing protection configuration shared by both HA (Postgres) and local (LMDB) signers.
21
24
  */
@@ -40,7 +43,7 @@ export type BaseSignerConfig = {
40
43
  signerCallTimeoutMs?: number;
41
44
  /** Maximum age of a stuck duty in ms (defaults to 2x hardcoded Aztec slot duration if not set) */
42
45
  maxStuckDutiesAgeMs?: number;
43
- /** Optional: clean up old duties after this many hours (disabled if not set) */
46
+ /** Duty retention in hours from signing start, with a minimum of two slots (defaults to 24). */
44
47
  cleanupOldDutiesAfterHours?: number;
45
48
  } & Pick<L1ContractAddresses, 'rollupAddress'>;
46
49
 
@@ -72,8 +75,9 @@ export const baseSignerConfigMappings: ConfigMappingsType<BaseSignerConfig> = {
72
75
  },
73
76
  cleanupOldDutiesAfterHours: {
74
77
  env: 'VALIDATOR_HA_OLD_DUTIES_MAX_AGE_H',
75
- description: 'Optional: clean up old duties after this many hours (disabled if not set)',
76
- ...optionalNumberConfigHelper(),
78
+ description: 'Duty retention in hours from signing start (must be positive; minimum two slots)',
79
+ defaultValue: DEFAULT_SIGNED_DUTIES_RETENTION_HOURS,
80
+ parseEnv: (value: string) => z.coerce.number().int().positive().parse(value),
77
81
  },
78
82
  ...pickL1ContractAddressMappings('rollupAddress'),
79
83
  };
@@ -84,7 +88,7 @@ export const BaseSignerConfigSchema = z.object({
84
88
  peerSigningTimeoutMs: z.number().min(0),
85
89
  signerCallTimeoutMs: z.number().min(0).optional(),
86
90
  maxStuckDutiesAgeMs: z.number().min(0).optional(),
87
- cleanupOldDutiesAfterHours: z.number().min(0).optional(),
91
+ cleanupOldDutiesAfterHours: z.number().positive().optional(),
88
92
  ...pickL1ContractAddressesSchema('rollupAddress'),
89
93
  }) satisfies ZodFor<BaseSignerConfig>;
90
94
 
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  type BaseSignerConfig,
3
3
  BaseSignerConfigSchema,
4
+ DEFAULT_SIGNED_DUTIES_RETENTION_HOURS,
4
5
  baseSignerConfigMappings,
5
6
  type ValidatorHASignerConfig,
6
7
  ValidatorHASignerConfigSchema,
@@ -1,5 +1,6 @@
1
1
  import type { L1ContractAddresses } from '@aztec-labs/ethereum/l1-contract-addresses';
2
2
  import { createSafeJsonRpcClient, defaultFetch } from '@aztec-labs/foundation/json-rpc/client';
3
+ import { isValidLogLevelSpec } from '@aztec-labs/foundation/log';
3
4
  import { z } from 'zod';
4
5
 
5
6
  import type { ApiSchemaFor } from '../schemas/schemas.js';
@@ -94,6 +95,12 @@ export type AztecNodeAdminConfig = Omit<ValidatorClientFullConfig, keyof L1Contr
94
95
  skipIncomingProposals?: boolean;
95
96
  // Keep in sync with P2PConfig.preferredPeers (circular dep prevents Pick<P2PConfig, ...> here)
96
97
  preferredPeers?: string[];
98
+ /**
99
+ * Log level spec in `LOG_LEVEL` env var format (e.g. `info` or `debug;trace:sequencer,p2p`). Setting it updates
100
+ * all loggers in the node's main thread immediately; worker threads and spawned processes keep their own
101
+ * configuration. Not persisted: a restart reverts to the `LOG_LEVEL` env var.
102
+ */
103
+ logLevel?: string;
97
104
  };
98
105
 
99
106
  export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
@@ -111,6 +118,7 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
111
118
  maxPendingTxCount: z.number(),
112
119
  skipIncomingProposals: z.boolean().optional(),
113
120
  preferredPeers: z.array(z.string()).optional(),
121
+ logLevel: z.string().refine(isValidLogLevelSpec, 'Invalid log level spec').optional(),
114
122
  }),
115
123
  );
116
124
 
@@ -102,6 +102,11 @@ export interface SequencerConfig {
102
102
  injectUnrecoverableSignatureAttestation?: boolean;
103
103
  /** Inject a non-proposer attestation slot in yParity (v ∈ {0, 1}) form in the packed L1 tuple (for testing only) */
104
104
  injectYParityAttestation?: boolean;
105
+ /**
106
+ * Publish the checkpoint with a fake attestation first, then invalidate it and publish it again with the collected
107
+ * attestations within the same slot (for testing only)
108
+ */
109
+ republishAfterFakeAttestation?: boolean;
105
110
  /** Whether to run in fisherman mode: builds blocks on every slot for validation without publishing */
106
111
  fishermanMode?: boolean;
107
112
  /** Shuffle attestation ordering to create invalid ordering (for testing only) */
@@ -185,6 +190,7 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
185
190
  injectHighSValueAttestation: z.boolean().optional(),
186
191
  injectUnrecoverableSignatureAttestation: z.boolean().optional(),
187
192
  injectYParityAttestation: z.boolean().optional(),
193
+ republishAfterFakeAttestation: z.boolean().optional(),
188
194
  fishermanMode: z.boolean().optional(),
189
195
  shuffleAttestationOrdering: z.boolean().optional(),
190
196
  blockDurationMs: z.number().positive().optional(),
@@ -1,4 +1,5 @@
1
1
  import type { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+ import { inspect } from '@aztec-labs/foundation/inspect';
2
3
  import {
3
4
  BufferReader,
4
5
  FieldReader,
@@ -7,7 +8,6 @@ import {
7
8
  serializeToBuffer,
8
9
  serializeToFields,
9
10
  } from '@aztec-labs/foundation/serialize';
10
- import { inspect } from 'util';
11
11
 
12
12
  export class ClaimedLengthArray<T extends Serializable, N extends number> {
13
13
  constructor(
@@ -1,6 +1,6 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+ import { inspect } from '@aztec-labs/foundation/inspect';
2
3
  import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
3
- import { inspect } from 'util';
4
4
 
5
5
  export class TransientDataSquashingHint {
6
6
  constructor(
@@ -1,7 +1,7 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+ import { inspect } from '@aztec-labs/foundation/inspect';
2
3
  import { BufferReader, BufferSink, FieldReader, serializeToSink } from '@aztec-labs/foundation/serialize';
3
4
  import type { FieldsOf } from '@aztec-labs/foundation/types';
4
- import { inspect } from 'util';
5
5
 
6
6
  import { AztecAddress } from '../aztec-address/index.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { PRIVATE_LOG_DATA_LENGTH } from '@aztec-labs/constants';
2
2
  import type { Fr } from '@aztec-labs/foundation/curves/bn254';
3
+ import { inspect } from '@aztec-labs/foundation/inspect';
3
4
  import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec-labs/foundation/serialize';
4
5
  import type { FieldsOf } from '@aztec-labs/foundation/types';
5
- import { inspect } from 'util';
6
6
 
7
7
  import { AztecAddress } from '../aztec-address/index.js';
8
8
  import { PrivateLog } from '../logs/private_log.js';
@@ -7,6 +7,7 @@ import {
7
7
  import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
8
8
  import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
9
9
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
10
+ import { inspect } from '@aztec-labs/foundation/inspect';
10
11
  import { schemas } from '@aztec-labs/foundation/schemas';
11
12
  import {
12
13
  BufferReader,
@@ -17,7 +18,6 @@ import {
17
18
  serializeToFields,
18
19
  serializeToSink,
19
20
  } from '@aztec-labs/foundation/serialize';
20
- import { inspect } from 'util';
21
21
  import { z } from 'zod';
22
22
 
23
23
  import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
@@ -10,6 +10,7 @@ import {
10
10
  import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
11
11
  import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
12
12
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
13
+ import { inspect } from '@aztec-labs/foundation/inspect';
13
14
  import {
14
15
  BufferReader,
15
16
  BufferSink,
@@ -18,7 +19,6 @@ import {
18
19
  serializeToFields,
19
20
  serializeToSink,
20
21
  } from '@aztec-labs/foundation/serialize';
21
- import { inspect } from 'util';
22
22
 
23
23
  import { PrivateLog } from '../logs/private_log.js';
24
24
  import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
@@ -9,6 +9,7 @@ import {
9
9
  import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
10
10
  import { arraySerializedSizeOfNonEmpty } from '@aztec-labs/foundation/collection';
11
11
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
12
+ import { inspect } from '@aztec-labs/foundation/inspect';
12
13
  import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
13
14
  import {
14
15
  BufferReader,
@@ -18,7 +19,6 @@ import {
18
19
  serializeToSink,
19
20
  } from '@aztec-labs/foundation/serialize';
20
21
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
21
- import { inspect } from 'util';
22
22
 
23
23
  import { PrivateLog } from '../logs/private_log.js';
24
24
  import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
@@ -3,9 +3,9 @@ import {
3
3
  MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
4
4
  MAX_NULLIFIER_READ_REQUESTS_PER_TX,
5
5
  } from '@aztec-labs/constants';
6
+ import { inspect } from '@aztec-labs/foundation/inspect';
6
7
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
7
8
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
8
- import { inspect } from 'util';
9
9
 
10
10
  import { ScopedKeyValidationRequestAndSeparator } from '../kernel/hints/scoped_key_validation_request_and_separator.js';
11
11
  import { ClaimedLengthArray, ClaimedLengthArrayFromBuffer } from './claimed_length_array.js';
@@ -1,5 +1,6 @@
1
1
  import { COUNTED_PUBLIC_CALL_REQUEST_LENGTH, PUBLIC_CALL_REQUEST_LENGTH } from '@aztec-labs/constants';
2
2
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
+ import { inspect } from '@aztec-labs/foundation/inspect';
3
4
  import { schemas } from '@aztec-labs/foundation/schemas';
4
5
  import {
5
6
  BufferReader,
@@ -9,7 +10,6 @@ import {
9
10
  serializeToSink,
10
11
  } from '@aztec-labs/foundation/serialize';
11
12
  import type { FieldsOf } from '@aztec-labs/foundation/types';
12
- import { inspect } from 'util';
13
13
  import { z } from 'zod';
14
14
 
15
15
  import { AztecAddress } from '../aztec-address/index.js';
@@ -14,6 +14,7 @@ import { schemas } from '@aztec-labs/foundation/schemas';
14
14
  import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
15
15
  import { bufferToHex, withoutHexPrefix } from '@aztec-labs/foundation/string';
16
16
  import type { FieldsOf } from '@aztec-labs/foundation/types';
17
+ import { Buffer } from 'buffer';
17
18
  import { z } from 'zod';
18
19
 
19
20
  import { PublicKey, hashPublicKey } from './public_key.js';
@@ -1,6 +1,7 @@
1
1
  import { CONTRACT_CLASS_LOG_LENGTH, CONTRACT_CLASS_LOG_SIZE_IN_FIELDS } from '@aztec-labs/constants';
2
2
  import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
+ import { inspect } from '@aztec-labs/foundation/inspect';
4
5
  import { schemas } from '@aztec-labs/foundation/schemas';
5
6
  import {
6
7
  BufferReader,
@@ -10,7 +11,6 @@ import {
10
11
  serializeToSink,
11
12
  } from '@aztec-labs/foundation/serialize';
12
13
  import type { FieldsOf } from '@aztec-labs/foundation/types';
13
- import { inspect } from 'util';
14
14
  import { z } from 'zod';
15
15
 
16
16
  import { AztecAddress } from '../aztec-address/index.js';
@@ -1,5 +1,6 @@
1
1
  import { BlockNumber, BlockNumberSchema } from '@aztec-labs/foundation/branded-types';
2
2
  import { BufferReader, numToUInt32BE } from '@aztec-labs/foundation/serialize';
3
+ import { Buffer } from 'buffer';
3
4
  import { z } from 'zod';
4
5
 
5
6
  import { schemas } from '../schemas/schemas.js';
@@ -2,6 +2,7 @@ import { PRIVATE_LOG_LENGTH, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec-labs/cons
2
2
  import { type FieldsOf, makeTuple } from '@aztec-labs/foundation/array';
3
3
  import { padArrayEnd } from '@aztec-labs/foundation/collection';
4
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
5
+ import { inspect } from '@aztec-labs/foundation/inspect';
5
6
  import { schemas } from '@aztec-labs/foundation/schemas';
6
7
  import {
7
8
  BufferReader,
@@ -11,7 +12,6 @@ import {
11
12
  serializeToFields,
12
13
  serializeToSink,
13
14
  } from '@aztec-labs/foundation/serialize';
14
- import { inspect } from 'util';
15
15
  import { z } from 'zod';
16
16
 
17
17
  export class PrivateLog {
@@ -1,9 +1,9 @@
1
1
  import { FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH, PUBLIC_LOG_HEADER_LENGTH } from '@aztec-labs/constants';
2
2
  import type { FieldsOf } from '@aztec-labs/foundation/array';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
+ import { inspect } from '@aztec-labs/foundation/inspect';
4
5
  import { type ZodFor, schemas } from '@aztec-labs/foundation/schemas';
5
6
  import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
6
- import { inspect } from 'util';
7
7
  import { z } from 'zod';
8
8
 
9
9
  import { AztecAddress } from '../aztec-address/index.js';
@@ -5,6 +5,7 @@ import { Fr } from '@aztec-labs/foundation/curves/bn254';
5
5
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
6
6
  import { bufferToHex } from '@aztec-labs/foundation/string';
7
7
  import { SiblingPath } from '@aztec-labs/foundation/trees';
8
+ import { Buffer } from 'buffer';
8
9
 
9
10
  import type { AztecAddress } from '../aztec-address/index.js';
10
11
  import type { BlockParameter } from '../block/block_parameter.js';
@@ -2,6 +2,7 @@ import { MAX_CHECKPOINTS_PER_EPOCH, OUT_HASH_TREE_LEAF_COUNT } from '@aztec-labs
2
2
  import { type EpochNumber, EpochNumberSchema } from '@aztec-labs/foundation/branded-types';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec-labs/foundation/trees';
5
+ import { Buffer } from 'buffer';
5
6
  import { z } from 'zod';
6
7
 
7
8
  import type { AztecNode } from '../interfaces/aztec-node.js';
@@ -2,6 +2,7 @@ import { OUT_HASH_TREE_LEAF_COUNT } from '@aztec-labs/constants';
2
2
  import { padArrayEnd } from '@aztec-labs/foundation/collection';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { computeBalancedShaRoot, computeUnbalancedShaRoot, computeWonkyShaRoot } from '@aztec-labs/foundation/trees';
5
+ import { Buffer } from 'buffer';
5
6
 
6
7
  /**
7
8
  * Computes the out hash of a tx. It's the root of the unbalanced tree of all the L2-to-L1 messages emitted by the tx.
@@ -4,6 +4,7 @@ import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serializ
4
4
  import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
5
5
  import { Note } from '@aztec-labs/stdlib/note';
6
6
  import { TxHash } from '@aztec-labs/stdlib/tx';
7
+ import { Buffer } from 'buffer';
7
8
 
8
9
  /**
9
10
  * A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
@@ -6,6 +6,7 @@ import { randomBytes } from '@aztec-labs/foundation/crypto/random';
6
6
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
7
7
  import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
8
8
  import { BufferReader, BufferSink } from '@aztec-labs/foundation/serialize';
9
+ import { Buffer } from 'buffer';
9
10
 
10
11
  /**
11
12
  * Serialization format detection for ChonkProof is value-based on the leading uint32:
@@ -2,7 +2,8 @@ import { PAIRING_POINTS_SIZE } from '@aztec-labs/constants';
2
2
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
3
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
4
4
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
5
- import { strict as assert } from 'assert';
5
+ import { assert } from '@aztec-labs/foundation/validation';
6
+ import { Buffer } from 'buffer';
6
7
 
7
8
  const EMPTY_PROOF_SIZE = 42;
8
9
 
@@ -2,6 +2,7 @@ import { DomainSeparator } from '@aztec-labs/constants';
2
2
  import { poseidon2HashWithSeparator } from '@aztec-labs/foundation/crypto/poseidon';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { computeUnbalancedMerkleTreeRootAsync } from '@aztec-labs/foundation/trees';
5
+ import { Buffer } from 'buffer';
5
6
 
6
7
  import type { BlockHeader } from '../tx/block_header.js';
7
8
 
@@ -1,9 +1,9 @@
1
1
  import { SlotNumber } from '@aztec-labs/foundation/branded-types';
2
2
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
3
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
4
+ import { inspect } from '@aztec-labs/foundation/inspect';
4
5
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
5
6
  import type { FieldsOf } from '@aztec-labs/foundation/types';
6
- import { inspect } from 'util';
7
7
 
8
8
  import { AztecAddress } from '../aztec-address/index.js';
9
9
  import { GasFees } from '../gas/gas_fees.js';
@@ -3,11 +3,11 @@ import { SlotNumber } from '@aztec-labs/foundation/branded-types';
3
3
  import { sha256ToField } from '@aztec-labs/foundation/crypto/sha256';
4
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
5
5
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
6
+ import { inspect } from '@aztec-labs/foundation/inspect';
6
7
  import type { ZodFor } from '@aztec-labs/foundation/schemas';
7
8
  import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec-labs/foundation/serialize';
8
9
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
9
10
  import type { FieldsOf } from '@aztec-labs/foundation/types';
10
- import { inspect } from 'util';
11
11
  import { z } from 'zod';
12
12
 
13
13
  import { AztecAddress } from '../aztec-address/index.js';
@@ -6,6 +6,7 @@ import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
6
6
  import { BufferReader, type Tuple, serializeToBuffer } from '@aztec-labs/foundation/serialize';
7
7
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
8
8
  import type { FieldsOf } from '@aztec-labs/foundation/types';
9
+ import { Buffer } from 'buffer';
9
10
 
10
11
  import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
11
12
  import { ProofData, type RollupHonkProofData, type UltraHonkProofData } from '../proofs/proof_data.js';
@@ -3,6 +3,7 @@ import { padArrayEnd } from '@aztec-labs/foundation/collection';
3
3
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
4
4
  import { type Logger, createLogger } from '@aztec-labs/foundation/log';
5
5
  import type { PartialBy } from '@aztec-labs/foundation/types';
6
+ import { Buffer } from 'buffer';
6
7
 
7
8
  import { getEpochForOffense } from './helpers.js';
8
9
  import type { Offense, ValidatorSlashVote } from './types.js';
@@ -1,6 +1,7 @@
1
1
  import { fromEntries, getEntries, maxBy } from '@aztec-labs/foundation/collection';
2
2
  import { jsonParseWithSchema } from '@aztec-labs/foundation/json-rpc';
3
3
  import type { ReadOnlyFileStore } from '@aztec-labs/stdlib/file-store';
4
+ import { Buffer } from 'buffer';
4
5
  import { createReadStream, createWriteStream } from 'fs';
5
6
  import fs from 'fs/promises';
6
7
  import pathMod from 'path';
@@ -94,29 +95,37 @@ export async function downloadSnapshot(
94
95
  snapshot: Pick<SnapshotMetadata, 'dataUrls'>,
95
96
  localPaths: Record<SnapshotDataKeys, string>,
96
97
  store: ReadOnlyFileStore,
98
+ keys: readonly SnapshotDataKeys[] = SnapshotDataKeys,
97
99
  ): Promise<void> {
98
- await Promise.all(
99
- getEntries(localPaths).map(async ([key, path]) => {
100
- await fs.mkdir(pathMod.dirname(path), { recursive: true });
100
+ const results = await Promise.allSettled(
101
+ getEntries(localPaths)
102
+ .filter(([key]) => keys.includes(key))
103
+ .map(async ([key, path]) => {
104
+ await fs.mkdir(pathMod.dirname(path), { recursive: true });
101
105
 
102
- const tmpPath = `${path}.download`;
103
- try {
104
- const url = snapshot.dataUrls[key];
105
- await store.download(url, tmpPath);
106
+ const tmpPath = `${path}.download`;
107
+ try {
108
+ const url = snapshot.dataUrls[key];
109
+ await store.download(url, tmpPath);
106
110
 
107
- const isGzip = await detectGzip(tmpPath);
111
+ const isGzip = await detectGzip(tmpPath);
108
112
 
109
- const read = createReadStream(tmpPath);
110
- const write = createWriteStream(path);
111
- if (isGzip) {
112
- const gunzip = createGunzip();
113
- await pipeline(read, gunzip, write);
114
- } else {
115
- await pipeline(read, write);
113
+ const read = createReadStream(tmpPath);
114
+ const write = createWriteStream(path);
115
+ if (isGzip) {
116
+ const gunzip = createGunzip();
117
+ await pipeline(read, gunzip, write);
118
+ } else {
119
+ await pipeline(read, write);
120
+ }
121
+ } finally {
122
+ await fs.unlink(tmpPath).catch(() => undefined);
116
123
  }
117
- } finally {
118
- await fs.unlink(tmpPath).catch(() => undefined);
119
- }
120
- }),
124
+ }),
121
125
  );
126
+ for (const result of results) {
127
+ if (result.status === 'rejected') {
128
+ throw result.reason;
129
+ }
130
+ }
122
131
  }
@@ -1,3 +1,9 @@
1
1
  export * from './types.js';
2
2
  export * from './upload.js';
3
- export { getBasePath, downloadSnapshot, getLatestSnapshotMetadata, makeSnapshotPaths } from './download.js';
3
+ export {
4
+ getBasePath,
5
+ downloadSnapshot,
6
+ getSnapshotIndex,
7
+ getLatestSnapshotMetadata,
8
+ makeSnapshotPaths,
9
+ } from './download.js';
@@ -2,6 +2,7 @@ import { fromEntries, getEntries, pick } from '@aztec-labs/foundation/collection
2
2
  import { jsonStringify } from '@aztec-labs/foundation/json-rpc';
3
3
  import { isoDate } from '@aztec-labs/foundation/string';
4
4
  import type { FileStore } from '@aztec-labs/stdlib/file-store';
5
+ import { Buffer } from 'buffer';
5
6
 
6
7
  import { getBasePath, getSnapshotIndex, getSnapshotIndexPath } from './download.js';
7
8
  import type { SnapshotDataKeys, SnapshotMetadata, SnapshotsIndex, UploadSnapshotMetadata } from './types.js';
@@ -52,6 +52,7 @@ import { GrumpkinScalar, Point } from '@aztec-labs/foundation/curves/grumpkin';
52
52
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
53
53
  import type { Bufferable, Serializable, Tuple } from '@aztec-labs/foundation/serialize';
54
54
  import { MembershipWitness } from '@aztec-labs/foundation/trees';
55
+ import { Buffer } from 'buffer';
55
56
 
56
57
  import { FunctionSelector } from '../abi/function_selector.js';
57
58
  import {
@@ -18,6 +18,7 @@ import { Secp256k1Signer } from '@aztec-labs/foundation/crypto/secp256k1-signer'
18
18
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
19
19
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
20
20
  import { Signature } from '@aztec-labs/foundation/eth-signature';
21
+ import { Buffer } from 'buffer';
21
22
  import { type TypedDataDefinition, hashTypedData } from 'viem';
22
23
 
23
24
  import type { ContractArtifact } from '../abi/abi.js';
@@ -1,9 +1,9 @@
1
1
  import { TreeLeafIndex, TreeLeafIndexSchema } from '@aztec-labs/foundation/branded-types';
2
2
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
+ import { inspect } from '@aztec-labs/foundation/inspect';
3
4
  import { schemas } from '@aztec-labs/foundation/schemas';
4
5
  import { BufferReader, BufferSink, FieldReader } from '@aztec-labs/foundation/serialize';
5
6
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
6
- import { inspect } from 'util';
7
7
  import { z } from 'zod';
8
8
 
9
9
  /**
@@ -3,6 +3,7 @@ import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
3
  import { schemas } from '@aztec-labs/foundation/schemas';
4
4
  import { BufferReader } from '@aztec-labs/foundation/serialize';
5
5
  import type { IndexedTreeLeaf, IndexedTreeLeafPreimage } from '@aztec-labs/foundation/trees';
6
+ import { Buffer } from 'buffer';
6
7
  import { z } from 'zod';
7
8
 
8
9
  /**
@@ -4,6 +4,7 @@ import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { schemas } from '@aztec-labs/foundation/schemas';
5
5
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
6
6
  import type { IndexedTreeLeaf, IndexedTreeLeafPreimage } from '@aztec-labs/foundation/trees';
7
+ import { Buffer } from 'buffer';
7
8
  import { z } from 'zod';
8
9
 
9
10
  /**
@@ -3,6 +3,7 @@ import { BlockNumber, SlotNumber } from '@aztec-labs/foundation/branded-types';
3
3
  import { poseidon2HashWithSeparator } from '@aztec-labs/foundation/crypto/poseidon';
4
4
  import { randomInt } from '@aztec-labs/foundation/crypto/random';
5
5
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
6
+ import { inspect } from '@aztec-labs/foundation/inspect';
6
7
  import { type ZodFor, schemas } from '@aztec-labs/foundation/schemas';
7
8
  import {
8
9
  BufferReader,
@@ -13,7 +14,6 @@ import {
13
14
  } from '@aztec-labs/foundation/serialize';
14
15
  import { bufferToHex, hexToBuffer } from '@aztec-labs/foundation/string';
15
16
  import type { FieldsOf } from '@aztec-labs/foundation/types';
16
- import { inspect } from 'util';
17
17
  import { z } from 'zod';
18
18
 
19
19
  import { BlockHash } from '../block/block_hash.js';
@@ -1,8 +1,8 @@
1
1
  import { CALL_CONTEXT_LENGTH } from '@aztec-labs/constants';
2
2
  import type { Fr } from '@aztec-labs/foundation/curves/bn254';
3
+ import { inspect } from '@aztec-labs/foundation/inspect';
3
4
  import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec-labs/foundation/serialize';
4
5
  import type { FieldsOf } from '@aztec-labs/foundation/types';
5
- import { inspect } from 'util';
6
6
  import { z } from 'zod';
7
7
 
8
8
  import { FunctionSelector } from '../abi/index.js';
@@ -3,6 +3,7 @@ import { BlockNumber, BlockNumberSchema, SlotNumber } from '@aztec-labs/foundati
3
3
  import { randomInt } from '@aztec-labs/foundation/crypto/random';
4
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
5
5
  import { EthAddress } from '@aztec-labs/foundation/eth-address';
6
+ import { inspect } from '@aztec-labs/foundation/inspect';
6
7
  import { jsonStringify } from '@aztec-labs/foundation/json-rpc';
7
8
  import {
8
9
  BufferReader,
@@ -12,7 +13,6 @@ import {
12
13
  serializeToSink,
13
14
  } from '@aztec-labs/foundation/serialize';
14
15
  import type { FieldsOf } from '@aztec-labs/foundation/types';
15
- import { inspect } from 'util';
16
16
  import { z } from 'zod';
17
17
 
18
18
  import { AztecAddress } from '../aztec-address/index.js';
@@ -2,6 +2,7 @@ import { CircuitKind } from '@aztec-foundation/bb.js';
2
2
 
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { type ZodFor, optional, schemas } from '@aztec-labs/foundation/schemas';
5
+ import { Buffer } from 'buffer';
5
6
  import { z } from 'zod';
6
7
 
7
8
  import { AztecAddress } from '../aztec-address/index.js';