@aztec/stdlib 0.0.1-commit.0c875d939 → 0.0.1-commit.0dc957cde

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 (632) hide show
  1. package/dest/abi/abi.d.ts +138 -1
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +10 -2
  4. package/dest/abi/authorization_selector.d.ts +3 -6
  5. package/dest/abi/authorization_selector.d.ts.map +1 -1
  6. package/dest/abi/buffer.d.ts +14 -4
  7. package/dest/abi/buffer.d.ts.map +1 -1
  8. package/dest/abi/buffer.js +25 -4
  9. package/dest/abi/decoder.d.ts +6 -45
  10. package/dest/abi/decoder.d.ts.map +1 -1
  11. package/dest/abi/decoder.js +17 -70
  12. package/dest/abi/encoder.d.ts +1 -1
  13. package/dest/abi/encoder.d.ts.map +1 -1
  14. package/dest/abi/encoder.js +64 -7
  15. package/dest/abi/event_metadata_definition.d.ts +3 -1
  16. package/dest/abi/event_metadata_definition.d.ts.map +1 -1
  17. package/dest/abi/event_metadata_definition.js +1 -1
  18. package/dest/abi/event_selector.d.ts +3 -6
  19. package/dest/abi/event_selector.d.ts.map +1 -1
  20. package/dest/abi/function_selector.d.ts +3 -6
  21. package/dest/abi/function_selector.d.ts.map +1 -1
  22. package/dest/abi/function_selector.js +2 -4
  23. package/dest/abi/function_signature_decoder.d.ts +43 -0
  24. package/dest/abi/function_signature_decoder.d.ts.map +1 -0
  25. package/dest/abi/function_signature_decoder.js +66 -0
  26. package/dest/abi/index.d.ts +2 -1
  27. package/dest/abi/index.d.ts.map +1 -1
  28. package/dest/abi/index.js +1 -0
  29. package/dest/abi/note_selector.d.ts +3 -6
  30. package/dest/abi/note_selector.d.ts.map +1 -1
  31. package/dest/abi/note_selector.js +1 -3
  32. package/dest/abi/selector.d.ts +2 -2
  33. package/dest/abi/selector.d.ts.map +1 -1
  34. package/dest/abi/selector.js +1 -1
  35. package/dest/abi/utils.d.ts +14 -1
  36. package/dest/abi/utils.d.ts.map +1 -1
  37. package/dest/abi/utils.js +15 -0
  38. package/dest/auth_witness/auth_witness.js +3 -3
  39. package/dest/avm/avm.d.ts +300 -300
  40. package/dest/avm/avm_proving_request.d.ts +166 -166
  41. package/dest/avm/revert_code.d.ts +9 -4
  42. package/dest/avm/revert_code.d.ts.map +1 -1
  43. package/dest/avm/revert_code.js +16 -21
  44. package/dest/aztec-address/index.d.ts +3 -6
  45. package/dest/aztec-address/index.d.ts.map +1 -1
  46. package/dest/aztec-address/index.js +2 -4
  47. package/dest/block/block_data.d.ts +52 -0
  48. package/dest/block/block_data.d.ts.map +1 -0
  49. package/dest/block/block_data.js +12 -0
  50. package/dest/block/block_hash.d.ts +11 -10
  51. package/dest/block/block_hash.d.ts.map +1 -1
  52. package/dest/block/block_hash.js +10 -9
  53. package/dest/block/index.d.ts +2 -1
  54. package/dest/block/index.d.ts.map +1 -1
  55. package/dest/block/index.js +1 -0
  56. package/dest/block/l2_block.d.ts +9 -1
  57. package/dest/block/l2_block.d.ts.map +1 -1
  58. package/dest/block/l2_block.js +12 -2
  59. package/dest/block/l2_block_info.d.ts +6 -5
  60. package/dest/block/l2_block_info.d.ts.map +1 -1
  61. package/dest/block/l2_block_info.js +6 -5
  62. package/dest/block/l2_block_source.d.ts +113 -9
  63. package/dest/block/l2_block_source.d.ts.map +1 -1
  64. package/dest/block/l2_block_source.js +1 -0
  65. package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
  66. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  67. package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -1
  68. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  69. package/dest/block/l2_block_stream/l2_block_stream.js +10 -0
  70. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
  71. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  72. package/dest/block/l2_block_stream/l2_tips_store_base.js +18 -5
  73. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  74. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  75. package/dest/block/test/l2_tips_store_test_suite.js +4 -3
  76. package/dest/checkpoint/checkpoint.d.ts +13 -1
  77. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  78. package/dest/checkpoint/checkpoint.js +23 -9
  79. package/dest/checkpoint/checkpoint_data.d.ts +186 -0
  80. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
  81. package/dest/checkpoint/checkpoint_data.js +36 -0
  82. package/dest/checkpoint/index.d.ts +3 -1
  83. package/dest/checkpoint/index.d.ts.map +1 -1
  84. package/dest/checkpoint/index.js +2 -0
  85. package/dest/checkpoint/published_checkpoint.d.ts +11 -2
  86. package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
  87. package/dest/checkpoint/published_checkpoint.js +1 -2
  88. package/dest/checkpoint/validate.d.ts +36 -0
  89. package/dest/checkpoint/validate.d.ts.map +1 -0
  90. package/dest/checkpoint/validate.js +120 -0
  91. package/dest/config/chain-config.d.ts +1 -1
  92. package/dest/config/chain-config.d.ts.map +1 -1
  93. package/dest/config/chain-config.js +7 -1
  94. package/dest/config/index.d.ts +2 -1
  95. package/dest/config/index.d.ts.map +1 -1
  96. package/dest/config/index.js +1 -0
  97. package/dest/config/pipelining-config.d.ts +19 -0
  98. package/dest/config/pipelining-config.d.ts.map +1 -0
  99. package/dest/config/pipelining-config.js +18 -0
  100. package/dest/config/sequencer-config.d.ts +4 -2
  101. package/dest/config/sequencer-config.d.ts.map +1 -1
  102. package/dest/config/sequencer-config.js +20 -1
  103. package/dest/contract/contract_address.d.ts +3 -3
  104. package/dest/contract/contract_address.js +7 -7
  105. package/dest/contract/contract_class.d.ts +2 -3
  106. package/dest/contract/contract_class.d.ts.map +1 -1
  107. package/dest/contract/contract_class_id.d.ts +2 -2
  108. package/dest/contract/contract_class_id.js +5 -5
  109. package/dest/contract/index.d.ts +1 -3
  110. package/dest/contract/index.d.ts.map +1 -1
  111. package/dest/contract/index.js +0 -2
  112. package/dest/contract/interfaces/contract_class.d.ts +3 -156
  113. package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
  114. package/dest/contract/interfaces/contract_class.js +1 -28
  115. package/dest/contract/private_function.d.ts +1 -1
  116. package/dest/contract/private_function.d.ts.map +1 -1
  117. package/dest/contract/private_function.js +4 -6
  118. package/dest/epoch-helpers/index.d.ts +11 -1
  119. package/dest/epoch-helpers/index.d.ts.map +1 -1
  120. package/dest/epoch-helpers/index.js +16 -2
  121. package/dest/file-store/factory.d.ts +4 -3
  122. package/dest/file-store/factory.d.ts.map +1 -1
  123. package/dest/file-store/factory.js +2 -2
  124. package/dest/file-store/http.d.ts +9 -2
  125. package/dest/file-store/http.d.ts.map +1 -1
  126. package/dest/file-store/http.js +20 -9
  127. package/dest/file-store/index.d.ts +2 -1
  128. package/dest/file-store/index.d.ts.map +1 -1
  129. package/dest/file-store/local.d.ts +3 -3
  130. package/dest/file-store/local.d.ts.map +1 -1
  131. package/dest/file-store/local.js +13 -4
  132. package/dest/file-store/s3.d.ts +1 -1
  133. package/dest/file-store/s3.d.ts.map +1 -1
  134. package/dest/file-store/s3.js +11 -3
  135. package/dest/gas/fee_math.d.ts +49 -0
  136. package/dest/gas/fee_math.d.ts.map +1 -0
  137. package/dest/gas/fee_math.js +80 -0
  138. package/dest/gas/gas_fees.d.ts +5 -1
  139. package/dest/gas/gas_fees.d.ts.map +1 -1
  140. package/dest/gas/gas_fees.js +13 -1
  141. package/dest/gas/gas_settings.d.ts +40 -3
  142. package/dest/gas/gas_settings.d.ts.map +1 -1
  143. package/dest/gas/gas_settings.js +50 -6
  144. package/dest/gas/index.d.ts +2 -1
  145. package/dest/gas/index.d.ts.map +1 -1
  146. package/dest/gas/index.js +1 -0
  147. package/dest/ha-signing/config.d.ts +136 -0
  148. package/dest/ha-signing/config.d.ts.map +1 -0
  149. package/dest/ha-signing/config.js +98 -0
  150. package/dest/ha-signing/index.d.ts +4 -0
  151. package/dest/ha-signing/index.d.ts.map +1 -0
  152. package/dest/ha-signing/index.js +3 -0
  153. package/dest/ha-signing/local_config.d.ts +63 -0
  154. package/dest/ha-signing/local_config.d.ts.map +1 -0
  155. package/dest/ha-signing/local_config.js +24 -0
  156. package/dest/ha-signing/types.d.ts +90 -0
  157. package/dest/ha-signing/types.d.ts.map +1 -0
  158. package/dest/ha-signing/types.js +39 -0
  159. package/dest/hash/hash.d.ts +34 -1
  160. package/dest/hash/hash.d.ts.map +1 -1
  161. package/dest/hash/hash.js +72 -11
  162. package/dest/hash/map_slot.js +2 -2
  163. package/dest/interfaces/allowed_element.d.ts +26 -20
  164. package/dest/interfaces/allowed_element.d.ts.map +1 -1
  165. package/dest/interfaces/allowed_element.js +8 -8
  166. package/dest/interfaces/archiver.d.ts +11 -1
  167. package/dest/interfaces/archiver.d.ts.map +1 -1
  168. package/dest/interfaces/archiver.js +13 -3
  169. package/dest/interfaces/aztec-node-admin.d.ts +113 -47
  170. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  171. package/dest/interfaces/aztec-node-admin.js +12 -6
  172. package/dest/interfaces/aztec-node-debug.d.ts +21 -0
  173. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
  174. package/dest/interfaces/aztec-node-debug.js +18 -0
  175. package/dest/interfaces/aztec-node.d.ts +22 -7
  176. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  177. package/dest/interfaces/aztec-node.js +7 -2
  178. package/dest/interfaces/block-builder.d.ts +38 -11
  179. package/dest/interfaces/block-builder.d.ts.map +1 -1
  180. package/dest/interfaces/block-builder.js +13 -6
  181. package/dest/interfaces/client.d.ts +2 -1
  182. package/dest/interfaces/client.d.ts.map +1 -1
  183. package/dest/interfaces/client.js +1 -0
  184. package/dest/interfaces/configs.d.ts +77 -32
  185. package/dest/interfaces/configs.d.ts.map +1 -1
  186. package/dest/interfaces/configs.js +10 -3
  187. package/dest/interfaces/l2_logs_source.d.ts +5 -3
  188. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  189. package/dest/interfaces/merkle_tree_operations.d.ts +13 -22
  190. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  191. package/dest/interfaces/p2p.d.ts +3 -8
  192. package/dest/interfaces/p2p.d.ts.map +1 -1
  193. package/dest/interfaces/prover-client.d.ts +6 -1
  194. package/dest/interfaces/prover-client.d.ts.map +1 -1
  195. package/dest/interfaces/prover-client.js +7 -4
  196. package/dest/interfaces/proving-job.d.ts +200 -200
  197. package/dest/interfaces/slasher.d.ts +1 -10
  198. package/dest/interfaces/slasher.d.ts.map +1 -1
  199. package/dest/interfaces/slasher.js +0 -2
  200. package/dest/interfaces/validator.d.ts +115 -64
  201. package/dest/interfaces/validator.d.ts.map +1 -1
  202. package/dest/interfaces/validator.js +8 -5
  203. package/dest/interfaces/world_state.d.ts +5 -4
  204. package/dest/interfaces/world_state.d.ts.map +1 -1
  205. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +3 -3
  206. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
  207. package/dest/kernel/hints/build_note_hash_read_request_hints.js +13 -10
  208. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
  209. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
  210. package/dest/kernel/hints/build_nullifier_read_request_hints.js +13 -10
  211. package/dest/kernel/hints/build_transient_data_hints.d.ts +5 -2
  212. package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
  213. package/dest/kernel/hints/build_transient_data_hints.js +9 -3
  214. package/dest/kernel/hints/index.d.ts +2 -2
  215. package/dest/kernel/hints/index.js +2 -2
  216. package/dest/kernel/hints/key_validation_request_and_separator.d.ts +24 -0
  217. package/dest/kernel/hints/key_validation_request_and_separator.d.ts.map +1 -0
  218. package/dest/kernel/hints/{key_validation_request_and_generator.js → key_validation_request_and_separator.js} +12 -15
  219. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts → scoped_key_validation_request_and_separator.d.ts} +8 -8
  220. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts.map → scoped_key_validation_request_and_separator.d.ts.map} +1 -1
  221. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.js → scoped_key_validation_request_and_separator.js} +6 -6
  222. package/dest/kernel/private_circuit_public_inputs.d.ts +9 -9
  223. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  224. package/dest/kernel/private_circuit_public_inputs.js +16 -16
  225. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +3 -3
  226. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  227. package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -4
  228. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +3 -3
  229. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
  230. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +4 -4
  231. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -3
  232. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  233. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +11 -7
  234. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +3 -3
  235. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
  236. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -7
  237. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +3 -3
  238. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
  239. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -7
  240. package/dest/kernel/private_validation_requests.d.ts +3 -3
  241. package/dest/kernel/private_validation_requests.js +9 -9
  242. package/dest/keys/derivation.js +8 -8
  243. package/dest/keys/key_types.d.ts +3 -3
  244. package/dest/keys/key_types.d.ts.map +1 -1
  245. package/dest/keys/public_keys.js +2 -2
  246. package/dest/keys/utils.js +5 -5
  247. package/dest/kv-store/config.d.ts +17 -0
  248. package/dest/kv-store/config.d.ts.map +1 -0
  249. package/dest/kv-store/config.js +26 -0
  250. package/dest/kv-store/index.d.ts +2 -0
  251. package/dest/kv-store/index.d.ts.map +1 -0
  252. package/dest/kv-store/index.js +1 -0
  253. package/dest/l1-contracts/index.d.ts +2 -2
  254. package/dest/l1-contracts/index.d.ts.map +1 -1
  255. package/dest/l1-contracts/index.js +1 -1
  256. package/dest/logs/debug_log_store.d.ts +30 -0
  257. package/dest/logs/debug_log_store.d.ts.map +1 -0
  258. package/dest/logs/debug_log_store.js +30 -0
  259. package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
  260. package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
  261. package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +35 -20
  262. package/dest/logs/index.d.ts +4 -2
  263. package/dest/logs/index.d.ts.map +1 -1
  264. package/dest/logs/index.js +3 -1
  265. package/dest/logs/log_filter.d.ts +4 -1
  266. package/dest/logs/log_filter.d.ts.map +1 -1
  267. package/dest/logs/log_filter.js +2 -1
  268. package/dest/logs/log_id.d.ts +1 -1
  269. package/dest/logs/log_id.d.ts.map +1 -1
  270. package/dest/logs/log_id.js +1 -2
  271. package/dest/logs/message_context.d.ts +4 -7
  272. package/dest/logs/message_context.d.ts.map +1 -1
  273. package/dest/logs/message_context.js +23 -9
  274. package/dest/logs/pending_tagged_log.d.ts +2 -3
  275. package/dest/logs/pending_tagged_log.d.ts.map +1 -1
  276. package/dest/logs/pending_tagged_log.js +2 -2
  277. package/dest/logs/pre_tag.d.ts +16 -11
  278. package/dest/logs/pre_tag.d.ts.map +1 -1
  279. package/dest/logs/pre_tag.js +2 -2
  280. package/dest/logs/private_log.d.ts +2 -2
  281. package/dest/logs/private_log.d.ts.map +1 -1
  282. package/dest/logs/public_log.d.ts +4 -3
  283. package/dest/logs/public_log.d.ts.map +1 -1
  284. package/dest/logs/public_log.js +2 -1
  285. package/dest/logs/shared_secret_derivation.d.ts +11 -10
  286. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  287. package/dest/logs/shared_secret_derivation.js +15 -9
  288. package/dest/logs/siloed_tag.d.ts +12 -9
  289. package/dest/logs/siloed_tag.d.ts.map +1 -1
  290. package/dest/logs/siloed_tag.js +15 -2
  291. package/dest/logs/tag.d.ts +5 -6
  292. package/dest/logs/tag.d.ts.map +1 -1
  293. package/dest/logs/tag.js +5 -1
  294. package/dest/logs/tagging_index_range.d.ts +40 -0
  295. package/dest/logs/tagging_index_range.d.ts.map +1 -0
  296. package/dest/logs/tagging_index_range.js +8 -0
  297. package/dest/logs/tx_scoped_l2_log.d.ts +3 -1
  298. package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
  299. package/dest/logs/tx_scoped_l2_log.js +7 -0
  300. package/dest/messaging/l1_to_l2_message.d.ts +3 -2
  301. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  302. package/dest/messaging/l1_to_l2_message.js +11 -13
  303. package/dest/messaging/l1_to_l2_message_source.d.ts +4 -2
  304. package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
  305. package/dest/messaging/l2_to_l1_membership.d.ts +32 -6
  306. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  307. package/dest/messaging/l2_to_l1_membership.js +69 -26
  308. package/dest/noir/index.d.ts +3 -3
  309. package/dest/noir/index.d.ts.map +1 -1
  310. package/dest/note/note_dao.d.ts +1 -1
  311. package/dest/note/note_dao.d.ts.map +1 -1
  312. package/dest/note/note_dao.js +1 -4
  313. package/dest/p2p/attestation_utils.d.ts +11 -1
  314. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  315. package/dest/p2p/attestation_utils.js +45 -0
  316. package/dest/p2p/block_proposal.d.ts +7 -9
  317. package/dest/p2p/block_proposal.d.ts.map +1 -1
  318. package/dest/p2p/block_proposal.js +6 -13
  319. package/dest/p2p/checkpoint_attestation.d.ts +4 -6
  320. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  321. package/dest/p2p/checkpoint_attestation.js +2 -7
  322. package/dest/p2p/checkpoint_proposal.d.ts +9 -16
  323. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  324. package/dest/p2p/checkpoint_proposal.js +6 -35
  325. package/dest/p2p/client_type.d.ts +2 -5
  326. package/dest/p2p/client_type.d.ts.map +1 -1
  327. package/dest/p2p/client_type.js +0 -7
  328. package/dest/p2p/gossipable.d.ts +4 -4
  329. package/dest/p2p/gossipable.d.ts.map +1 -1
  330. package/dest/p2p/index.d.ts +1 -2
  331. package/dest/p2p/index.d.ts.map +1 -1
  332. package/dest/p2p/index.js +0 -1
  333. package/dest/p2p/peer_error.d.ts +3 -1
  334. package/dest/p2p/peer_error.d.ts.map +1 -1
  335. package/dest/p2p/peer_error.js +5 -0
  336. package/dest/p2p/topic_type.d.ts +3 -4
  337. package/dest/p2p/topic_type.d.ts.map +1 -1
  338. package/dest/p2p/topic_type.js +7 -24
  339. package/dest/proofs/chonk_proof.d.ts +46 -2
  340. package/dest/proofs/chonk_proof.d.ts.map +1 -1
  341. package/dest/proofs/chonk_proof.js +85 -10
  342. package/dest/rollup/block_headers_hash.d.ts +1 -1
  343. package/dest/rollup/block_headers_hash.d.ts.map +1 -1
  344. package/dest/rollup/block_headers_hash.js +8 -2
  345. package/dest/rollup/checkpoint_header.d.ts +2 -2
  346. package/dest/rollup/checkpoint_header.js +2 -2
  347. package/dest/slashing/index.d.ts +2 -3
  348. package/dest/slashing/index.d.ts.map +1 -1
  349. package/dest/slashing/index.js +1 -2
  350. package/dest/slashing/serialization.d.ts +2 -6
  351. package/dest/slashing/serialization.d.ts.map +1 -1
  352. package/dest/slashing/serialization.js +0 -60
  353. package/dest/slashing/types.d.ts +4 -90
  354. package/dest/slashing/types.d.ts.map +1 -1
  355. package/dest/slashing/types.js +0 -14
  356. package/dest/slashing/{tally.d.ts → votes.d.ts} +7 -2
  357. package/dest/slashing/votes.d.ts.map +1 -0
  358. package/dest/slashing/{tally.js → votes.js} +30 -2
  359. package/dest/tests/factories.d.ts +5 -10
  360. package/dest/tests/factories.d.ts.map +1 -1
  361. package/dest/tests/factories.js +33 -52
  362. package/dest/tests/mocks.d.ts +5 -3
  363. package/dest/tests/mocks.d.ts.map +1 -1
  364. package/dest/tests/mocks.js +34 -34
  365. package/dest/timetable/index.d.ts +51 -1
  366. package/dest/timetable/index.d.ts.map +1 -1
  367. package/dest/timetable/index.js +204 -14
  368. package/dest/trees/nullifier_leaf.d.ts +2 -1
  369. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  370. package/dest/trees/nullifier_leaf.js +3 -0
  371. package/dest/tx/block_header.d.ts +4 -2
  372. package/dest/tx/block_header.d.ts.map +1 -1
  373. package/dest/tx/block_header.js +7 -3
  374. package/dest/tx/capsule.d.ts +6 -2
  375. package/dest/tx/capsule.d.ts.map +1 -1
  376. package/dest/tx/capsule.js +9 -3
  377. package/dest/tx/fee_provider.d.ts +10 -0
  378. package/dest/tx/fee_provider.d.ts.map +1 -0
  379. package/dest/tx/fee_provider.js +1 -0
  380. package/dest/tx/global_variable_builder.d.ts +3 -4
  381. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  382. package/dest/tx/global_variables.d.ts +4 -4
  383. package/dest/tx/global_variables.d.ts.map +1 -1
  384. package/dest/tx/index.d.ts +2 -1
  385. package/dest/tx/index.d.ts.map +1 -1
  386. package/dest/tx/index.js +1 -0
  387. package/dest/tx/indexed_tx_effect.d.ts +1 -1
  388. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  389. package/dest/tx/indexed_tx_effect.js +1 -2
  390. package/dest/tx/private_execution_result.d.ts +6 -6
  391. package/dest/tx/private_execution_result.d.ts.map +1 -1
  392. package/dest/tx/private_execution_result.js +6 -6
  393. package/dest/tx/profiling.d.ts +17 -5
  394. package/dest/tx/profiling.d.ts.map +1 -1
  395. package/dest/tx/profiling.js +15 -5
  396. package/dest/tx/protocol_contracts.d.ts +1 -1
  397. package/dest/tx/protocol_contracts.d.ts.map +1 -1
  398. package/dest/tx/protocol_contracts.js +2 -2
  399. package/dest/tx/public_simulation_output.d.ts +4 -2
  400. package/dest/tx/public_simulation_output.d.ts.map +1 -1
  401. package/dest/tx/public_simulation_output.js +7 -3
  402. package/dest/tx/simulated_tx.d.ts +116 -5
  403. package/dest/tx/simulated_tx.d.ts.map +1 -1
  404. package/dest/tx/simulated_tx.js +7 -4
  405. package/dest/tx/tx.d.ts +8 -7
  406. package/dest/tx/tx.d.ts.map +1 -1
  407. package/dest/tx/tx.js +18 -6
  408. package/dest/tx/tx_receipt.d.ts +29 -6
  409. package/dest/tx/tx_receipt.d.ts.map +1 -1
  410. package/dest/tx/tx_receipt.js +23 -19
  411. package/dest/tx/tx_request.js +2 -2
  412. package/dest/tx/validator/error_texts.d.ts +10 -2
  413. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  414. package/dest/tx/validator/error_texts.js +11 -1
  415. package/dest/types/shared.d.ts +1 -10
  416. package/dest/types/shared.d.ts.map +1 -1
  417. package/dest/types/shared.js +0 -9
  418. package/dest/update-checker/index.d.ts +3 -2
  419. package/dest/update-checker/index.d.ts.map +1 -1
  420. package/dest/update-checker/index.js +2 -1
  421. package/dest/update-checker/package_version.d.ts +3 -0
  422. package/dest/update-checker/package_version.d.ts.map +1 -0
  423. package/dest/update-checker/package_version.js +24 -0
  424. package/dest/update-checker/version_checker.d.ts +25 -0
  425. package/dest/update-checker/version_checker.d.ts.map +1 -0
  426. package/dest/update-checker/version_checker.js +50 -0
  427. package/dest/validators/errors.d.ts +6 -1
  428. package/dest/validators/errors.d.ts.map +1 -1
  429. package/dest/validators/errors.js +7 -0
  430. package/dest/versioning/versioning.d.ts +4 -2
  431. package/dest/versioning/versioning.d.ts.map +1 -1
  432. package/dest/versioning/versioning.js +4 -1
  433. package/dest/vks/verification_key.d.ts +2 -137
  434. package/dest/vks/verification_key.d.ts.map +1 -1
  435. package/dest/vks/verification_key.js +5 -126
  436. package/dest/world-state/genesis_data.d.ts +11 -0
  437. package/dest/world-state/genesis_data.d.ts.map +1 -0
  438. package/dest/world-state/genesis_data.js +4 -0
  439. package/dest/world-state/index.d.ts +2 -1
  440. package/dest/world-state/index.d.ts.map +1 -1
  441. package/dest/world-state/index.js +1 -0
  442. package/dest/world-state/world_state_revision.d.ts +8 -1
  443. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  444. package/dest/world-state/world_state_revision.js +7 -1
  445. package/package.json +12 -11
  446. package/src/abi/abi.ts +25 -2
  447. package/src/abi/authorization_selector.ts +2 -8
  448. package/src/abi/buffer.ts +25 -4
  449. package/src/abi/decoder.ts +36 -82
  450. package/src/abi/encoder.ts +85 -6
  451. package/src/abi/event_metadata_definition.ts +2 -0
  452. package/src/abi/event_selector.ts +2 -8
  453. package/src/abi/function_selector.ts +4 -13
  454. package/src/abi/function_signature_decoder.ts +77 -0
  455. package/src/abi/index.ts +1 -0
  456. package/src/abi/note_selector.ts +3 -12
  457. package/src/abi/selector.ts +1 -1
  458. package/src/abi/utils.ts +25 -0
  459. package/src/auth_witness/auth_witness.ts +3 -3
  460. package/src/avm/revert_code.ts +26 -25
  461. package/src/aztec-address/index.ts +4 -10
  462. package/src/block/block_data.ts +25 -0
  463. package/src/block/block_hash.ts +21 -14
  464. package/src/block/index.ts +1 -0
  465. package/src/block/l2_block.ts +13 -1
  466. package/src/block/l2_block_info.ts +8 -6
  467. package/src/block/l2_block_source.ts +47 -8
  468. package/src/block/l2_block_stream/interfaces.ts +6 -2
  469. package/src/block/l2_block_stream/l2_block_stream.ts +21 -0
  470. package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
  471. package/src/block/test/l2_tips_store_test_suite.ts +9 -2
  472. package/src/checkpoint/checkpoint.ts +28 -7
  473. package/src/checkpoint/checkpoint_data.ts +87 -0
  474. package/src/checkpoint/index.ts +2 -0
  475. package/src/checkpoint/published_checkpoint.ts +3 -1
  476. package/src/checkpoint/validate.ts +230 -0
  477. package/src/config/chain-config.ts +7 -1
  478. package/src/config/index.ts +1 -0
  479. package/src/config/pipelining-config.ts +31 -0
  480. package/src/config/sequencer-config.ts +30 -2
  481. package/src/contract/contract_address.ts +7 -7
  482. package/src/contract/contract_class.ts +3 -3
  483. package/src/contract/contract_class_id.ts +5 -5
  484. package/src/contract/index.ts +0 -2
  485. package/src/contract/interfaces/contract_class.ts +2 -82
  486. package/src/contract/private_function.ts +5 -3
  487. package/src/epoch-helpers/index.ts +27 -0
  488. package/src/file-store/factory.ts +13 -4
  489. package/src/file-store/http.ts +29 -10
  490. package/src/file-store/index.ts +1 -0
  491. package/src/file-store/local.ts +15 -5
  492. package/src/file-store/s3.ts +12 -3
  493. package/src/gas/README.md +154 -0
  494. package/src/gas/fee_math.ts +120 -0
  495. package/src/gas/gas_fees.ts +20 -1
  496. package/src/gas/gas_settings.ts +65 -12
  497. package/src/gas/index.ts +1 -0
  498. package/src/ha-signing/config.ts +159 -0
  499. package/src/ha-signing/index.ts +29 -0
  500. package/src/ha-signing/local_config.ts +46 -0
  501. package/src/ha-signing/types.ts +126 -0
  502. package/src/hash/hash.ts +72 -11
  503. package/src/hash/map_slot.ts +2 -2
  504. package/src/interfaces/allowed_element.ts +29 -9
  505. package/src/interfaces/archiver.ts +18 -2
  506. package/src/interfaces/aztec-node-admin.ts +28 -7
  507. package/src/interfaces/aztec-node-debug.ts +40 -0
  508. package/src/interfaces/aztec-node.ts +40 -6
  509. package/src/interfaces/block-builder.ts +60 -14
  510. package/src/interfaces/client.ts +1 -0
  511. package/src/interfaces/configs.ts +36 -8
  512. package/src/interfaces/l2_logs_source.ts +4 -1
  513. package/src/interfaces/merkle_tree_operations.ts +12 -21
  514. package/src/interfaces/p2p.ts +2 -13
  515. package/src/interfaces/prover-client.ts +10 -5
  516. package/src/interfaces/slasher.ts +0 -6
  517. package/src/interfaces/validator.ts +62 -37
  518. package/src/interfaces/world_state.ts +4 -3
  519. package/src/kernel/hints/build_note_hash_read_request_hints.ts +14 -18
  520. package/src/kernel/hints/build_nullifier_read_request_hints.ts +15 -18
  521. package/src/kernel/hints/build_transient_data_hints.ts +17 -2
  522. package/src/kernel/hints/index.ts +2 -2
  523. package/src/kernel/hints/{key_validation_request_and_generator.ts → key_validation_request_and_separator.ts} +12 -15
  524. package/src/kernel/hints/{scoped_key_validation_request_and_generator.ts → scoped_key_validation_request_and_separator.ts} +10 -10
  525. package/src/kernel/private_circuit_public_inputs.ts +14 -14
  526. package/src/kernel/private_kernel_circuit_public_inputs.ts +2 -2
  527. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -2
  528. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +14 -5
  529. package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +5 -5
  530. package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +5 -5
  531. package/src/kernel/private_validation_requests.ts +8 -8
  532. package/src/keys/derivation.ts +8 -8
  533. package/src/keys/key_types.ts +6 -2
  534. package/src/keys/public_keys.ts +2 -2
  535. package/src/keys/utils.ts +5 -5
  536. package/src/kv-store/config.ts +36 -0
  537. package/src/kv-store/index.ts +1 -0
  538. package/src/l1-contracts/index.ts +1 -1
  539. package/src/logs/debug_log_store.ts +54 -0
  540. package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +41 -22
  541. package/src/logs/index.ts +3 -1
  542. package/src/logs/log_filter.ts +5 -0
  543. package/src/logs/log_id.ts +1 -2
  544. package/src/logs/message_context.ts +17 -7
  545. package/src/logs/pending_tagged_log.ts +1 -3
  546. package/src/logs/pre_tag.ts +5 -5
  547. package/src/logs/public_log.ts +4 -2
  548. package/src/logs/shared_secret_derivation.ts +21 -10
  549. package/src/logs/siloed_tag.ts +22 -12
  550. package/src/logs/tag.ts +9 -9
  551. package/src/logs/tagging_index_range.ts +24 -0
  552. package/src/logs/tx_scoped_l2_log.ts +16 -0
  553. package/src/messaging/l1_to_l2_message.ts +12 -9
  554. package/src/messaging/l1_to_l2_message_source.ts +3 -1
  555. package/src/messaging/l2_to_l1_membership.ts +98 -33
  556. package/src/noir/index.ts +2 -2
  557. package/src/note/note_dao.ts +1 -4
  558. package/src/p2p/attestation_utils.ts +56 -0
  559. package/src/p2p/block_proposal.ts +14 -12
  560. package/src/p2p/checkpoint_attestation.ts +5 -9
  561. package/src/p2p/checkpoint_proposal.ts +20 -49
  562. package/src/p2p/client_type.ts +0 -6
  563. package/src/p2p/gossipable.ts +4 -4
  564. package/src/p2p/index.ts +0 -1
  565. package/src/p2p/peer_error.ts +7 -0
  566. package/src/p2p/topic_type.ts +8 -15
  567. package/src/proofs/chonk_proof.ts +91 -5
  568. package/src/rollup/block_headers_hash.ts +11 -2
  569. package/src/rollup/checkpoint_header.ts +2 -2
  570. package/src/slashing/index.ts +1 -2
  571. package/src/slashing/serialization.ts +1 -81
  572. package/src/slashing/types.ts +3 -35
  573. package/src/slashing/{tally.ts → votes.ts} +34 -1
  574. package/src/tests/factories.ts +31 -62
  575. package/src/tests/mocks.ts +43 -24
  576. package/src/timetable/index.ts +293 -13
  577. package/src/trees/nullifier_leaf.ts +4 -0
  578. package/src/tx/block_header.ts +10 -4
  579. package/src/tx/capsule.ts +10 -2
  580. package/src/tx/fee_provider.ts +10 -0
  581. package/src/tx/global_variable_builder.ts +2 -3
  582. package/src/tx/global_variables.ts +3 -3
  583. package/src/tx/index.ts +1 -0
  584. package/src/tx/indexed_tx_effect.ts +1 -2
  585. package/src/tx/private_execution_result.ts +5 -5
  586. package/src/tx/profiling.ts +14 -5
  587. package/src/tx/protocol_contracts.ts +2 -2
  588. package/src/tx/public_simulation_output.ts +4 -0
  589. package/src/tx/simulated_tx.ts +14 -3
  590. package/src/tx/tx.ts +22 -13
  591. package/src/tx/tx_receipt.ts +28 -16
  592. package/src/tx/tx_request.ts +2 -2
  593. package/src/tx/validator/error_texts.ts +13 -1
  594. package/src/types/shared.ts +0 -10
  595. package/src/update-checker/index.ts +2 -1
  596. package/src/update-checker/package_version.ts +30 -0
  597. package/src/update-checker/version_checker.ts +65 -0
  598. package/src/validators/errors.ts +9 -0
  599. package/src/versioning/versioning.ts +4 -1
  600. package/src/vks/verification_key.ts +5 -184
  601. package/src/world-state/genesis_data.ts +15 -0
  602. package/src/world-state/index.ts +1 -0
  603. package/src/world-state/world_state_revision.ts +9 -1
  604. package/dest/abi/mocked_keys.d.ts +0 -2
  605. package/dest/abi/mocked_keys.d.ts.map +0 -1
  606. package/dest/abi/mocked_keys.js +0 -1
  607. package/dest/contract/private_function_membership_proof.d.ts +0 -32
  608. package/dest/contract/private_function_membership_proof.d.ts.map +0 -1
  609. package/dest/contract/private_function_membership_proof.js +0 -124
  610. package/dest/contract/utility_function_membership_proof.d.ts +0 -27
  611. package/dest/contract/utility_function_membership_proof.d.ts.map +0 -1
  612. package/dest/contract/utility_function_membership_proof.js +0 -87
  613. package/dest/kernel/hints/key_validation_request_and_generator.d.ts +0 -30
  614. package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +0 -1
  615. package/dest/l1-contracts/slash_factory.d.ts +0 -45
  616. package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
  617. package/dest/l1-contracts/slash_factory.js +0 -158
  618. package/dest/logs/directional_app_tagging_secret.d.ts +0 -40
  619. package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
  620. package/dest/slashing/empire.d.ts +0 -31
  621. package/dest/slashing/empire.d.ts.map +0 -1
  622. package/dest/slashing/empire.js +0 -87
  623. package/dest/slashing/tally.d.ts.map +0 -1
  624. package/dest/update-checker/update-checker.d.ts +0 -49
  625. package/dest/update-checker/update-checker.d.ts.map +0 -1
  626. package/dest/update-checker/update-checker.js +0 -130
  627. package/src/abi/mocked_keys.ts +0 -2
  628. package/src/contract/private_function_membership_proof.ts +0 -167
  629. package/src/contract/utility_function_membership_proof.ts +0 -118
  630. package/src/l1-contracts/slash_factory.ts +0 -180
  631. package/src/slashing/empire.ts +0 -104
  632. package/src/update-checker/update-checker.ts +0 -166
