@aztec/stdlib 0.0.1-commit.2f68f620 → 0.0.1-commit.3100065

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 (491) hide show
  1. package/dest/abi/buffer.d.ts +6 -2
  2. package/dest/abi/buffer.d.ts.map +1 -1
  3. package/dest/abi/buffer.js +13 -1
  4. package/dest/abi/contract_artifact.d.ts +14 -1
  5. package/dest/abi/contract_artifact.d.ts.map +1 -1
  6. package/dest/abi/contract_artifact.js +17 -0
  7. package/dest/avm/avm.js +1 -1
  8. package/dest/avm/avm_proving_request.d.ts +70 -70
  9. package/dest/avm/contract_storage_read.d.ts +58 -0
  10. package/dest/avm/contract_storage_read.d.ts.map +1 -0
  11. package/dest/avm/contract_storage_read.js +65 -0
  12. package/dest/avm/contract_storage_update_request.d.ts +65 -0
  13. package/dest/avm/contract_storage_update_request.d.ts.map +1 -0
  14. package/dest/avm/contract_storage_update_request.js +80 -0
  15. package/dest/avm/index.d.ts +6 -1
  16. package/dest/avm/index.d.ts.map +1 -1
  17. package/dest/avm/index.js +5 -0
  18. package/dest/avm/public_call_stack_item_compressed.d.ts +43 -0
  19. package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -0
  20. package/dest/avm/public_call_stack_item_compressed.js +70 -0
  21. package/dest/avm/public_data_update_request.d.ts +62 -0
  22. package/dest/avm/public_data_update_request.d.ts.map +1 -0
  23. package/dest/avm/public_data_update_request.js +67 -0
  24. package/dest/avm/public_inner_call_request.d.ts +50 -0
  25. package/dest/avm/public_inner_call_request.d.ts.map +1 -0
  26. package/dest/avm/public_inner_call_request.js +74 -0
  27. package/dest/aztec-address/index.d.ts +35 -5
  28. package/dest/aztec-address/index.d.ts.map +1 -1
  29. package/dest/aztec-address/index.js +32 -8
  30. package/dest/block/attestation_info.d.ts +1 -1
  31. package/dest/block/attestation_info.d.ts.map +1 -1
  32. package/dest/block/attestation_info.js +7 -4
  33. package/dest/block/l2_block_source.d.ts +46 -23
  34. package/dest/block/l2_block_source.d.ts.map +1 -1
  35. package/dest/block/l2_block_source.js +15 -1
  36. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +39 -0
  37. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -0
  38. package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +165 -0
  39. package/dest/block/l2_block_stream/index.d.ts +2 -1
  40. package/dest/block/l2_block_stream/index.d.ts.map +1 -1
  41. package/dest/block/l2_block_stream/index.js +1 -0
  42. package/dest/block/l2_block_stream/interfaces.d.ts +81 -11
  43. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  44. package/dest/block/l2_block_stream/interfaces.js +25 -1
  45. package/dest/block/l2_block_stream/l2_block_stream.d.ts +23 -15
  46. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  47. package/dest/block/l2_block_stream/l2_block_stream.js +149 -152
  48. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +6 -12
  49. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
  50. package/dest/block/l2_block_stream/l2_tips_memory_store.js +8 -32
  51. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +17 -18
  52. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  53. package/dest/block/l2_block_stream/l2_tips_store_base.js +70 -58
  54. package/dest/block/proposal/attestations_and_signers.d.ts +19 -1
  55. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  56. package/dest/block/proposal/attestations_and_signers.js +47 -7
  57. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  58. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  59. package/dest/block/test/l2_tips_store_test_suite.js +296 -37
  60. package/dest/block/validate_block_result.d.ts +16 -1
  61. package/dest/block/validate_block_result.d.ts.map +1 -1
  62. package/dest/block/validate_block_result.js +18 -3
  63. package/dest/checkpoint/checkpoint.js +2 -2
  64. package/dest/checkpoint/index.d.ts +2 -1
  65. package/dest/checkpoint/index.d.ts.map +1 -1
  66. package/dest/checkpoint/index.js +1 -0
  67. package/dest/checkpoint/simulation_overrides.d.ts +61 -0
  68. package/dest/checkpoint/simulation_overrides.d.ts.map +1 -0
  69. package/dest/checkpoint/simulation_overrides.js +98 -0
  70. package/dest/checkpoint/validate.d.ts +11 -3
  71. package/dest/checkpoint/validate.d.ts.map +1 -1
  72. package/dest/checkpoint/validate.js +9 -6
  73. package/dest/config/index.d.ts +2 -1
  74. package/dest/config/index.d.ts.map +1 -1
  75. package/dest/config/index.js +1 -0
  76. package/dest/config/network-consensus-config.d.ts +72 -0
  77. package/dest/config/network-consensus-config.d.ts.map +1 -0
  78. package/dest/config/network-consensus-config.js +223 -0
  79. package/dest/config/sequencer-config.d.ts +4 -2
  80. package/dest/config/sequencer-config.d.ts.map +1 -1
  81. package/dest/config/sequencer-config.js +22 -3
  82. package/dest/contract/contract_address.d.ts +5 -4
  83. package/dest/contract/contract_address.d.ts.map +1 -1
  84. package/dest/contract/contract_instance.d.ts +16 -2
  85. package/dest/contract/contract_instance.d.ts.map +1 -1
  86. package/dest/contract/contract_instance.js +45 -0
  87. package/dest/contract/deployment_info.d.ts +24 -0
  88. package/dest/contract/deployment_info.d.ts.map +1 -0
  89. package/dest/contract/deployment_info.js +3 -0
  90. package/dest/contract/index.d.ts +2 -1
  91. package/dest/contract/index.d.ts.map +1 -1
  92. package/dest/contract/index.js +1 -0
  93. package/dest/contract/interfaces/contract_data_source.d.ts +3 -5
  94. package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
  95. package/dest/contract/interfaces/contract_instance.d.ts +71 -10
  96. package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
  97. package/dest/contract/interfaces/contract_instance.js +7 -2
  98. package/dest/contract/interfaces/node-info.d.ts +11 -1
  99. package/dest/contract/interfaces/node-info.d.ts.map +1 -1
  100. package/dest/contract/interfaces/node-info.js +7 -1
  101. package/dest/contract/partial_address.d.ts +9 -3
  102. package/dest/contract/partial_address.d.ts.map +1 -1
  103. package/dest/contract/partial_address.js +8 -2
  104. package/dest/database-version/version_manager.d.ts +18 -4
  105. package/dest/database-version/version_manager.d.ts.map +1 -1
  106. package/dest/database-version/version_manager.js +76 -6
  107. package/dest/deserialization/index.d.ts +35 -3
  108. package/dest/deserialization/index.d.ts.map +1 -1
  109. package/dest/deserialization/index.js +32 -1
  110. package/dest/file-store/factory.d.ts +1 -1
  111. package/dest/file-store/factory.d.ts.map +1 -1
  112. package/dest/file-store/factory.js +7 -0
  113. package/dest/file-store/index.d.ts +2 -1
  114. package/dest/file-store/index.d.ts.map +1 -1
  115. package/dest/file-store/index.js +1 -0
  116. package/dest/file-store/memory.d.ts +24 -0
  117. package/dest/file-store/memory.d.ts.map +1 -0
  118. package/dest/file-store/memory.js +80 -0
  119. package/dest/gas/gas_settings.d.ts +7 -13
  120. package/dest/gas/gas_settings.d.ts.map +1 -1
  121. package/dest/gas/gas_settings.js +9 -16
  122. package/dest/gas/index.d.ts +2 -1
  123. package/dest/gas/index.d.ts.map +1 -1
  124. package/dest/gas/index.js +1 -0
  125. package/dest/gas/tx_gas_limits.d.ts +72 -0
  126. package/dest/gas/tx_gas_limits.d.ts.map +1 -0
  127. package/dest/gas/tx_gas_limits.js +85 -0
  128. package/dest/ha-signing/config.d.ts +19 -5
  129. package/dest/ha-signing/config.d.ts.map +1 -1
  130. package/dest/ha-signing/config.js +9 -3
  131. package/dest/ha-signing/local_config.d.ts +10 -2
  132. package/dest/ha-signing/local_config.d.ts.map +1 -1
  133. package/dest/ha-signing/local_config.js +8 -2
  134. package/dest/hash/hash.d.ts +1 -2
  135. package/dest/hash/hash.d.ts.map +1 -1
  136. package/dest/hash/hash.js +0 -7
  137. package/dest/interfaces/archiver.d.ts +12 -7
  138. package/dest/interfaces/archiver.d.ts.map +1 -1
  139. package/dest/interfaces/archiver.js +4 -2
  140. package/dest/interfaces/aztec-node-admin.d.ts +24 -17
  141. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  142. package/dest/interfaces/aztec-node-admin.js +1 -1
  143. package/dest/interfaces/aztec-node-debug.d.ts +40 -2
  144. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -1
  145. package/dest/interfaces/aztec-node-debug.js +29 -1
  146. package/dest/interfaces/aztec-node.d.ts +69 -28
  147. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  148. package/dest/interfaces/aztec-node.js +56 -20
  149. package/dest/interfaces/block-builder.d.ts +3 -1
  150. package/dest/interfaces/block-builder.d.ts.map +1 -1
  151. package/dest/interfaces/chain_tips.d.ts +8 -47
  152. package/dest/interfaces/chain_tips.d.ts.map +1 -1
  153. package/dest/interfaces/chain_tips.js +1 -6
  154. package/dest/interfaces/checkpoint_parameter.d.ts +3 -3
  155. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -1
  156. package/dest/interfaces/checkpoint_parameter.js +3 -3
  157. package/dest/interfaces/client.d.ts +2 -1
  158. package/dest/interfaces/client.d.ts.map +1 -1
  159. package/dest/interfaces/configs.d.ts +27 -6
  160. package/dest/interfaces/configs.d.ts.map +1 -1
  161. package/dest/interfaces/configs.js +5 -1
  162. package/dest/interfaces/get_tx_by_hash_options.d.ts +9 -0
  163. package/dest/interfaces/get_tx_by_hash_options.d.ts.map +1 -0
  164. package/dest/interfaces/get_tx_by_hash_options.js +4 -0
  165. package/dest/interfaces/merkle_tree_operations.d.ts +3 -9
  166. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  167. package/dest/interfaces/p2p.d.ts +38 -9
  168. package/dest/interfaces/p2p.d.ts.map +1 -1
  169. package/dest/interfaces/p2p.js +14 -2
  170. package/dest/interfaces/private_kernel_prover.d.ts +9 -11
  171. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  172. package/dest/interfaces/prover-client.d.ts +2 -3
  173. package/dest/interfaces/prover-client.d.ts.map +1 -1
  174. package/dest/interfaces/prover-coordination.d.ts +15 -0
  175. package/dest/interfaces/prover-coordination.d.ts.map +1 -0
  176. package/dest/interfaces/prover-coordination.js +1 -0
  177. package/dest/interfaces/prover-node.d.ts +12 -8
  178. package/dest/interfaces/prover-node.d.ts.map +1 -1
  179. package/dest/interfaces/prover-node.js +24 -17
  180. package/dest/interfaces/proving-job.d.ts +87 -74
  181. package/dest/interfaces/proving-job.d.ts.map +1 -1
  182. package/dest/interfaces/proving-job.js +13 -4
  183. package/dest/interfaces/server.d.ts +2 -2
  184. package/dest/interfaces/server.d.ts.map +1 -1
  185. package/dest/interfaces/server.js +1 -1
  186. package/dest/interfaces/server_circuit_prover.d.ts +3 -3
  187. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  188. package/dest/interfaces/validator.d.ts +15 -4
  189. package/dest/interfaces/validator.d.ts.map +1 -1
  190. package/dest/interfaces/validator.js +3 -1
  191. package/dest/interfaces/world_state.d.ts +14 -1
  192. package/dest/interfaces/world_state.d.ts.map +1 -1
  193. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
  194. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
  195. package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
  196. package/dest/kernel/hints/index.d.ts +2 -1
  197. package/dest/kernel/hints/index.d.ts.map +1 -1
  198. package/dest/kernel/hints/index.js +1 -0
  199. package/dest/kernel/hints/read_request.js +1 -1
  200. package/dest/kernel/hints/tree_leaf_read_request.d.ts +14 -0
  201. package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +1 -0
  202. package/dest/kernel/hints/tree_leaf_read_request.js +33 -0
  203. package/dest/kernel/index.d.ts +2 -2
  204. package/dest/kernel/index.d.ts.map +1 -1
  205. package/dest/kernel/index.js +1 -1
  206. package/dest/kernel/log_hash.d.ts +1 -1
  207. package/dest/kernel/log_hash.d.ts.map +1 -1
  208. package/dest/kernel/log_hash.js +2 -2
  209. package/dest/kernel/note_hash.js +1 -1
  210. package/dest/kernel/nullifier.js +1 -1
  211. package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
  212. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  213. package/dest/kernel/private_circuit_public_inputs.js +14 -7
  214. package/dest/kernel/private_context_inputs.d.ts +4 -3
  215. package/dest/kernel/private_context_inputs.d.ts.map +1 -1
  216. package/dest/kernel/private_context_inputs.js +7 -3
  217. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -1
  218. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  219. package/dest/kernel/private_kernel_circuit_public_inputs.js +7 -0
  220. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
  221. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
  222. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
  223. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
  224. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
  225. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
  226. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
  227. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
  228. package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
  229. package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
  230. package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
  231. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
  232. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
  233. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
  234. package/dest/kernel/private_kernel_simulated_output.d.ts +7 -1
  235. package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
  236. package/dest/kernel/private_kernel_simulated_output.js +1 -2
  237. package/dest/kernel/private_log_data.d.ts +1 -1
  238. package/dest/kernel/private_log_data.d.ts.map +1 -1
  239. package/dest/kernel/private_log_data.js +1 -1
  240. package/dest/kernel/utils/index.d.ts +2 -1
  241. package/dest/kernel/utils/index.d.ts.map +1 -1
  242. package/dest/kernel/utils/index.js +1 -0
  243. package/dest/kernel/utils/optional_number.d.ts +31 -0
  244. package/dest/kernel/utils/optional_number.d.ts.map +1 -0
  245. package/dest/kernel/utils/optional_number.js +42 -0
  246. package/dest/keys/derivation.d.ts +41 -6
  247. package/dest/keys/derivation.d.ts.map +1 -1
  248. package/dest/keys/derivation.js +49 -26
  249. package/dest/logs/app_tagging_secret.d.ts +30 -7
  250. package/dest/logs/app_tagging_secret.d.ts.map +1 -1
  251. package/dest/logs/app_tagging_secret.js +46 -39
  252. package/dest/logs/app_tagging_secret_kind.js +1 -1
  253. package/dest/logs/contract_class_log.d.ts +1 -2
  254. package/dest/logs/contract_class_log.d.ts.map +1 -1
  255. package/dest/logs/contract_class_log.js +0 -4
  256. package/dest/logs/index.d.ts +1 -3
  257. package/dest/logs/index.d.ts.map +1 -1
  258. package/dest/logs/index.js +0 -2
  259. package/dest/logs/shared_secret_derivation.d.ts +19 -6
  260. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  261. package/dest/logs/shared_secret_derivation.js +26 -11
  262. package/dest/messaging/l1_to_l2_message.d.ts +23 -2
  263. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  264. package/dest/messaging/l1_to_l2_message.js +36 -11
  265. package/dest/p2p/attestation_utils.d.ts +1 -1
  266. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  267. package/dest/p2p/attestation_utils.js +8 -1
  268. package/dest/p2p/checkpoint_attestation.d.ts +10 -1
  269. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  270. package/dest/p2p/checkpoint_attestation.js +10 -0
  271. package/dest/p2p/checkpoint_proposal.d.ts +2 -1
  272. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  273. package/dest/p2p/consensus_payload.d.ts +2 -1
  274. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  275. package/dest/p2p/index.d.ts +2 -1
  276. package/dest/p2p/index.d.ts.map +1 -1
  277. package/dest/p2p/index.js +1 -0
  278. package/dest/p2p/interface.d.ts +5 -0
  279. package/dest/p2p/interface.d.ts.map +1 -0
  280. package/dest/p2p/interface.js +1 -0
  281. package/dest/p2p/signature_utils.d.ts +10 -1
  282. package/dest/p2p/signature_utils.d.ts.map +1 -1
  283. package/dest/p2p/signature_utils.js +9 -1
  284. package/dest/rollup/avm_proof_data.d.ts +3 -3
  285. package/dest/rollup/avm_proof_data.d.ts.map +1 -1
  286. package/dest/rollup/checkpoint_header.d.ts +8 -3
  287. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  288. package/dest/rollup/checkpoint_header.js +20 -10
  289. package/dest/stats/stats.d.ts +2 -2
  290. package/dest/stats/stats.d.ts.map +1 -1
  291. package/dest/tests/factories.d.ts +27 -1
  292. package/dest/tests/factories.d.ts.map +1 -1
  293. package/dest/tests/factories.js +40 -15
  294. package/dest/tests/mocks.d.ts +1 -1
  295. package/dest/tests/mocks.d.ts.map +1 -1
  296. package/dest/tests/mocks.js +3 -2
  297. package/dest/timetable/budgets.d.ts +57 -0
  298. package/dest/timetable/budgets.d.ts.map +1 -0
  299. package/dest/timetable/budgets.js +56 -0
  300. package/dest/timetable/build_proposer_timetable.d.ts +21 -0
  301. package/dest/timetable/build_proposer_timetable.d.ts.map +1 -0
  302. package/dest/timetable/build_proposer_timetable.js +17 -0
  303. package/dest/timetable/consensus_timetable.d.ts +70 -0
  304. package/dest/timetable/consensus_timetable.d.ts.map +1 -0
  305. package/dest/timetable/consensus_timetable.js +89 -0
  306. package/dest/timetable/index.d.ts +5 -84
  307. package/dest/timetable/index.d.ts.map +1 -1
  308. package/dest/timetable/index.js +4 -209
  309. package/dest/timetable/proposer_timetable.d.ts +106 -0
  310. package/dest/timetable/proposer_timetable.d.ts.map +1 -0
  311. package/dest/timetable/proposer_timetable.js +132 -0
  312. package/dest/trees/nullifier_membership_witness.d.ts +5 -8
  313. package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
  314. package/dest/trees/nullifier_membership_witness.js +0 -9
  315. package/dest/trees/public_data_witness.d.ts +7 -17
  316. package/dest/trees/public_data_witness.d.ts.map +1 -1
  317. package/dest/trees/public_data_witness.js +0 -27
  318. package/dest/tx/execution_payload.d.ts +1 -1
  319. package/dest/tx/execution_payload.d.ts.map +1 -1
  320. package/dest/tx/execution_payload.js +1 -1
  321. package/dest/tx/fee_provider.d.ts +2 -2
  322. package/dest/tx/fee_provider.d.ts.map +1 -1
  323. package/dest/tx/global_variable_builder.d.ts +2 -12
  324. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  325. package/dest/tx/global_variables.js +2 -2
  326. package/dest/tx/index.d.ts +2 -1
  327. package/dest/tx/index.d.ts.map +1 -1
  328. package/dest/tx/index.js +1 -0
  329. package/dest/tx/private_tx_constant_data.d.ts +18 -2
  330. package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
  331. package/dest/tx/private_tx_constant_data.js +13 -4
  332. package/dest/tx/simulated_tx.d.ts +10 -6
  333. package/dest/tx/simulated_tx.d.ts.map +1 -1
  334. package/dest/tx/tx.d.ts +9 -1
  335. package/dest/tx/tx.d.ts.map +1 -1
  336. package/dest/tx/tx.js +15 -0
  337. package/dest/tx/validator/empty_validator.d.ts +5 -0
  338. package/dest/tx/validator/empty_validator.d.ts.map +1 -0
  339. package/dest/tx/validator/empty_validator.js +7 -0
  340. package/dest/tx/validator/error_texts.d.ts +2 -2
  341. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  342. package/dest/tx/validator/error_texts.js +1 -1
  343. package/dest/world-state/genesis_data.d.ts +9 -1
  344. package/dest/world-state/genesis_data.d.ts.map +1 -1
  345. package/dest/world-state/genesis_data.js +1 -0
  346. package/dest/world-state/world_state_revision.d.ts +18 -1
  347. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  348. package/dest/world-state/world_state_revision.js +20 -0
  349. package/package.json +8 -8
  350. package/src/abi/buffer.ts +13 -1
  351. package/src/abi/contract_artifact.ts +19 -0
  352. package/src/avm/avm.ts +1 -1
  353. package/src/avm/contract_storage_read.ts +77 -0
  354. package/src/avm/contract_storage_update_request.ts +93 -0
  355. package/src/avm/index.ts +5 -0
  356. package/src/avm/public_call_stack_item_compressed.ts +113 -0
  357. package/src/avm/public_data_update_request.ts +106 -0
  358. package/src/avm/public_inner_call_request.ts +85 -0
  359. package/src/aztec-address/index.ts +36 -6
  360. package/src/block/attestation_info.ts +7 -2
  361. package/src/block/l2_block_source.ts +67 -13
  362. package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +207 -0
  363. package/src/block/l2_block_stream/index.ts +1 -0
  364. package/src/block/l2_block_stream/interfaces.ts +96 -10
  365. package/src/block/l2_block_stream/l2_block_stream.ts +216 -175
  366. package/src/block/l2_block_stream/l2_tips_memory_store.ts +12 -41
  367. package/src/block/l2_block_stream/l2_tips_store_base.ts +84 -93
  368. package/src/block/proposal/attestations_and_signers.ts +53 -7
  369. package/src/block/test/l2_tips_store_test_suite.ts +270 -28
  370. package/src/block/validate_block_result.ts +48 -2
  371. package/src/checkpoint/checkpoint.ts +2 -2
  372. package/src/checkpoint/index.ts +1 -0
  373. package/src/checkpoint/simulation_overrides.ts +171 -0
  374. package/src/checkpoint/validate.ts +16 -6
  375. package/src/config/index.ts +1 -0
  376. package/src/config/network-consensus-config.ts +291 -0
  377. package/src/config/sequencer-config.ts +36 -5
  378. package/src/contract/contract_address.ts +4 -3
  379. package/src/contract/contract_instance.ts +62 -1
  380. package/src/contract/deployment_info.ts +25 -0
  381. package/src/contract/index.ts +1 -0
  382. package/src/contract/interfaces/contract_data_source.ts +2 -4
  383. package/src/contract/interfaces/contract_instance.ts +26 -8
  384. package/src/contract/interfaces/node-info.ts +11 -0
  385. package/src/contract/partial_address.ts +8 -2
  386. package/src/database-version/version_manager.ts +96 -6
  387. package/src/deserialization/index.ts +35 -2
  388. package/src/file-store/factory.ts +7 -0
  389. package/src/file-store/index.ts +1 -0
  390. package/src/file-store/memory.ts +94 -0
  391. package/src/gas/README.md +92 -0
  392. package/src/gas/gas_settings.ts +11 -21
  393. package/src/gas/index.ts +1 -0
  394. package/src/gas/tx_gas_limits.ts +123 -0
  395. package/src/ha-signing/config.ts +23 -5
  396. package/src/ha-signing/local_config.ts +20 -1
  397. package/src/hash/hash.ts +0 -8
  398. package/src/interfaces/archiver.ts +14 -7
  399. package/src/interfaces/aztec-node-admin.ts +1 -1
  400. package/src/interfaces/aztec-node-debug.ts +54 -2
  401. package/src/interfaces/aztec-node.ts +121 -43
  402. package/src/interfaces/block-builder.ts +2 -0
  403. package/src/interfaces/chain_tips.ts +8 -16
  404. package/src/interfaces/checkpoint_parameter.ts +3 -3
  405. package/src/interfaces/client.ts +1 -0
  406. package/src/interfaces/configs.ts +27 -6
  407. package/src/interfaces/get_tx_by_hash_options.ts +14 -0
  408. package/src/interfaces/merkle_tree_operations.ts +2 -9
  409. package/src/interfaces/p2p.ts +29 -9
  410. package/src/interfaces/private_kernel_prover.ts +10 -12
  411. package/src/interfaces/prover-client.ts +1 -3
  412. package/src/interfaces/prover-coordination.ts +17 -0
  413. package/src/interfaces/prover-node.ts +32 -17
  414. package/src/interfaces/proving-job.ts +15 -3
  415. package/src/interfaces/server.ts +1 -1
  416. package/src/interfaces/server_circuit_prover.ts +2 -2
  417. package/src/interfaces/validator.ts +11 -0
  418. package/src/interfaces/world_state.ts +14 -0
  419. package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
  420. package/src/kernel/hints/index.ts +1 -0
  421. package/src/kernel/hints/read_request.ts +1 -1
  422. package/src/kernel/hints/tree_leaf_read_request.ts +35 -0
  423. package/src/kernel/index.ts +1 -1
  424. package/src/kernel/log_hash.ts +5 -2
  425. package/src/kernel/note_hash.ts +1 -1
  426. package/src/kernel/nullifier.ts +1 -1
  427. package/src/kernel/private_circuit_public_inputs.ts +12 -1
  428. package/src/kernel/private_context_inputs.ts +10 -3
  429. package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -0
  430. package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
  431. package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
  432. package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
  433. package/src/kernel/private_kernel_reset_dimensions.ts +15 -5
  434. package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
  435. package/src/kernel/private_kernel_simulated_output.ts +7 -0
  436. package/src/kernel/private_log_data.ts +4 -1
  437. package/src/kernel/utils/index.ts +1 -0
  438. package/src/kernel/utils/optional_number.ts +50 -0
  439. package/src/keys/derivation.ts +69 -24
  440. package/src/logs/app_tagging_secret.ts +62 -39
  441. package/src/logs/app_tagging_secret_kind.ts +1 -1
  442. package/src/logs/contract_class_log.ts +0 -9
  443. package/src/logs/index.ts +0 -2
  444. package/src/logs/shared_secret_derivation.ts +31 -15
  445. package/src/messaging/l1_to_l2_message.ts +51 -13
  446. package/src/p2p/attestation_utils.ts +8 -1
  447. package/src/p2p/checkpoint_attestation.ts +12 -0
  448. package/src/p2p/index.ts +1 -0
  449. package/src/p2p/interface.ts +4 -0
  450. package/src/p2p/signature_utils.ts +9 -0
  451. package/src/rollup/avm_proof_data.ts +2 -2
  452. package/src/rollup/checkpoint_header.ts +16 -2
  453. package/src/stats/stats.ts +2 -2
  454. package/src/tests/factories.ts +51 -13
  455. package/src/tests/mocks.ts +7 -2
  456. package/src/timetable/README.md +609 -0
  457. package/src/timetable/budgets.ts +87 -0
  458. package/src/timetable/build_proposer_timetable.ts +42 -0
  459. package/src/timetable/consensus_timetable.ts +126 -0
  460. package/src/timetable/index.ts +4 -304
  461. package/src/timetable/proposer_timetable.ts +190 -0
  462. package/src/timetable/timetable-example.svg +108 -0
  463. package/src/trees/nullifier_membership_witness.ts +0 -11
  464. package/src/trees/public_data_witness.ts +0 -31
  465. package/src/tx/execution_payload.ts +2 -1
  466. package/src/tx/fee_provider.ts +1 -1
  467. package/src/tx/global_variable_builder.ts +1 -17
  468. package/src/tx/global_variables.ts +2 -2
  469. package/src/tx/index.ts +1 -0
  470. package/src/tx/private_tx_constant_data.ts +25 -2
  471. package/src/tx/tx.ts +17 -0
  472. package/src/tx/validator/empty_validator.ts +7 -0
  473. package/src/tx/validator/error_texts.ts +2 -1
  474. package/src/world-state/genesis_data.ts +10 -0
  475. package/src/world-state/world_state_revision.ts +33 -0
  476. package/dest/interfaces/epoch-prover.d.ts +0 -57
  477. package/dest/interfaces/epoch-prover.d.ts.map +0 -1
  478. package/dest/interfaces/epoch-prover.js +0 -1
  479. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
  480. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
  481. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
  482. package/dest/logs/message_context.d.ts +0 -27
  483. package/dest/logs/message_context.d.ts.map +0 -1
  484. package/dest/logs/message_context.js +0 -74
  485. package/dest/logs/pending_tagged_log.d.ts +0 -13
  486. package/dest/logs/pending_tagged_log.d.ts.map +0 -1
  487. package/dest/logs/pending_tagged_log.js +0 -34
  488. package/src/interfaces/epoch-prover.ts +0 -72
  489. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
  490. package/src/logs/message_context.ts +0 -76
  491. package/src/logs/pending_tagged_log.ts +0 -39
