@aztec/stdlib 1.2.0 → 2.0.0-nightly.20250813

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 (324) hide show
  1. package/dest/abi/abi.d.ts +0 -67
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +1 -14
  4. package/dest/abi/authorization_selector.d.ts +52 -0
  5. package/dest/abi/authorization_selector.d.ts.map +1 -0
  6. package/dest/abi/authorization_selector.js +70 -0
  7. package/dest/abi/contract_artifact.d.ts.map +1 -1
  8. package/dest/abi/contract_artifact.js +0 -40
  9. package/dest/abi/decoder.d.ts.map +1 -1
  10. package/dest/abi/decoder.js +3 -6
  11. package/dest/abi/index.d.ts +1 -0
  12. package/dest/abi/index.d.ts.map +1 -1
  13. package/dest/abi/index.js +1 -0
  14. package/dest/avm/avm.d.ts +278 -412
  15. package/dest/avm/avm.d.ts.map +1 -1
  16. package/dest/avm/avm.js +12 -12
  17. package/dest/avm/avm_proving_request.d.ts +160 -186
  18. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  19. package/dest/block/l2_block.d.ts +8 -0
  20. package/dest/block/l2_block.d.ts.map +1 -1
  21. package/dest/block/l2_block.js +9 -0
  22. package/dest/block/l2_block_source.d.ts +446 -2
  23. package/dest/block/l2_block_source.d.ts.map +1 -1
  24. package/dest/block/l2_block_source.js +29 -0
  25. package/dest/block/proposal/committee_attestation.d.ts +3 -1
  26. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  27. package/dest/block/proposal/committee_attestation.js +3 -0
  28. package/dest/block/published_l2_block.d.ts +2 -1
  29. package/dest/block/published_l2_block.d.ts.map +1 -1
  30. package/dest/block/published_l2_block.js +6 -1
  31. package/dest/contract/contract_instance.d.ts +3 -3
  32. package/dest/contract/contract_instance.d.ts.map +1 -1
  33. package/dest/contract/contract_instance.js +3 -3
  34. package/dest/contract/interfaces/contract_class.d.ts +2 -2
  35. package/dest/contract/interfaces/protocol_contract_addresses.d.ts +9 -9
  36. package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
  37. package/dest/contract/interfaces/protocol_contract_addresses.js +4 -4
  38. package/dest/contract/private_function_membership_proof.d.ts +1 -1
  39. package/dest/contract/private_function_membership_proof.js +1 -1
  40. package/dest/contract/utility_function_membership_proof.d.ts +1 -1
  41. package/dest/contract/utility_function_membership_proof.js +1 -1
  42. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +20 -0
  43. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -0
  44. package/dest/{shared_mutable/shared_mutable_values.js → delayed_public_mutable/delayed_public_mutable_values.js} +9 -9
  45. package/dest/{shared_mutable/shared_mutable_values_with_hash.d.ts → delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts} +6 -6
  46. package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -0
  47. package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.js +30 -0
  48. package/dest/delayed_public_mutable/index.d.ts +5 -0
  49. package/dest/delayed_public_mutable/index.d.ts.map +1 -0
  50. package/dest/delayed_public_mutable/index.js +4 -0
  51. package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -0
  52. package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -0
  53. package/dest/gas/gas.d.ts +1 -0
  54. package/dest/gas/gas.d.ts.map +1 -1
  55. package/dest/gas/gas.js +3 -0
  56. package/dest/hash/hash.d.ts.map +1 -1
  57. package/dest/hash/hash.js +1 -4
  58. package/dest/interfaces/archiver.d.ts.map +1 -1
  59. package/dest/interfaces/archiver.js +4 -2
  60. package/dest/interfaces/aztec-node-admin.d.ts +211 -8
  61. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  62. package/dest/interfaces/aztec-node-admin.js +9 -3
  63. package/dest/interfaces/configs.d.ts +27 -0
  64. package/dest/interfaces/configs.d.ts.map +1 -1
  65. package/dest/interfaces/configs.js +6 -1
  66. package/dest/interfaces/get_logs_response.d.ts +1 -1
  67. package/dest/interfaces/proving-job.d.ts +166 -192
  68. package/dest/interfaces/proving-job.d.ts.map +1 -1
  69. package/dest/interfaces/pxe.d.ts +3 -1
  70. package/dest/interfaces/pxe.d.ts.map +1 -1
  71. package/dest/interfaces/pxe.js +1 -1
  72. package/dest/interfaces/server.d.ts +4 -2
  73. package/dest/interfaces/server.d.ts.map +1 -1
  74. package/dest/interfaces/server.js +4 -2
  75. package/dest/interfaces/slasher.d.ts +86 -0
  76. package/dest/interfaces/slasher.d.ts.map +1 -0
  77. package/dest/interfaces/slasher.js +23 -0
  78. package/dest/interfaces/tx_provider.d.ts +24 -0
  79. package/dest/interfaces/tx_provider.d.ts.map +1 -0
  80. package/dest/kernel/claimed_length_array.d.ts +34 -0
  81. package/dest/kernel/claimed_length_array.d.ts.map +1 -0
  82. package/dest/kernel/claimed_length_array.js +58 -0
  83. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -6
  84. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
  85. package/dest/kernel/hints/build_note_hash_read_request_hints.js +18 -20
  86. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +7 -10
  87. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
  88. package/dest/kernel/hints/build_nullifier_read_request_hints.js +17 -32
  89. package/dest/kernel/hints/build_transient_data_hints.d.ts +4 -3
  90. package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
  91. package/dest/kernel/hints/build_transient_data_hints.js +9 -10
  92. package/dest/kernel/hints/index.d.ts +1 -2
  93. package/dest/kernel/hints/index.d.ts.map +1 -1
  94. package/dest/kernel/hints/index.js +1 -2
  95. package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
  96. package/dest/kernel/hints/note_hash_read_request_hints.js +4 -4
  97. package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
  98. package/dest/kernel/hints/nullifier_read_request_hints.js +4 -4
  99. package/dest/kernel/hints/private_kernel_reset_hints.d.ts +5 -5
  100. package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
  101. package/dest/kernel/hints/private_kernel_reset_hints.js +9 -9
  102. package/dest/kernel/hints/read_request_hints.d.ts +17 -17
  103. package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
  104. package/dest/kernel/hints/read_request_hints.js +28 -28
  105. package/dest/kernel/hints/{transient_data_index_hint.d.ts → transient_data_squashing_hint.d.ts} +5 -5
  106. package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -0
  107. package/dest/kernel/hints/{transient_data_index_hint.js → transient_data_squashing_hint.js} +5 -5
  108. package/dest/kernel/index.d.ts +1 -0
  109. package/dest/kernel/index.d.ts.map +1 -1
  110. package/dest/kernel/index.js +1 -0
  111. package/dest/kernel/private_accumulated_data.d.ts +16 -15
  112. package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
  113. package/dest/kernel/private_accumulated_data.js +3 -3
  114. package/dest/kernel/private_call_data.d.ts +4 -4
  115. package/dest/kernel/private_call_data.d.ts.map +1 -1
  116. package/dest/kernel/private_call_data.js +2 -2
  117. package/dest/kernel/private_circuit_public_inputs.d.ts +26 -25
  118. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  119. package/dest/kernel/private_circuit_public_inputs.js +33 -15
  120. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +9 -0
  121. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  122. package/dest/kernel/private_kernel_circuit_public_inputs.js +8 -4
  123. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
  124. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
  125. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +9 -6
  126. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +11 -4
  127. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  128. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +20 -18
  129. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +4 -4
  130. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
  131. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +9 -10
  132. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +11 -11
  133. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
  134. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +11 -12
  135. package/dest/kernel/private_validation_requests.d.ts +8 -20
  136. package/dest/kernel/private_validation_requests.d.ts.map +1 -1
  137. package/dest/kernel/private_validation_requests.js +9 -21
  138. package/dest/kernel/utils/order_and_comparison.d.ts +0 -3
  139. package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
  140. package/dest/kernel/utils/order_and_comparison.js +0 -19
  141. package/dest/logs/extended_public_log.d.ts +1 -1
  142. package/dest/logs/shared_secret_derivation.d.ts +1 -1
  143. package/dest/logs/shared_secret_derivation.js +1 -1
  144. package/dest/messaging/l2_to_l1_membership.d.ts +4 -1
  145. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  146. package/dest/messaging/l2_to_l1_membership.js +49 -54
  147. package/dest/messaging/l2_to_l1_message.d.ts +2 -0
  148. package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
  149. package/dest/messaging/l2_to_l1_message.js +7 -0
  150. package/dest/note/notes_filter.d.ts +5 -2
  151. package/dest/note/notes_filter.d.ts.map +1 -1
  152. package/dest/note/notes_filter.js +1 -1
  153. package/dest/p2p/attestation_utils.d.ts +10 -0
  154. package/dest/p2p/attestation_utils.d.ts.map +1 -0
  155. package/dest/p2p/attestation_utils.js +21 -0
  156. package/dest/p2p/block_attestation.d.ts +3 -4
  157. package/dest/p2p/block_attestation.d.ts.map +1 -1
  158. package/dest/p2p/block_attestation.js +3 -4
  159. package/dest/p2p/block_proposal.d.ts +8 -1
  160. package/dest/p2p/block_proposal.d.ts.map +1 -1
  161. package/dest/p2p/block_proposal.js +21 -8
  162. package/dest/p2p/consensus_payload.d.ts +3 -11
  163. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  164. package/dest/p2p/consensus_payload.js +13 -22
  165. package/dest/p2p/index.d.ts +1 -0
  166. package/dest/p2p/index.d.ts.map +1 -1
  167. package/dest/p2p/index.js +1 -0
  168. package/dest/p2p/topic_type.d.ts.map +1 -1
  169. package/dest/p2p/topic_type.js +5 -3
  170. package/dest/rollup/block_root_rollup.d.ts +1 -1
  171. package/dest/slashing/index.d.ts +51 -0
  172. package/dest/slashing/index.d.ts.map +1 -0
  173. package/dest/slashing/index.js +54 -0
  174. package/dest/stats/stats.d.ts +2 -2
  175. package/dest/stats/stats.d.ts.map +1 -1
  176. package/dest/tests/factories.d.ts +0 -2
  177. package/dest/tests/factories.d.ts.map +1 -1
  178. package/dest/tests/factories.js +25 -24
  179. package/dest/tests/mocks.d.ts +2 -0
  180. package/dest/tests/mocks.d.ts.map +1 -1
  181. package/dest/tests/mocks.js +31 -22
  182. package/dest/tx/index.d.ts +0 -1
  183. package/dest/tx/index.d.ts.map +1 -1
  184. package/dest/tx/index.js +0 -1
  185. package/dest/tx/private_execution_result.d.ts +2 -2
  186. package/dest/tx/private_execution_result.d.ts.map +1 -1
  187. package/dest/tx/private_execution_result.js +11 -11
  188. package/dest/tx/processed_tx.d.ts +2 -2
  189. package/dest/tx/processed_tx.d.ts.map +1 -1
  190. package/dest/tx/processed_tx.js +4 -4
  191. package/dest/tx/proven_tx.d.ts +1 -1
  192. package/dest/tx/proven_tx.d.ts.map +1 -1
  193. package/dest/tx/proven_tx.js +7 -3
  194. package/dest/tx/simulated_tx.d.ts +11 -17
  195. package/dest/tx/simulated_tx.d.ts.map +1 -1
  196. package/dest/tx/simulated_tx.js +12 -12
  197. package/dest/tx/tx.d.ts +25 -25
  198. package/dest/tx/tx.d.ts.map +1 -1
  199. package/dest/tx/tx.js +60 -48
  200. package/dest/tx/tx_effect.d.ts +2 -2
  201. package/dest/tx/tx_effect.d.ts.map +1 -1
  202. package/dest/tx/tx_effect.js +3 -18
  203. package/dest/tx/tx_execution_request.js +2 -2
  204. package/dest/tx/tx_hash.d.ts +7 -0
  205. package/dest/tx/tx_hash.d.ts.map +1 -1
  206. package/dest/tx/tx_hash.js +19 -1
  207. package/dest/tx/tx_request.d.ts +5 -5
  208. package/dest/tx/tx_request.d.ts.map +1 -1
  209. package/dest/tx/tx_request.js +7 -7
  210. package/dest/tx/validator/error_texts.d.ts +1 -0
  211. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  212. package/dest/tx/validator/error_texts.js +1 -0
  213. package/dest/tx/validator/tx_validator.d.ts +6 -4
  214. package/dest/tx/validator/tx_validator.d.ts.map +1 -1
  215. package/dest/tx/validator/tx_validator.js +3 -0
  216. package/dest/versioning/versioning.d.ts.map +1 -1
  217. package/dest/vks/verification_key.d.ts.map +1 -1
  218. package/dest/vks/verification_key.js +4 -4
  219. package/package.json +10 -9
  220. package/src/abi/abi.ts +0 -38
  221. package/src/abi/authorization_selector.ts +95 -0
  222. package/src/abi/contract_artifact.ts +0 -49
  223. package/src/abi/decoder.ts +3 -6
  224. package/src/abi/index.ts +1 -0
  225. package/src/avm/avm.ts +7 -9
  226. package/src/block/l2_block.ts +18 -0
  227. package/src/block/l2_block_source.ts +70 -1
  228. package/src/block/proposal/committee_attestation.ts +5 -1
  229. package/src/block/published_l2_block.ts +14 -5
  230. package/src/contract/contract_instance.ts +3 -3
  231. package/src/contract/interfaces/protocol_contract_addresses.ts +5 -10
  232. package/src/contract/private_function_membership_proof.ts +1 -1
  233. package/src/contract/utility_function_membership_proof.ts +1 -1
  234. package/src/{shared_mutable/shared_mutable_values.ts → delayed_public_mutable/delayed_public_mutable_values.ts} +10 -10
  235. package/src/delayed_public_mutable/delayed_public_mutable_values_with_hash.ts +38 -0
  236. package/src/delayed_public_mutable/index.ts +4 -0
  237. package/src/gas/gas.ts +4 -0
  238. package/src/hash/hash.ts +1 -4
  239. package/src/interfaces/archiver.ts +3 -1
  240. package/src/interfaces/aztec-node-admin.ts +19 -8
  241. package/src/interfaces/configs.ts +17 -0
  242. package/src/interfaces/pxe.ts +4 -2
  243. package/src/interfaces/server.ts +4 -2
  244. package/src/interfaces/slasher.ts +49 -0
  245. package/src/interfaces/tx_provider.ts +16 -0
  246. package/src/kernel/claimed_length_array.ts +104 -0
  247. package/src/kernel/hints/build_note_hash_read_request_hints.ts +28 -30
  248. package/src/kernel/hints/build_nullifier_read_request_hints.ts +28 -59
  249. package/src/kernel/hints/build_transient_data_hints.ts +12 -14
  250. package/src/kernel/hints/index.ts +1 -2
  251. package/src/kernel/hints/note_hash_read_request_hints.ts +4 -16
  252. package/src/kernel/hints/nullifier_read_request_hints.ts +4 -16
  253. package/src/kernel/hints/private_kernel_reset_hints.ts +7 -7
  254. package/src/kernel/hints/read_request_hints.ts +22 -22
  255. package/src/kernel/hints/{transient_data_index_hint.ts → transient_data_squashing_hint.ts} +5 -5
  256. package/src/kernel/index.ts +1 -0
  257. package/src/kernel/private_accumulated_data.ts +23 -23
  258. package/src/kernel/private_call_data.ts +3 -3
  259. package/src/kernel/private_circuit_public_inputs.ts +92 -68
  260. package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -1
  261. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +13 -4
  262. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +20 -20
  263. package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +7 -7
  264. package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +16 -10
  265. package/src/kernel/private_validation_requests.ts +19 -50
  266. package/src/kernel/utils/order_and_comparison.ts +0 -25
  267. package/src/logs/shared_secret_derivation.ts +1 -1
  268. package/src/messaging/l2_to_l1_membership.ts +76 -85
  269. package/src/messaging/l2_to_l1_message.ts +9 -0
  270. package/src/note/notes_filter.ts +6 -3
  271. package/src/p2p/attestation_utils.ts +35 -0
  272. package/src/p2p/block_attestation.ts +3 -4
  273. package/src/p2p/block_proposal.ts +23 -5
  274. package/src/p2p/consensus_payload.ts +10 -29
  275. package/src/p2p/index.ts +1 -0
  276. package/src/p2p/topic_type.ts +3 -1
  277. package/src/slashing/index.ts +74 -0
  278. package/src/stats/stats.ts +2 -2
  279. package/src/tests/factories.ts +37 -27
  280. package/src/tests/mocks.ts +24 -22
  281. package/src/tx/index.ts +0 -1
  282. package/src/tx/private_execution_result.ts +11 -9
  283. package/src/tx/processed_tx.ts +6 -6
  284. package/src/tx/proven_tx.ts +7 -8
  285. package/src/tx/simulated_tx.ts +13 -19
  286. package/src/tx/tx.ts +70 -57
  287. package/src/tx/tx_effect.ts +5 -20
  288. package/src/tx/tx_execution_request.ts +2 -2
  289. package/src/tx/tx_hash.ts +21 -1
  290. package/src/tx/tx_request.ts +7 -6
  291. package/src/tx/validator/error_texts.ts +1 -0
  292. package/src/tx/validator/tx_validator.ts +5 -0
  293. package/src/versioning/versioning.ts +0 -3
  294. package/src/vks/verification_key.ts +4 -7
  295. package/dest/interfaces/tx-collector.d.ts +0 -15
  296. package/dest/interfaces/tx-collector.d.ts.map +0 -1
  297. package/dest/kernel/hints/rollup_validation_requests.d.ts +0 -34
  298. package/dest/kernel/hints/rollup_validation_requests.d.ts.map +0 -1
  299. package/dest/kernel/hints/rollup_validation_requests.js +0 -55
  300. package/dest/kernel/hints/transient_data_index_hint.d.ts.map +0 -1
  301. package/dest/shared_mutable/index.d.ts +0 -5
  302. package/dest/shared_mutable/index.d.ts.map +0 -1
  303. package/dest/shared_mutable/index.js +0 -4
  304. package/dest/shared_mutable/scheduled_delay_change.d.ts.map +0 -1
  305. package/dest/shared_mutable/scheduled_value_change.d.ts.map +0 -1
  306. package/dest/shared_mutable/shared_mutable_values.d.ts +0 -20
  307. package/dest/shared_mutable/shared_mutable_values.d.ts.map +0 -1
  308. package/dest/shared_mutable/shared_mutable_values_with_hash.d.ts.map +0 -1
  309. package/dest/shared_mutable/shared_mutable_values_with_hash.js +0 -30
  310. package/dest/tx/include_by_timestamp.d.ts +0 -54
  311. package/dest/tx/include_by_timestamp.d.ts.map +0 -1
  312. package/dest/tx/include_by_timestamp.js +0 -72
  313. package/src/interfaces/tx-collector.ts +0 -17
  314. package/src/kernel/hints/rollup_validation_requests.ts +0 -71
  315. package/src/shared_mutable/index.ts +0 -4
  316. package/src/shared_mutable/shared_mutable_values_with_hash.ts +0 -38
  317. package/src/tx/include_by_timestamp.ts +0 -90
  318. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.d.ts +0 -0
  319. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.js +0 -0
  320. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.d.ts +0 -0
  321. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.js +0 -0
  322. /package/dest/interfaces/{tx-collector.js → tx_provider.js} +0 -0
  323. /package/src/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.ts +0 -0
  324. /package/src/{shared_mutable → delayed_public_mutable}/scheduled_value_change.ts +0 -0