@@ -1,21 +1,41 @@
1
+ import { BarretenbergSync, flattenChonkProofFields } from '@aztec/bb.js';
1
2
  import { CHONK_PROOF_LENGTH } from '@aztec/constants';
2
3
  import { times } from '@aztec/foundation/collection';
3
4
  import { randomBytes } from '@aztec/foundation/crypto/random';
4
5
  import { Fr } from '@aztec/foundation/curves/bn254';
5
6
  import { bufferSchemaFor } from '@aztec/foundation/schemas';
6
- import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
7
+ import { BufferReader, numToUInt32BE, serializeToBuffer } from '@aztec/foundation/serialize';
8
+
9
+ /**
10
+ * Serialization format detection for ChonkProof is size-based:
11
+ * - UNCOMPRESSED (legacy): [field_count=1632: uint32] [fields...] → total ≈ 52KB (>= 40KB)
12
+ * - COMPRESSED: [byte_count: uint32] [compressed_bytes] → total ≈ 35KB (< 40KB)
13
+ *
14
+ * Detection: if the first uint32 equals CHONK_PROOF_LENGTH (1632), it's legacy format
15
+ * (field count). Otherwise, it's compressed format (byte count). The old uncompressed
16
+ * format is never smaller than 40KB; compressed proofs are always smaller than 40KB.
17
+ */
7
18
 