@@ -20,7 +20,11 @@ export declare function bufferAsFields(input: Buffer, targetLength: number): Fr[
20
20
  * bytecode commitment computations to diverge from what the circuit produced.
21
21
  *
22
22
  * @param fields - An output from bufferAsFields: [byteLength, ...payloadFields].
23
+ * @param maxByteLength - Optional upper bound on the declared byte length. When the field array comes
24
+ * from untrusted input (e.g. a gossiped contract-class log), pass the payload capacity so an
25
+ * attacker-declared length cannot force a large `Buffer.alloc` before the value is otherwise
26
+ * rejected. Throws if the declared length exceeds it, before allocating.
23
27
  * @returns A buffer of exactly `byteLength` bytes.
24
28
  */
25
- export declare function bufferFromFields(fields: Fr[]): Buffer;
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYWJpL2J1ZmZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFJcEQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLEdBQUcsRUFBRSxFQUFFLENBY3hFO0FBRUQ7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCx3QkFBZ0IsZ0JBQWdCLENBQUMsTUFBTSxFQUFFLEVBQUUsRUFBRSxHQUFHLE1BQU0sQ0FjckQifQ==
29
+ export declare function bufferFromFields(fields: Fr[], maxByteLength?: number): Buffer;
30
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYWJpL2J1ZmZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFJcEQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLEdBQUcsRUFBRSxFQUFFLENBY3hFO0FBRUQ7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtCRztBQUNILHdCQUFnQixnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsRUFBRSxFQUFFLEVBQUUsYUFBYSxDQUFDLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FzQjdFIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/abi/buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAIpD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE,EAAE,CAcxE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAcrD"}
1
+ {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/abi/buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAIpD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE,EAAE,CAcxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAsB7E"}
@@ -37,10 +37,22 @@ import chunk from 'lodash.chunk';
37
37
  * bytecode commitment computations to diverge from what the circuit produced.
38
38
  *
39
39
  * @param fields - An output from bufferAsFields: [byteLength, ...payloadFields].
40
+ * @param maxByteLength - Optional upper bound on the declared byte length. When the field array comes
41
+ * from untrusted input (e.g. a gossiped contract-class log), pass the payload capacity so an
42
+ * attacker-declared length cannot force a large `Buffer.alloc` before the value is otherwise
43
+ * rejected. Throws if the declared length exceeds it, before allocating.
40
44
  * @returns A buffer of exactly `byteLength` bytes.
41
- */ export function bufferFromFields(fields) {
45
+ */ export function bufferFromFields(fields, maxByteLength) {
46
+ // A valid bufferAsFields output always has at least the leading byte-length field, so an empty
47
+ // input encodes no data. Guard so `length` (the destructured head) is never undefined.
48
+ if (fields.length === 0) {
49
+ return Buffer.alloc(0);
50
+ }
42
51
  const [length, ...payload] = fields;
43
52
  const byteLength = length.toNumber();
53
+ if (maxByteLength !== undefined && byteLength > maxByteLength) {
54
+ throw new Error(`Declared byte length ${byteLength} exceeds maximum ${maxByteLength}`);
55
+ }
44
56
  const raw = Buffer.concat(payload.map((f)=>f.toBuffer().subarray(1)));
45
57
  if (raw.length >= byteLength) {
46
58
  return raw.subarray(0, byteLength);
@@ -19,6 +19,19 @@ export declare function contractArtifactFromBuffer(buffer: Buffer): ContractArti
19
19
  * @returns A valid contract artifact instance.
20
20
  */
21
21
  export declare function loadContractArtifact(input: NoirCompiledContract): ContractArtifact;
22
+ /**
23
+ * Like {@link loadContractArtifact}, but fully validates an already-processed artifact against the
24
+ * contract artifact schema before returning it. Use when loading an artifact from untrusted or
25
+ * external JSON (e.g. a file path passed to the CLI), so a malformed artifact is rejected up-front
26
+ * with a clear schema error instead of surfacing as an opaque failure later during deployment.
27
+ *
28
+ * `loadContractArtifact` only runs the shallow `isContractArtifact` shape check on already-processed
29
+ * artifacts; raw nargo output is validated via `generateContractArtifact` regardless. The returned
30
+ * object is identical to `loadContractArtifact`'s; the schema parse is used purely for validation.
31
+ * @param input - Input object as generated by nargo compile, or an already-processed artifact.
32
+ * @returns A valid contract artifact instance.
33
+ */
34
+ export declare function loadContractArtifactWithValidation(input: NoirCompiledContract): ContractArtifact;
22
35
  /**
23
36
  * Gets nargo build output and returns a valid contract artifact instance.
24
37
  * Differs from loadContractArtifact() by retaining all bytecode.
@@ -33,4 +46,4 @@ type NoirCompiledContractFunction = NoirCompiledContract['functions'][number];
33
46
  */
34
47
  export declare function retainBytecode(input: NoirCompiledContractFunction | FunctionArtifact): boolean;
35
48
  export {};
36
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfYXJ0aWZhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hYmkvY29udHJhY3RfYXJ0a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M,CAAC,CAAC;AAE9E;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,4BAA4B,GAAG,gBAAgB,GAAG,OAAO,CAI9F"}
@@ -33,6 +33,23 @@ import { ARTIFACT_VERSION_BEFORE_INJECTION, ContractArtifactSchema, FunctionType
33
33
  }
34
34
  return generateContractArtifact(input);
35
35
  }
36
+ /**
37
+ * Like {@link loadContractArtifact}, but fully validates an already-processed artifact against the
38
+ * contract artifact schema before returning it. Use when loading an artifact from untrusted or
39
+ * external JSON (e.g. a file path passed to the CLI), so a malformed artifact is rejected up-front
40
+ * with a clear schema error instead of surfacing as an opaque failure later during deployment.
41
+ *
42
+ * `loadContractArtifact` only runs the shallow `isContractArtifact` shape check on already-processed
43
+ * artifacts; raw nargo output is validated via `generateContractArtifact` regardless. The returned
44
+ * object is identical to `loadContractArtifact`'s; the schema parse is used purely for validation.
45
+ * @param input - Input object as generated by nargo compile, or an already-processed artifact.
46
+ * @returns A valid contract artifact instance.
47
+ */ export function loadContractArtifactWithValidation(input) {
48
+ if (isContractArtifact(input)) {
49
+ ContractArtifactSchema.parse(input);
50
+ }
51
+ return loadContractArtifact(input);
52
+ }
36
53
  /**
37
54
  * Gets nargo build output and returns a valid contract artifact instance.
38
55
  * Differs from loadContractArtifact() by retaining all bytecode.
package/dest/avm/avm.js CHANGED
@@ -807,7 +807,7 @@ export class CallStackMetadata {
807
807
  }
808
808
  const { stack, leaf } = failingCall;
809
809
  const aztecCallStack = stack.map((call)=>({
810
- contractAddress: AztecAddress.fromField(call.contractAddress),
810
+ contractAddress: AztecAddress.fromFieldUnsafe(call.contractAddress),
811
811
  functionSelector: call.calldata.length > 0 ? FunctionSelector.fromFieldOrUndefined(call.calldata[0]) : undefined
812
812
  }));
813
813
  // The Noir call stack is the internal call stack at exit of the failing call
@@ -384,28 +384,28 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
384
384
  index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
385
385
  leafPreimage: z.ZodPipe<z.ZodObject<{
386
386
  leaf: z.ZodPipe<z.ZodObject<{
387
- slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
388
- value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
389
- }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
390
- slot: import("@aztec/foundation/schemas").Fr;
391
- value: import("@aztec/foundation/schemas").Fr;
387
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
388
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
389
+ nullifier: import("@aztec/foundation/schemas").Fr;
392
390
  }>>;
393
391
  nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
394
392
  nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
395
- }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeafPreimage, {
396
- leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
393
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
394
+ leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
397
395
  nextKey: import("@aztec/foundation/schemas").Fr;
398
396
  nextIndex: bigint;
399
397
  }>> | z.ZodPipe<z.ZodObject<{
400
398
  leaf: z.ZodPipe<z.ZodObject<{
401
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
402
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
403
- nullifier: import("@aztec/foundation/schemas").Fr;
399
+ slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
400
+ value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
401
+ }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
402
+ slot: import("@aztec/foundation/schemas").Fr;
403
+ value: import("@aztec/foundation/schemas").Fr;
404
404
  }>>;
405
405
  nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
406
406
  nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
407
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
408
- leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
407
+ }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeafPreimage, {
408
+ leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
409
409
  nextKey: import("@aztec/foundation/schemas").Fr;
410
410
  nextIndex: bigint;
411
411
  }>>;
@@ -429,28 +429,28 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
429
429
  index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
430
430
  leafPreimage: z.ZodPipe<z.ZodObject<{
431
431
  leaf: z.ZodPipe<z.ZodObject<{
432
- slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
433
- value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
434
- }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
435
- slot: import("@aztec/foundation/schemas").Fr;
436
- value: import("@aztec/foundation/schemas").Fr;
432
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
433
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
434
+ nullifier: import("@aztec/foundation/schemas").Fr;
437
435
  }>>;
438
436
  nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
439
437
  nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
440
- }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeafPreimage, {
441
- leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
438
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
439
+ leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
442
440
  nextKey: import("@aztec/foundation/schemas").Fr;
443
441
  nextIndex: bigint;
444
442
  }>> | z.ZodPipe<z.ZodObject<{
445
443
  leaf: z.ZodPipe<z.ZodObject<{
446
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
447
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
448
- nullifier: import("@aztec/foundation/schemas").Fr;
444
+ slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
445
+ value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
446
+ }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
447
+ slot: import("@aztec/foundation/schemas").Fr;
448
+ value: import("@aztec/foundation/schemas").Fr;
449
449
  }>>;
450
450
  nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
451
451
  nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
452
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
453
- leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
452
+ }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeafPreimage, {
453
+ leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
454
454
  nextKey: import("@aztec/foundation/schemas").Fr;
455
455
  nextIndex: bigint;
456
456
  }>>;
@@ -497,18 +497,30 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
497
497
  }>>;
498
498
  treeId: z.ZodNumber;
499
499
  leaf: z.ZodPipe<z.ZodObject<{
500
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
501
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
502
+ nullifier: import("@aztec/foundation/schemas").Fr;
503
+ }>> | z.ZodPipe<z.ZodObject<{
500
504
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
501
505
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
502
506
  }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
503
507
  slot: import("@aztec/foundation/schemas").Fr;
504
508
  value: import("@aztec/foundation/schemas").Fr;
505
- }>> | z.ZodPipe<z.ZodObject<{
506
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
507
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
508
- nullifier: import("@aztec/foundation/schemas").Fr;
509
509
  }>>;
510
510
  lowLeavesWitnessData: z.ZodObject<{
511
511
  leaf: z.ZodPipe<z.ZodObject<{
512
+ leaf: z.ZodPipe<z.ZodObject<{
513
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
514
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
515
+ nullifier: import("@aztec/foundation/schemas").Fr;
516
+ }>>;
517
+ nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
518
+ nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
519
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
520
+ leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
521
+ nextKey: import("@aztec/foundation/schemas").Fr;
522
+ nextIndex: bigint;
523
+ }>> | z.ZodPipe<z.ZodObject<{
512
524
  leaf: z.ZodPipe<z.ZodObject<{
513
525
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
514
526
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
@@ -522,7 +534,12 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
522
534
  leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
523
535
  nextKey: import("@aztec/foundation/schemas").Fr;
524
536
  nextIndex: bigint;
525
- }>> | z.ZodPipe<z.ZodObject<{
537
+ }>>;
538
+ index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
539
+ path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
540
+ }, z.core.$strip>;
541
+ insertionWitnessData: z.ZodObject<{
542
+ leaf: z.ZodPipe<z.ZodObject<{
526
543
  leaf: z.ZodPipe<z.ZodObject<{
527
544
  nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
528
545
  }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
@@ -534,12 +551,7 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
534
551
  leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
535
552
  nextKey: import("@aztec/foundation/schemas").Fr;
536
553
  nextIndex: bigint;
537
- }>>;
538
- index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
539
- path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
540
- }, z.core.$strip>;
541
- insertionWitnessData: z.ZodObject<{
542
- leaf: z.ZodPipe<z.ZodObject<{
554
+ }>> | z.ZodPipe<z.ZodObject<{
543
555
  leaf: z.ZodPipe<z.ZodObject<{
544
556
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
545
557
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
@@ -553,18 +565,6 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
553
565
  leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
554
566
  nextKey: import("@aztec/foundation/schemas").Fr;
555
567
  nextIndex: bigint;
556
- }>> | z.ZodPipe<z.ZodObject<{
557
- leaf: z.ZodPipe<z.ZodObject<{
558
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
559
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
560
- nullifier: import("@aztec/foundation/schemas").Fr;
561
- }>>;
562
- nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
563
- nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
564
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
565
- leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
566
- nextKey: import("@aztec/foundation/schemas").Fr;
567
- nextIndex: bigint;
568
568
  }>>;
569
569
  index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
570
570
  path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
@@ -617,18 +617,30 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
617
617
  }>>;
618
618
  treeId: z.ZodNumber;
619
619
  leaf: z.ZodPipe<z.ZodObject<{
620
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
621
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
622
+ nullifier: import("@aztec/foundation/schemas").Fr;
623
+ }>> | z.ZodPipe<z.ZodObject<{
620
624
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
621
625
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
622
626
  }, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
623
627
  slot: import("@aztec/foundation/schemas").Fr;
624
628
  value: import("@aztec/foundation/schemas").Fr;
625
- }>> | z.ZodPipe<z.ZodObject<{
626
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
627
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
628
- nullifier: import("@aztec/foundation/schemas").Fr;
629
629
  }>>;
630
630
  lowLeavesWitnessData: z.ZodObject<{
631
631
  leaf: z.ZodPipe<z.ZodObject<{
632
+ leaf: z.ZodPipe<z.ZodObject<{
633
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
634
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
635
+ nullifier: import("@aztec/foundation/schemas").Fr;
636
+ }>>;
637
+ nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
638
+ nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
639
+ }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
640
+ leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
641
+ nextKey: import("@aztec/foundation/schemas").Fr;
642
+ nextIndex: bigint;
643
+ }>> | z.ZodPipe<z.ZodObject<{
632
644
  leaf: z.ZodPipe<z.ZodObject<{
633
645
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
634
646
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
@@ -642,7 +654,12 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
642
654
  leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
643
655
  nextKey: import("@aztec/foundation/schemas").Fr;
644
656
  nextIndex: bigint;
645
- }>> | z.ZodPipe<z.ZodObject<{
657
+ }>>;
658
+ index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
659
+ path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
660
+ }, z.core.$strip>;
661
+ insertionWitnessData: z.ZodObject<{
662
+ leaf: z.ZodPipe<z.ZodObject<{
646
663
  leaf: z.ZodPipe<z.ZodObject<{
647
664
  nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
648
665
  }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
@@ -654,12 +671,7 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
654
671
  leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
655
672
  nextKey: import("@aztec/foundation/schemas").Fr;
656
673
  nextIndex: bigint;
657
- }>>;
658
- index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
659
- path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
660
- }, z.core.$strip>;
661
- insertionWitnessData: z.ZodObject<{
662
- leaf: z.ZodPipe<z.ZodObject<{
674
+ }>> | z.ZodPipe<z.ZodObject<{
663
675
  leaf: z.ZodPipe<z.ZodObject<{
664
676
  slot: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
665
677
  value: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
@@ -673,18 +685,6 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
673
685
  leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
674
686
  nextKey: import("@aztec/foundation/schemas").Fr;
675
687
  nextIndex: bigint;
676
- }>> | z.ZodPipe<z.ZodObject<{
677
- leaf: z.ZodPipe<z.ZodObject<{
678
- nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
679
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
680
- nullifier: import("@aztec/foundation/schemas").Fr;
681
- }>>;
682
- nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
683
- nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
684
- }, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
685
- leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
686
- nextKey: import("@aztec/foundation/schemas").Fr;
687
- nextIndex: bigint;
688
688
  }>>;
689
689
  index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
690
690
  path: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
@@ -0,0 +1,58 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
+ import type { AztecAddress } from '../aztec-address/index.js';
4
+ /**
5
+ * Contract storage read operation on a specific contract.
6
+ *
7
+ * Note: Similar to `PublicDataRead` but it's from the POV of contract storage so we are not working with public data
8
+ * tree leaf index but storage slot index.
9
+ */
10
+ export declare class ContractStorageRead {
11
+ /**
12
+ * Storage slot we are reading from.
13
+ */
14
+ readonly storageSlot: Fr;
15
+ /**
16
+ * Value read from the storage slot.
17
+ */
18
+ readonly currentValue: Fr;
19
+ /**
20
+ * Side effect counter tracking position of this event in tx execution.
21
+ */
22
+ readonly counter: number;
23
+ /**
24
+ * Contract address whose storage is being read.
25
+ */
26
+ contractAddress?: AztecAddress | undefined;
27
+ constructor(
28
+ /**
29
+ * Storage slot we are reading from.
30
+ */
31
+ storageSlot: Fr,
32
+ /**
33
+ * Value read from the storage slot.
34
+ */
35
+ currentValue: Fr,
36
+ /**
37
+ * Side effect counter tracking position of this event in tx execution.
38
+ */
39
+ counter: number,
40
+ /**
41
+ * Contract address whose storage is being read.
42
+ */
43
+ contractAddress?: AztecAddress | undefined);
44
+ static from(args: {
45
+ storageSlot: Fr;
46
+ currentValue: Fr;
47
+ counter: number;
48
+ contractAddress?: AztecAddress;
49
+ }): ContractStorageRead;
50
+ toBuffer(): Buffer<ArrayBufferLike>;
51
+ static fromBuffer(buffer: Buffer | BufferReader): ContractStorageRead;
52
+ static empty(): ContractStorageRead;
53
+ isEmpty(): boolean;
54
+ toFriendlyJSON(): string;
55
+ toFields(): Fr[];
56
+ static fromFields(fields: Fr[] | FieldReader): ContractStorageRead;
57
+ }
58
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3RvcmFnZV9yZWFkLmQudH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AAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,mBAAmB,CAQjE;CACF"}
@@ -0,0 +1,65 @@
1
+ import { CONTRACT_STORAGE_READ_LENGTH } from '@aztec/constants';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ /**
5
+ * Contract storage read operation on a specific contract.
6
+ *
7
+ * Note: Similar to `PublicDataRead` but it's from the POV of contract storage so we are not working with public data
8
+ * tree leaf index but storage slot index.
9
+ */ export class ContractStorageRead {
10
+ storageSlot;
11
+ currentValue;
12
+ counter;
13
+ contractAddress;
14
+ constructor(/**
15
+ * Storage slot we are reading from.
16
+ */ storageSlot, /**
17
+ * Value read from the storage slot.
18
+ */ currentValue, /**
19
+ * Side effect counter tracking position of this event in tx execution.
20
+ */ counter, /**
21
+ * Contract address whose storage is being read.
22
+ */ contractAddress){
23
+ this.storageSlot = storageSlot;
24
+ this.currentValue = currentValue;
25
+ this.counter = counter;
26
+ this.contractAddress = contractAddress;
27
+ }
28
+ static from(args) {
29
+ return new ContractStorageRead(args.storageSlot, args.currentValue, args.counter, args.contractAddress);
30
+ }
31
+ toBuffer() {
32
+ return serializeToBuffer(this.storageSlot, this.currentValue, new Fr(this.counter));
33
+ }
34
+ static fromBuffer(buffer) {
35
+ const reader = BufferReader.asReader(buffer);
36
+ return new ContractStorageRead(Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader).toNumber());
37
+ }
38
+ static empty() {
39
+ return new ContractStorageRead(Fr.ZERO, Fr.ZERO, 0);
40
+ }
41
+ isEmpty() {
42
+ return this.storageSlot.isZero() && this.currentValue.isZero() && this.counter == 0;
43
+ }
44
+ toFriendlyJSON() {
45
+ return `Slot=${this.storageSlot.toFriendlyJSON()}: ${this.currentValue.toFriendlyJSON()}`;
46
+ }
47
+ toFields() {
48
+ const fields = [
49
+ this.storageSlot,
50
+ this.currentValue,
51
+ new Fr(this.counter)
52
+ ];
53
+ if (fields.length !== CONTRACT_STORAGE_READ_LENGTH) {
54
+ throw new Error(`Invalid number of fields for ContractStorageRead. Expected ${CONTRACT_STORAGE_READ_LENGTH}, got ${fields.length}`);
55
+ }
56
+ return fields;
57
+ }
58
+ static fromFields(fields) {
59
+ const reader = FieldReader.asReader(fields);
60
+ const storageSlot = reader.readField();
61
+ const currentValue = reader.readField();
62
+ const counter = reader.readField().toNumber();
63
+ return new ContractStorageRead(storageSlot, currentValue, counter);
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
+ import type { FieldsOf } from '@aztec/foundation/types';
4
+ import type { AztecAddress } from '../aztec-address/index.js';
5
+ /**
6
+ * Contract storage update request for a slot on a specific contract.
7
+ *
8
+ * Note: Similar to `PublicDataUpdateRequest` but it's from the POV of contract storage so we are not working with
9
+ * public data tree leaf index but storage slot index.
10
+ */
11
+ export declare class ContractStorageUpdateRequest {
12
+ /**
13
+ * Storage slot we are updating.
14
+ */
15
+ readonly storageSlot: Fr;
16
+ /**
17
+ * New value of the storage slot.
18
+ */
19
+ readonly newValue: Fr;
20
+ /**
21
+ * Side effect counter tracking position of this event in tx execution.
22
+ */
23
+ readonly counter: number;
24
+ /**
25
+ * Contract address whose storage is being read.
26
+ */
27
+ contractAddress?: AztecAddress | undefined;
28
+ constructor(
29
+ /**
30
+ * Storage slot we are updating.
31
+ */
32
+ storageSlot: Fr,
33
+ /**
34
+ * New value of the storage slot.
35
+ */
36
+ newValue: Fr,
37
+ /**
38
+ * Side effect counter tracking position of this event in tx execution.
39
+ */
40
+ counter: number,
41
+ /**
42
+ * Contract address whose storage is being read.
43
+ */
44
+ contractAddress?: AztecAddress | undefined);
45
+ toBuffer(): Buffer<ArrayBufferLike>;
46
+ static fromBuffer(buffer: Buffer | BufferReader): ContractStorageUpdateRequest;
47
+ /**
48
+ * Create ContractStorageUpdateRequest from a fields dictionary.
49
+ * @param fields - The dictionary.
50
+ * @returns A ContractStorageUpdateRequest object.
51
+ */
52
+ static from(fields: FieldsOf<ContractStorageUpdateRequest>): ContractStorageUpdateRequest;
53
+ /**
54
+ * Serialize into a field array. Low-level utility.
55
+ * @param fields - Object with fields.
56
+ * @returns The array.
57
+ */
58
+ static getFields(fields: FieldsOf<ContractStorageUpdateRequest>): readonly [Fr, Fr, number, AztecAddress | undefined];
59
+ static empty(): ContractStorageUpdateRequest;
60
+ isEmpty(): boolean;
61
+ toFriendlyJSON(): string;
62
+ toFields(): Fr[];
63
+ static fromFields(fields: Fr[] | FieldReader): ContractStorageUpdateRequest;
64
+ }
65
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3RvcmFnZV91cGRhdGVfcmVxdWVzdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2F2bS9jb250cmFjdF9zdG9yYWdlX3VwZGF0ZV9yZXF1ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsWUFBWSxFQUFFLFdBQVcsRUFBcUIsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRixPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUV4RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUU5RDs7Ozs7R0FLRztBQUNILHFCQUFhLDRCQUE0QjtJQUVyQzs7T0FFRzthQUNhLFdBQVcsRUFBRSxFQUFFO0lBQy9COztPQUVHO2FBQ2EsUUFBUSxFQUFFLEVBQUU7SUFDNUI7O09BRUc7YUFDYSxPQUFPLEVBQUUsTUFBTTtJQUMvQjs7T0FFRztJQU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GAKG;AACH,qBAAa,4BAA4B;IAErC;;OAEG;aACa,WAAW,EAAE,EAAE;IAC/B;;OAEG;aACa,QAAQ,EAAE,EAAE;IAC5B;;OAEG;aACa,OAAO,EAAE,MAAM;IAC/B;;OAEG;IACI,eAAe,CAAC;IAhBzB;IACE;;OAEG;IACa,WAAW,EAAE,EAAE;IAC/B;;OAEG;IACa,QAAQ,EAAE,EAAE;IAC5B;;OAEG;IACa,OAAO,EAAE,MAAM;IAC/B;;OAEG;IACI,eAAe,CAAC,0BAAc,EACnC;IAEJ,QAAQ,4BAEP;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,gCAG9C;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,4BAA4B,CAAC,GAAG,4BAA4B,CAExF;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,4BAA4B,CAAC,uDAE9D;IAED,MAAM,CAAC,KAAK,iCAEX;IAED,OAAO,YAEN;IAED,cAAc,WAIb;IAED,QAAQ,IAAI,EAAE,EAAE,CAQf;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,4BAA4B,CAO1E;CACF"}