@@ -1,54 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
- import type { FieldsOf } from '@aztec/foundation/types';
4
- import type { UInt64 } from '../types/index.js';
5
- /**
6
- * Maximum block timestamp value at which the transaction can still be included.
7
- */
8
- export declare class IncludeByTimestamp {
9
- /**
10
- * Whether max inclusion timestamp was requested.
11
- */
12
- isSome: boolean;
13
- /**
14
- * The requested max inclusion timestamp of a block, if isSome is true.
15
- */
16
- value: UInt64;
17
- constructor(
18
- /**
19
- * Whether max inclusion timestamp was requested.
20
- */
21
- isSome: boolean,
22
- /**
23
- * The requested max inclusion timestamp of a block, if isSome is true.
24
- */
25
- value: UInt64);
26
- /**
27
- * Serialize as a buffer.
28
- * @returns The buffer.
29
- */
30
- toBuffer(): Buffer<ArrayBufferLike>;
31
- toFields(): Fr[];
32
- /**
33
- * Deserializes IncludeByTimestamp from a buffer or reader.
34
- * @param buffer - Buffer to read from.
35
- * @returns The IncludeByTimestamp.
36
- */
37
- static fromBuffer(buffer: Buffer | BufferReader): IncludeByTimestamp;
38
- static fromFields(fields: Fr[] | FieldReader): IncludeByTimestamp;
39
- static empty(): IncludeByTimestamp;
40
- isEmpty(): boolean;
41
- /**
42
- * Create a new instance from a fields dictionary.
43
- * @param fields - The dictionary.
44
- * @returns A new instance.
45
- */
46
- static from(fields: FieldsOf<IncludeByTimestamp>): IncludeByTimestamp;
47
- /**
48
- * Serialize into a field array. Low-level utility.
49
- * @param fields - Object with fields.
50
- * @returns The array.
51
- */
52
- static getFields(fields: FieldsOf<IncludeByTimestamp>): readonly [boolean, bigint];
53
- }
54
- //# sourceMappingURL=include_by_timestamp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"include_by_timestamp.d.ts","sourceRoot":"","sources":["../../src/tx/include_by_timestamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,qBAAa,kBAAkB;IAE3B;;OAEG;IACI,MAAM,EAAE,OAAO;IACtB;;OAEG;IACI,KAAK,EAAE,MAAM;;IAPpB;;OAEG;IACI,MAAM,EAAE,OAAO;IACtB;;OAEG;IACI,KAAK,EAAE,MAAM;IAQtB;;;OAGG;IACH,QAAQ;IAIR,QAAQ,IAAI,EAAE,EAAE;IAUhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB;IASpE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,kBAAkB;IAKjE,MAAM,CAAC,KAAK;IAIZ,OAAO,IAAI,OAAO;IAIlB;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,kBAAkB;IAIrE;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC;CAGtD"}
@@ -1,72 +0,0 @@
1
- import { INCLUDE_BY_TIMESTAMP_LENGTH } from '@aztec/constants';
2
- import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
3
- /**
4
- * Maximum block timestamp value at which the transaction can still be included.
5
- */ export class IncludeByTimestamp {
6
- isSome;
7
- value;
8
- constructor(/**
9
- * Whether max inclusion timestamp was requested.
10
- */ isSome, /**
11
- * The requested max inclusion timestamp of a block, if isSome is true.
12
- */ value){
13
- this.isSome = isSome;
14
- this.value = value;
15
- // For sanity we check that the value is less than 2 ** 64.
16
- if (value >= 1n << 64n) {
17
- throw new Error('Value is not a u64.');
18
- }
19
- }
20
- /**
21
- * Serialize as a buffer.
22
- * @returns The buffer.
23
- */ toBuffer() {
24
- return serializeToBuffer(...IncludeByTimestamp.getFields(this));
25
- }
26
- toFields() {
27
- const fields = serializeToFields(...IncludeByTimestamp.getFields(this));
28
- if (fields.length !== INCLUDE_BY_TIMESTAMP_LENGTH) {
29
- throw new Error(`Invalid number of fields for IncludeByTimestamp. Expected ${INCLUDE_BY_TIMESTAMP_LENGTH}, got ${fields.length}`);
30
- }
31
- return fields;
32
- }
33
- /**
34
- * Deserializes IncludeByTimestamp from a buffer or reader.
35
- * @param buffer - Buffer to read from.
36
- * @returns The IncludeByTimestamp.
37
- */ static fromBuffer(buffer) {
38
- const reader = BufferReader.asReader(buffer);
39
- const isSome = reader.readBoolean();
40
- // UInt64 is aliased to bigint in TypeScript, causing it to be serialized as a 256-bit integer.
41
- // Therefore, we must read it back using readUInt256() rather than readUInt64().
42
- const value = reader.readUInt256();
43
- return new IncludeByTimestamp(isSome, value);
44
- }
45
- static fromFields(fields) {
46
- const reader = FieldReader.asReader(fields);
47
- return new IncludeByTimestamp(reader.readBoolean(), reader.readU64());
48
- }
49
- static empty() {
50
- return new IncludeByTimestamp(false, 0n);
51
- }
52
- isEmpty() {
53
- return !this.isSome && this.value === 0n;
54
- }
55
- /**
56
- * Create a new instance from a fields dictionary.
57
- * @param fields - The dictionary.
58
- * @returns A new instance.
59
- */ static from(fields) {
60
- return new IncludeByTimestamp(...IncludeByTimestamp.getFields(fields));
61
- }
62
- /**
63
- * Serialize into a field array. Low-level utility.
64
- * @param fields - Object with fields.
65
- * @returns The array.
66
- */ static getFields(fields) {
67
- return [
68
- fields.isSome,
69
- fields.value
70
- ];
71
- }
72
- }
@@ -1,17 +0,0 @@
1
- import type { PeerId } from '@libp2p/interface';
2
-
3
- import type { BlockProposal } from '../p2p/block_proposal.js';
4
- import type { Tx } from '../tx/tx.js';
5
- import type { TxHash } from '../tx/tx_hash.js';
6
-
7
- export interface ITxCollector {
8
- collectTransactions(
9
- txHashes: TxHash[],
10
- peerWhoSentTheProposal: PeerId | undefined,
11
- ): Promise<{ txs: Tx[]; missing?: TxHash[] }>;
12
-
13
- collectForBlockProposal(
14
- proposal: BlockProposal,
15
- peerWhoSentTheProposal: PeerId | undefined,
16
- ): Promise<{ txs: Tx[]; missing?: TxHash[] }>;
17
- }
@@ -1,71 +0,0 @@
1
- import { ROLLUP_VALIDATION_REQUESTS_LENGTH } from '@aztec/constants';
2
- import type { Fr } from '@aztec/foundation/fields';
3
- import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
4
- import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
5
- import type { FieldsOf } from '@aztec/foundation/types';
6
-
7
- import { IncludeByTimestamp } from '../../tx/include_by_timestamp.js';
8
-
9
- /**
10
- * Validation requests directed at the rollup, accumulated during the execution of the transaction.
11
- */
12
- export class RollupValidationRequests {
13
- constructor(
14
- /** The highest timestamp of a block in which this transaction can still be included. */
15
- public includeByTimestamp: IncludeByTimestamp,
16
- ) {}
17
-
18
- getSize() {
19
- return this.toBuffer().length;
20
- }
21
-
22
- toBuffer() {
23
- return serializeToBuffer(this.includeByTimestamp);
24
- }
25
-
26
- toString() {
27
- return bufferToHex(this.toBuffer());
28
- }
29
-
30
- static getFields(fields: FieldsOf<RollupValidationRequests>) {
31
- return [fields.includeByTimestamp] as const;
32
- }
33
-
34
- static fromFields(fields: Fr[] | FieldReader) {
35
- const reader = FieldReader.asReader(fields);
36
- return new RollupValidationRequests(IncludeByTimestamp.fromFields(reader));
37
- }
38
-
39
- toFields(): Fr[] {
40
- const fields = serializeToFields(...RollupValidationRequests.getFields(this));
41
- if (fields.length !== ROLLUP_VALIDATION_REQUESTS_LENGTH) {
42
- throw new Error(
43
- `Invalid number of fields for RollupValidationRequests. Expected ${ROLLUP_VALIDATION_REQUESTS_LENGTH}, got ${fields.length}`,
44
- );
45
- }
46
- return fields;
47
- }
48
-
49
- /**
50
- * Deserializes from a buffer or reader, corresponding to a write in cpp.
51
- * @param buffer - Buffer or reader to read from.
52
- * @returns Deserialized object.
53
- */
54
- static fromBuffer(buffer: Buffer | BufferReader) {
55
- const reader = BufferReader.asReader(buffer);
56
- return new RollupValidationRequests(reader.readObject(IncludeByTimestamp));
57
- }
58
-
59
- /**
60
- * Deserializes from a string, corresponding to a write in cpp.
61
- * @param str - String to read from.
62
- * @returns Deserialized object.
63
- */
64
- static fromString(str: string) {
65
- return RollupValidationRequests.fromBuffer(hexToBuffer(str));
66
- }
67
-
68
- static empty() {
69
- return new RollupValidationRequests(IncludeByTimestamp.empty());
70
- }
71
- }
@@ -1,4 +0,0 @@
1
- export * from './scheduled_delay_change.js';
2
- export * from './scheduled_value_change.js';
3
- export * from './shared_mutable_values.js';
4
- export * from './shared_mutable_values_with_hash.js';
@@ -1,38 +0,0 @@
1
- import { UPDATED_CLASS_IDS_SLOT } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
3
-
4
- import type { AztecAddress } from '../aztec-address/index.js';
5
- import { deriveStorageSlotInMap } from '../hash/map_slot.js';
6
- import { ScheduledDelayChange } from './scheduled_delay_change.js';
7
- import { ScheduledValueChange } from './scheduled_value_change.js';
8
- import { SHARED_MUTABLE_VALUES_LEN, SharedMutableValues } from './shared_mutable_values.js';
9
-
10
- export class SharedMutableValuesWithHash {
11
- private smv: SharedMutableValues;
12
-
13
- constructor(svc: ScheduledValueChange, sdc: ScheduledDelayChange) {
14
- this.smv = new SharedMutableValues(svc, sdc);
15
- }
16
-
17
- async toFields(): Promise<Fr[]> {
18
- return [...this.smv.toFields(), await this.smv.hash()];
19
- }
20
-
21
- async writeToTree(sharedMutableSlot: Fr, storageWrite: (storageSlot: Fr, value: Fr) => Promise<void>) {
22
- const fields = await this.toFields();
23
-
24
- for (let i = 0; i < fields.length; i++) {
25
- await storageWrite(sharedMutableSlot.add(new Fr(i)), fields[i]);
26
- }
27
- }
28
-
29
- static async getContractUpdateSlots(contractAddress: AztecAddress) {
30
- const sharedMutableSlot = await deriveStorageSlotInMap(new Fr(UPDATED_CLASS_IDS_SLOT), contractAddress);
31
- const sharedMutableHashSlot = sharedMutableSlot.add(new Fr(SHARED_MUTABLE_VALUES_LEN));
32
-
33
- return {
34
- sharedMutableSlot,
35
- sharedMutableHashSlot,
36
- };
37
- }
38
- }
@@ -1,90 +0,0 @@
1
- import { INCLUDE_BY_TIMESTAMP_LENGTH } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
4
- import type { FieldsOf } from '@aztec/foundation/types';
5
-
6
- import type { UInt64 } from '../types/index.js';
7
-
8
- /**
9
- * Maximum block timestamp value at which the transaction can still be included.
10
- */
11
- export class IncludeByTimestamp {
12
- constructor(
13
- /**
14
- * Whether max inclusion timestamp was requested.
15
- */
16
- public isSome: boolean,
17
- /**
18
- * The requested max inclusion timestamp of a block, if isSome is true.
19
- */
20
- public value: UInt64,
21
- ) {
22
- // For sanity we check that the value is less than 2 ** 64.
23
- if (value >= 1n << 64n) {
24
- throw new Error('Value is not a u64.');
25
- }
26
- }
27
-
28
- /**
29
- * Serialize as a buffer.
30
- * @returns The buffer.
31
- */
32
- toBuffer() {
33
- return serializeToBuffer(...IncludeByTimestamp.getFields(this));
34
- }
35
-
36
- toFields(): Fr[] {
37
- const fields = serializeToFields(...IncludeByTimestamp.getFields(this));
38
- if (fields.length !== INCLUDE_BY_TIMESTAMP_LENGTH) {
39
- throw new Error(
40
- `Invalid number of fields for IncludeByTimestamp. Expected ${INCLUDE_BY_TIMESTAMP_LENGTH}, got ${fields.length}`,
41
- );
42
- }
43
- return fields;
44
- }
45
-
46
- /**
47
- * Deserializes IncludeByTimestamp from a buffer or reader.
48
- * @param buffer - Buffer to read from.
49
- * @returns The IncludeByTimestamp.
50
- */
51
- static fromBuffer(buffer: Buffer | BufferReader): IncludeByTimestamp {
52
- const reader = BufferReader.asReader(buffer);
53
- const isSome = reader.readBoolean();
54
- // UInt64 is aliased to bigint in TypeScript, causing it to be serialized as a 256-bit integer.
55
- // Therefore, we must read it back using readUInt256() rather than readUInt64().
56
- const value = reader.readUInt256();
57
- return new IncludeByTimestamp(isSome, value);
58
- }
59
-
60
- static fromFields(fields: Fr[] | FieldReader): IncludeByTimestamp {
61
- const reader = FieldReader.asReader(fields);
62
- return new IncludeByTimestamp(reader.readBoolean(), reader.readU64());
63
- }
64
-
65
- static empty() {
66
- return new IncludeByTimestamp(false, 0n);
67
- }
68
-
69
- isEmpty(): boolean {
70
- return !this.isSome && this.value === 0n;
71
- }
72
-
73
- /**
74
- * Create a new instance from a fields dictionary.
75
- * @param fields - The dictionary.
76
- * @returns A new instance.
77
- */
78
- static from(fields: FieldsOf<IncludeByTimestamp>): IncludeByTimestamp {
79
- return new IncludeByTimestamp(...IncludeByTimestamp.getFields(fields));
80
- }
81
-
82
- /**
83
- * Serialize into a field array. Low-level utility.
84
- * @param fields - Object with fields.
85
- * @returns The array.
86
- */
87
- static getFields(fields: FieldsOf<IncludeByTimestamp>) {
88
- return [fields.isSome, fields.value] as const;
89
- }
90
- }