8
19
  // CHONK: "Client Honk" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.
9
20
  export class ChonkProof {
21
+ /**
22
+ * Optional compressed proof bytes from chonk compression (point compression + u256 encoding).
23
+ * When set, toBuffer() will serialize in compressed format (~1.7x smaller).
24
+ * When reading from compressed format, this is populated and fields are decompressed on demand.
25
+ */
26
+ public compressedProof?: Buffer;
27
+
10
28
  constructor(
11
29
  // The proof fields.
12
30
  // For native verification, attach public inputs via `attachPublicInputs(publicInputs)`.
13
31
  // Not using Tuple here due to the length being too high.
14
32
  public fields: Fr[],
33
+ compressedProof?: Buffer,
15
34
  ) {
16
35
  if (fields.length !== CHONK_PROOF_LENGTH) {
17
36
  throw new Error(`Invalid ChonkProof length: ${fields.length}`);
18
37
  }
38
+ this.compressedProof = compressedProof;
19
39
  }
20
40
 
21
41
  public attachPublicInputs(publicInputs: Fr[]) {
@@ -53,19 +73,84 @@ export class ChonkProof {
53
73
  return this.toBuffer();
54
74
  }
55
75
 
76
+ /**
77
+ * Deserialize a ChonkProof from a buffer.
78
+ * Supports both legacy (field elements) and compressed (chonk compression) formats.
79
+ *
80
+ * Size-based format detection:
81
+ * - First uint32 == CHONK_PROOF_LENGTH (1632): legacy format, read field elements
82
+ * Total proof data ≈ 52KB (always >= 40KB)
83
+ * - Otherwise: compressed format, first uint32 is byte count of compressed data
84
+ * Total proof data ≈ 35KB (always < 40KB)
85
+ */
56
86
  static fromBuffer(buffer: Buffer | BufferReader): ChonkProof {
57
87
  const reader = BufferReader.asReader(buffer);
58
- const proofLength = reader.readNumber();
59
- const proof = reader.readArray(proofLength, Fr);
60
- return new ChonkProof(proof);
88
+ const firstUint32 = reader.readNumber();
89
+
90
+ if (firstUint32 === CHONK_PROOF_LENGTH) {
91
+ // Legacy format: firstUint32 is the field count (1632)
92
+ // Widen to `number` to prevent TS from narrowing to literal 1632,
93
+ // which would cause Tuple<Fr, 1632> to exceed the recursion limit.
94
+ const fieldCount: number = firstUint32;
95
+ const proof = reader.readArray(fieldCount, Fr);
96
+ return new ChonkProof(proof);
97
+ }
98
+
99
+ // Compressed format: firstUint32 is the compressed byte count
100
+ const compressedBytes = reader.readBytes(firstUint32);
101
+ return ChonkProof.fromCompressedBytes(Buffer.from(compressedBytes));
102
+ }
103
+
104
+ /**
105
+ * Create a ChonkProof from compressed bytes by decompressing via the BarretenbergSync API.
106
+ * The compressed format uses point compression and u256 encoding (from PR #20645).
107
+ *
108
+ * @param compressed - Compressed proof bytes from chonk compression
109
+ * @returns ChonkProof with both fields and compressed bytes populated
110
+ */
111
+ static fromCompressedBytes(compressed: Buffer): ChonkProof {
112
+ const api = BarretenbergSync.getSingleton();
113
+ const result = api.chonkDecompressProof({ compressedProof: new Uint8Array(compressed) });
114
+
115
+ // Flatten the structured bb.js ChonkProof into flat Fr[] field elements
116
+ const flatFields = flattenChonkProofFields(result.proof);
117
+ const fields = flatFields.map(f => Fr.fromBuffer(Buffer.from(f)));
118
+
119
+ // The decompressed proof includes public inputs in hidingOinkProof.
120
+ // Since ChonkProof stores fields WITHOUT public inputs, strip them.
121
+ // The number of public inputs = total fields - CHONK_PROOF_LENGTH
122
+ if (fields.length > CHONK_PROOF_LENGTH) {
123
+ const numPubInputs = fields.length - CHONK_PROOF_LENGTH;
124
+ const proofFields = fields.slice(numPubInputs);
125
+ return new ChonkProof(proofFields, compressed);
126
+ }
127
+
128
+ return new ChonkProof(fields, compressed);
61
129
  }
62
130
 
131
+ /**
132
+ * Serialize the proof to a buffer.
133
+ * If compressed bytes are available, uses the compressed format (~1.7x smaller).
134
+ * Otherwise falls back to legacy field element format.
135
+ */
63
136
  public toBuffer() {
137
+ if (this.compressedProof) {
138
+ // Compressed format: [compressed_byte_count: uint32] [compressed_bytes]
139
+ return Buffer.concat([numToUInt32BE(this.compressedProof.length), this.compressedProof]);
140
+ }
141
+ // Legacy format: [field_count=1632: uint32] [fields...]
64
142
  return serializeToBuffer(this.fields.length, this.fields);
65
143
  }
66
144
  }
67
145
 
68
146
  export class ChonkProofWithPublicInputs {
147
+ /**
148
+ * Optional compressed proof bytes (covers the full proof WITH public inputs).
149
+ * Set by the prover when using chonk compression. Flows through to ChonkProof
150
+ * via removePublicInputs() so the Tx can serialize in compressed format.
151
+ */
152
+ public compressedProof?: Buffer;
153
+
69
154
  constructor(
70
155
  // The proof fields with public inputs.
71
156
  // For recursive verification, use without public inputs via `removePublicInputs()`.
@@ -83,7 +168,8 @@ export class ChonkProofWithPublicInputs {
83
168
 
84
169
  public removePublicInputs() {
85
170
  const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
86
- return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs));
171
+ // Flow compressed proof bytes through so the ChonkProof can serialize efficiently
172
+ return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs), this.compressedProof);
87
173
  }
88
174
 
89
175
  public isEmpty() {
@@ -1,5 +1,7 @@
1
+ import { DomainSeparator } from '@aztec/constants';
2
+ import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
1
3
  import { Fr } from '@aztec/foundation/curves/bn254';
2
- import { computeUnbalancedPoseidonRoot } from '@aztec/foundation/trees';
4
+ import { computeUnbalancedMerkleTreeRootAsync } from '@aztec/foundation/trees';
3
5
 
4
6
  import type { BlockHeader } from '../tx/block_header.js';
5
7
 
@@ -7,6 +9,13 @@ export async function computeBlockHeadersHash(blockHeaders: BlockHeader[]): Prom
7
9
  const blockHeaderHashes = await Promise.all(blockHeaders.map(header => header.hash()));
8
10
  // Must match the implementation in merge_block_rollups.nr, with the **unbalanced** rollup structure
9
11
  // (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
10
- const blockHeadersHash = await computeUnbalancedPoseidonRoot(blockHeaderHashes.map(hash => hash.toBuffer()));
12
+ const blockHeadersHasher = async (left: Uint8Array, right: Uint8Array) =>
13
+ (
14
+ await poseidon2HashWithSeparator([Buffer.from(left), Buffer.from(right)], DomainSeparator.BLOCK_HEADERS_HASH)
15
+ ).toBuffer() as Buffer<ArrayBuffer>;
16
+ const blockHeadersHash = await computeUnbalancedMerkleTreeRootAsync(
17
+ blockHeaderHashes.map(hash => hash.toBuffer()),
18
+ blockHeadersHasher,
19
+ );
11
20
  return Fr.fromBuffer(blockHeadersHash);
12
21
  }
@@ -19,8 +19,8 @@ import type { UInt64 } from '../types/shared.js';
19
19
 
20
20
  /**
21
21
  * Header of a checkpoint. A checkpoint is a collection of blocks submitted to L1 all within the same slot.
22
- * TODO(palla/mbps): Should this include chainId and version as well? Is this used just in circuits?
23
- * TODO(palla/mbps): What about CheckpointNumber?
22
+ * This header is verified as-is in the rollup circuits, posted to the L1 rollup contract, stored in the archiver,
23
+ * and exposed via the Aztec Node API. See `CheckpointData` for a struct that includes the header plus extra metadata.
24
24
  */
25
25
  export class CheckpointHeader {
26
26
  constructor(
@@ -1,6 +1,5 @@
1
1
  export * from './types.js';
2
2
  export * from './interfaces.js';
3
3
  export * from './helpers.js';
4
- export * from './empire.js';
5
- export * from './tally.js';
4
+ export * from './votes.js';
6
5
  export * from './serialization.js';
@@ -1,15 +1,7 @@
1
- import { times } from '@aztec/foundation/collection';
2
1
  import { EthAddress } from '@aztec/foundation/eth-address';
3
2
  import { BufferReader, bigintToUInt64BE, bigintToUInt128BE, serializeToBuffer } from '@aztec/foundation/serialize';
4
3
 
5
- import type {
6
- Offense,
7
- OffenseType,
8
- SlashPayload,
9
- SlashPayloadRound,
10
- ValidatorSlash,
11
- ValidatorSlashOffense,
12
- } from './types.js';
4
+ import type { Offense, OffenseType } from './types.js';
13
5
 
14
6
  export function serializeOffense(offense: Offense): Buffer {
15
7
  return serializeToBuffer(
@@ -29,75 +21,3 @@ export function deserializeOffense(buffer: Buffer): Offense {
29
21
 
30
22
  return { validator, amount, offenseType: offense, epochOrSlot };
31
23
  }
32
-
33
- function serializeValidatorSlashOffense(offense: ValidatorSlashOffense): Buffer {
34
- return serializeToBuffer(bigintToUInt64BE(offense.epochOrSlot), offense.offenseType);
35
- }
36
-
37
- function deserializeValidatorSlashOffense(buffer: Buffer | BufferReader): ValidatorSlashOffense {
38
- const reader = BufferReader.asReader(buffer);
39
- return {
40
- epochOrSlot: reader.readUInt64(),
41
- offenseType: reader.readNumber() as OffenseType,
42
- };
43
- }
44
-
45
- function serializeValidatorSlash(slash: ValidatorSlash): Buffer {
46
- return serializeToBuffer(
47
- slash.validator,
48
- bigintToUInt128BE(slash.amount),
49
- slash.offenses.length,
50
- slash.offenses.map(serializeValidatorSlashOffense),
51
- );
52
- }
53
-
54
- function deserializeValidatorSlash(buffer: Buffer | BufferReader): ValidatorSlash {
55
- const reader = BufferReader.asReader(buffer);
56
- const validator = reader.readObject(EthAddress);
57
- const amount = reader.readUInt128();
58
- const offensesCount = reader.readNumber();
59
- const offenses = times(offensesCount, () => deserializeValidatorSlashOffense(reader));
60
-
61
- return { validator, amount, offenses };
62
- }
63
-
64
- export function serializeSlashPayload(payload: SlashPayload): Buffer {
65
- return serializeToBuffer(
66
- payload.address,
67
- payload.slashes.length,
68
- payload.slashes.map(serializeValidatorSlash),
69
- bigintToUInt64BE(payload.timestamp),
70
- );
71
- }
72
-
73
- export function deserializeSlashPayload(buffer: Buffer): SlashPayload {
74
- const reader = BufferReader.asReader(buffer);
75
- const address = reader.readObject(EthAddress);
76
- const slashesCount = reader.readNumber();
77
- const slashes = times(slashesCount, () => deserializeValidatorSlash(reader));
78
- const timestamp = reader.readUInt64();
79
- return { address, slashes, timestamp };
80
- }
81
-
82
- export function serializeSlashPayloadRound(payload: SlashPayloadRound): Buffer {
83
- return serializeToBuffer(
84
- payload.address,
85
- payload.slashes.length,
86
- payload.slashes.map(serializeValidatorSlash),
87
- bigintToUInt64BE(payload.timestamp),
88
- Number(payload.votes),
89
- bigintToUInt64BE(payload.round),
90
- );
91
- }
92
-
93
- export function deserializeSlashPayloadRound(buffer: Buffer): SlashPayloadRound {
94
- const reader = BufferReader.asReader(buffer);
95
- const address = reader.readObject(EthAddress);
96
- const slashesCount = reader.readNumber();
97
- const slashes = times(slashesCount, () => deserializeValidatorSlash(reader));
98
- const timestamp = reader.readUInt64();
99
- const votes = BigInt(reader.readNumber());
100
- const round = reader.readUInt64();
101
-
102
- return { address, slashes, timestamp, votes, round };
103
- }
@@ -126,45 +126,13 @@ export type ValidatorSlash = {
126
126
  offenses: ValidatorSlashOffense[];
127
127
  };
128
128
 
129
- /** Slash payload as published by the empire slash proposer */
130
- export type SlashPayload = {
131
- address: EthAddress;
132
- slashes: ValidatorSlash[];
133
- timestamp: bigint;
134
- };
135
-
136
- /** Slash payload with round information from empire slash proposer */
137
- export type SlashPayloadRound = SlashPayload & { votes: bigint; round: bigint };
138
-
139
- export const SlashPayloadRoundSchema = zodFor<SlashPayloadRound>()(
140
- z.object({
141
- address: schemas.EthAddress,
142
- timestamp: schemas.BigInt,
143
- votes: schemas.BigInt,
144
- round: schemas.BigInt,
145
- slashes: z.array(
146
- z.object({
147
- validator: schemas.EthAddress,
148
- amount: schemas.BigInt,
149
- offenses: z.array(z.object({ offenseType: OffenseTypeSchema, epochOrSlot: schemas.BigInt })),
150
- }),
151
- ),
152
- }),
153
- );
154
-
155
- /** Votes for a validator slash in the consensus slash proposer */
129
+ /** Votes for a validator slash in the slashing proposer */
156
130
  export type ValidatorSlashVote = number;
157
131
 
158
132
  export type ProposerSlashAction =
159
- /** Create a new slash payload on an empire-based slash proposer */
160
- | { type: 'create-empire-payload'; data: ValidatorSlash[] }
161
- /** Vote for a slashing payload on an empire-based slash proposer */
162
- | { type: 'vote-empire-payload'; payload: EthAddress }
163
- /** Execute a slashing payload on an empire-based slash proposer */
164
- | { type: 'execute-empire-payload'; round: bigint }
165
- /** Vote for offenses on a consensus slashing proposer */
133
+ /** Vote for offenses on the slashing proposer */
166
134
  | { type: 'vote-offenses'; votes: ValidatorSlashVote[]; committees: EthAddress[][]; round: bigint }
167
- /** Execute a slashing round on a consensus slashing proposer */
135
+ /** Execute a slashing round on the slashing proposer */
168
136
  | { type: 'execute-slash'; committees: EthAddress[][]; round: bigint };
169
137
 
170
138
  export type ProposerSlashActionType = ProposerSlashAction['type'];
@@ -1,6 +1,7 @@
1
1
  import { sumBigint } from '@aztec/foundation/bigint';
2
2
  import { padArrayEnd } from '@aztec/foundation/collection';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
+ import { type Logger, createLogger } from '@aztec/foundation/log';
4
5
  import type { PartialBy } from '@aztec/foundation/types';
5
6
 
6
7
  import { getEpochForOffense } from './helpers.js';
@@ -12,6 +13,9 @@ import type { Offense, ValidatorSlashVote } from './types.js';
12
13
  * @param committees - Array of committees (each containing array of validator addresses)
13
14
  * @param epochsForCommittees - Array of epochs corresponding to each committee
14
15
  * @param settings - Settings including slashingAmounts and optional validator override lists
16
+ * @param settings.maxSlashedValidators - If set, limits the total number of [validator, epoch] pairs
17
+ * with non-zero votes. The lowest-vote pairs are zeroed out to stay within the limit.
18
+ * @param logger - Logger, logs which validators were dropped.
15
19
  * @returns Array of ValidatorSlashVote, where each vote is how many slash units the validator in that position should be slashed
16
20
  */
17
21
  export function getSlashConsensusVotesFromOffenses(
@@ -22,9 +26,11 @@ export function getSlashConsensusVotesFromOffenses(
22
26
  slashingAmounts: [bigint, bigint, bigint];
23
27
  epochDuration: number;
24
28
  targetCommitteeSize: number;
29
+ maxSlashedValidators?: number;
25
30
  },
31
+ logger: Logger = createLogger('slasher:votes'),
26
32
  ): ValidatorSlashVote[] {
27
- const { slashingAmounts, targetCommitteeSize } = settings;
33
+ const { slashingAmounts, targetCommitteeSize, maxSlashedValidators } = settings;
28
34
 
29
35
  if (committees.length !== epochsForCommittees.length) {
30
36
  throw new Error('committees and epochsForCommittees must have the same length');
@@ -53,6 +59,33 @@ export function getSlashConsensusVotesFromOffenses(
53
59
  return padArrayEnd(votes, 0, targetCommitteeSize);
54
60
  });
55
61
 
62
+ // if a cap is set, zero out the lowest-vote [validator, epoch] pairs so that the most severe slashes stay.
63
+ if (maxSlashedValidators === undefined) {
64
+ return votes;
65
+ }
66
+
67
+ const nonZeroByDescendingVote = [...votes.entries()].filter(([, vote]) => vote > 0).sort(([, a], [, b]) => b - a);
68
+
69
+ const toTruncate = nonZeroByDescendingVote.slice(maxSlashedValidators);
70
+ for (const [idx] of toTruncate) {
71
+ votes[idx] = 0;
72
+ }
73
+
74
+ if (toTruncate.length > 0) {
75
+ const truncated = toTruncate.map(([idx]) => {
76
+ const committeeIndex = Math.floor(idx / targetCommitteeSize);
77
+ const positionInCommittee = idx % targetCommitteeSize;
78
+ return {
79
+ validator: committees[committeeIndex][positionInCommittee].toString(),
80
+ epoch: epochsForCommittees[committeeIndex],
81
+ };
82
+ });
83
+ logger.warn(
84
+ `Truncated ${toTruncate.length} validator-epoch pairs to stay within limit of ${maxSlashedValidators}`,
85
+ { truncated },
86
+ );
87
+ }
88
+
56
89
  return votes;
57
90
  }
58
91
 
@@ -9,7 +9,6 @@ import {
9
9
  AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
10
10
  CHONK_PROOF_LENGTH,
11
11
  CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
12
- GeneratorIndex,
13
12
  L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
14
13
  MAX_CHECKPOINTS_PER_EPOCH,
15
14
  MAX_CONTRACT_CLASS_LOGS_PER_TX,
@@ -46,7 +45,6 @@ import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
46
45
  import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
47
46
  import { compact } from '@aztec/foundation/collection';
48
47
  import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
49
- import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
50
48
  import { SchnorrSignature } from '@aztec/foundation/crypto/schnorr';
51
49
  import { sha256 } from '@aztec/foundation/crypto/sha256';
52
50
  import { Fq, Fr } from '@aztec/foundation/curves/bn254';
@@ -92,17 +90,16 @@ import {
92
90
  type ContractClassPublic,
93
91
  ContractDeploymentData,
94
92
  type ContractInstanceWithAddress,
95
- type ExecutablePrivateFunctionWithMembershipProof,
96
93
  type PrivateFunction,
97
94
  SerializableContractInstance,
98
- type UtilityFunctionWithMembershipProof,
99
95
  computeContractClassId,
96
+ computePartialAddress,
100
97
  computePublicBytecodeCommitment,
101
98
  } from '../contract/index.js';
102
99
  import { Gas, GasFees, GasSettings } from '../gas/index.js';
103
100
  import { computeCalldataHash } from '../hash/hash.js';
104
101
  import { KeyValidationRequest } from '../kernel/hints/key_validation_request.js';
105
- import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
102
+ import { KeyValidationRequestAndSeparator } from '../kernel/hints/key_validation_request_and_separator.js';
106
103
  import { ReadRequest, ScopedReadRequest } from '../kernel/hints/read_request.js';
107
104
  import {
108
105
  ClaimedLengthArray,
@@ -128,6 +125,7 @@ import {
128
125
  PublicCallRequestArrayLengths,
129
126
  } from '../kernel/public_call_request.js';
130
127
  import { PublicKeys, computeAddress } from '../keys/index.js';
128
+ import { ExtendedDirectionalAppTaggingSecret } from '../logs/extended_directional_app_tagging_secret.js';
131
129
  import { ContractClassLog, ContractClassLogFields } from '../logs/index.js';
132
130
  import { PrivateLog } from '../logs/private_log.js';
133
131
  import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
@@ -177,7 +175,7 @@ import { TxHash } from '../tx/tx_hash.js';
177
175
  import { TxRequest } from '../tx/tx_request.js';
178
176
  import { Vector } from '../types/index.js';
179
177
  import { VkData } from '../vks/index.js';
180
- import { VerificationKey, VerificationKeyAsFields, VerificationKeyData } from '../vks/verification_key.js';
178
+ import { VerificationKeyAsFields, VerificationKeyData } from '../vks/verification_key.js';
181
179
 
182
180
  /**
183
181
  * Creates an arbitrary side effect object with the given seed.
@@ -233,7 +231,7 @@ export function makeTxContext(seed: number = 1): TxContext {
233
231
  * Creates a default instance of gas settings. No seed value is used to ensure we allocate a sensible amount of gas for testing.
234
232
  */
235
233
  export function makeGasSettings() {
236
- return GasSettings.default({ maxFeesPerGas: new GasFees(10, 10) });
234
+ return GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) });
237
235
  }
238
236
 
239
237
  /**
@@ -259,12 +257,12 @@ function makeKeyValidationRequests(seed: number): KeyValidationRequest {
259
257
  }
260
258
 
261
259
  /**
262
- * Creates arbitrary KeyValidationRequestAndGenerator from the given seed.
263
- * @param seed - The seed to use for generating the KeyValidationRequestAndGenerator.
264
- * @returns A KeyValidationRequestAndGenerator.
260
+ * Creates arbitrary KeyValidationRequestAndSeparator from the given seed.
261
+ * @param seed - The seed to use for generating the KeyValidationRequestAndSeparator.
262
+ * @returns A KeyValidationRequestAndSeparator.
265
263
  */
266
- function makeKeyValidationRequestAndGenerators(seed: number): KeyValidationRequestAndGenerator {
267
- return new KeyValidationRequestAndGenerator(makeKeyValidationRequests(seed), fr(seed + 4));
264
+ function makeKeyValidationRequestAndSeparators(seed: number): KeyValidationRequestAndSeparator {
265
+ return new KeyValidationRequestAndSeparator(makeKeyValidationRequests(seed), fr(seed + 4));
268
266
  }
269
267
 
270
268
  export function makePublicDataWrite(seed = 1) {
@@ -574,14 +572,6 @@ export function makeVerificationKeyAsFields(size: number): VerificationKeyAsFiel
574
572
  return VerificationKeyAsFields.makeFake(size);
575
573
  }
576
574
 
577
- /**
578
- * Creates arbitrary/mocked verification key.
579
- * @returns A verification key object
580
- */
581
- export function makeVerificationKey(): VerificationKey {
582
- return VerificationKey.makeFake();
583
- }
584
-
585
575
  /**
586
576
  * Creates an arbitrary point in a curve.
587
577
  * @param seed - Seed to generate the point values.
@@ -656,7 +646,7 @@ function makeClaimedLengthArray<T extends Serializable, N extends number>(
656
646
  */
657
647
  export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicInputs {
658
648
  return PrivateCircuitPublicInputs.from({
659
- includeByTimestamp: BigInt(seed + 0x31415),
649
+ expirationTimestamp: BigInt(seed + 0x31415),
660
650
  callContext: makeCallContext(seed, { isStaticCall: true }),
661
651
  argsHash: fr(seed + 0x100),
662
652
  returnsHash: fr(seed + 0x200),
@@ -671,9 +661,9 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
671
661
  makeScopedReadRequest,
672
662
  seed + 0x310,
673
663
  ),
674
- keyValidationRequestsAndGenerators: makeClaimedLengthArray(
664
+ keyValidationRequestsAndSeparators: makeClaimedLengthArray(
675
665
  MAX_KEY_VALIDATION_REQUESTS_PER_CALL,
676
- makeKeyValidationRequestAndGenerators,
666
+ makeKeyValidationRequestAndSeparators,
677
667
  seed + 0x320,
678
668
  ),
679
669
  noteHashes: makeClaimedLengthArray(MAX_NOTE_HASHES_PER_CALL, makeNoteHash, seed + 0x400),
@@ -1182,35 +1172,6 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
1182
1172
  });
1183
1173
  }
1184
1174
 
1185
- export function makeExecutablePrivateFunctionWithMembershipProof(
1186
- seed = 0,
1187
- ): ExecutablePrivateFunctionWithMembershipProof {
1188
- return {
1189
- selector: makeSelector(seed),
1190
- bytecode: makeBytes(100, seed + 1),
1191
- artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
1192
- artifactTreeLeafIndex: seed + 2,
1193
- privateFunctionTreeSiblingPath: makeTuple(3, fr, seed + 3),
1194
- privateFunctionTreeLeafIndex: seed + 3,
1195
- artifactMetadataHash: fr(seed + 4),
1196
- functionMetadataHash: fr(seed + 5),
1197
- utilityFunctionsTreeRoot: fr(seed + 6),
1198
- vkHash: fr(seed + 7),
1199
- };
1200
- }
1201
-
1202
- export function makeUtilityFunctionWithMembershipProof(seed = 0): UtilityFunctionWithMembershipProof {
1203
- return {
1204
- selector: makeSelector(seed),
1205
- bytecode: makeBytes(100, seed + 1),
1206
- artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
1207
- artifactTreeLeafIndex: seed + 2,
1208
- artifactMetadataHash: fr(seed + 4),
1209
- functionMetadataHash: fr(seed + 5),
1210
- privateFunctionsArtifactTreeRoot: fr(seed + 6),
1211
- };
1212
- }
1213
-
1214
1175
  export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer): Promise<ContractClassPublic> {
1215
1176
  const artifactHash = fr(seed + 1);
1216
1177
  const privateFunctionsRoot = fr(seed + 3);
@@ -1222,8 +1183,6 @@ export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer)
1222
1183
  artifactHash,
1223
1184
  packedBytecode,
1224
1185
  privateFunctionsRoot,
1225
- privateFunctions: [],
1226
- utilityFunctions: [],
1227
1186
  version: 1,
1228
1187
  };
1229
1188
  }
@@ -1285,14 +1244,12 @@ export async function makeContractInstanceFromClassId(
1285
1244
  const deployer = overrides?.deployer ?? new AztecAddress(new Fr(seed + 2));
1286
1245
  const publicKeys = overrides?.publicKeys ?? (await makePublicKeys(seed + 3));
1287
1246
 
1288
- const saltedInitializationHash = await poseidon2HashWithSeparator(
1289
- [salt, initializationHash, deployer],
1290
- GeneratorIndex.PARTIAL_ADDRESS,
1291
- );
1292
- const partialAddress = await poseidon2HashWithSeparator(
1293
- [classId, saltedInitializationHash],
1294
- GeneratorIndex.PARTIAL_ADDRESS,
1295
- );
1247
+ const partialAddress = await computePartialAddress({
1248
+ originalContractClassId: classId,
1249
+ salt,
1250
+ initializationHash,
1251
+ deployer,
1252
+ });
1296
1253
  const address = await computeAddress(publicKeys, partialAddress);
1297
1254
  return new SerializableContractInstance({
1298
1255
  version: 1,
@@ -1747,6 +1704,10 @@ export function makeL2Tips(
1747
1704
  block: { number: bn, hash },
1748
1705
  checkpoint: { number: cpn, hash: cph },
1749
1706
  },
1707
+ proposedCheckpoint: {
1708
+ block: { number: bn, hash },
1709
+ checkpoint: { number: cpn, hash: cph },
1710
+ },
1750
1711
  proven: {
1751
1712
  block: { number: bn, hash },
1752
1713
  checkpoint: { number: cpn, hash: cph },
@@ -1757,3 +1718,11 @@ export function makeL2Tips(
1757
1718
  },
1758
1719
  };
1759
1720
  }
1721
+
1722
+ export async function randomExtendedDirectionalAppTaggingSecret(): Promise<ExtendedDirectionalAppTaggingSecret> {
1723
+ const resolvedApp = await AztecAddress.random();
1724
+ // Using the fromString method like this is messy as it leaks the underlying serialization format but I don't want to
1725
+ // expose the type's constructor just for tests since in prod the secret is always constructed via compute. Also this
1726
+ // method is tested in extended_directional_app_tagging_secret.test.ts hence all should be fine.
1727
+ return ExtendedDirectionalAppTaggingSecret.fromString(`${Fr.random().toString()}:${resolvedApp.toString()}`);
1728
+ }