@aztec/stdlib 0.0.1-commit.ef17749e1 → 0.0.1-commit.f103f88

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 (405) 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 +5 -44
  10. package/dest/abi/decoder.d.ts.map +1 -1
  11. package/dest/abi/decoder.js +12 -67
  12. package/dest/abi/event_selector.d.ts +3 -6
  13. package/dest/abi/event_selector.d.ts.map +1 -1
  14. package/dest/abi/function_selector.d.ts +3 -6
  15. package/dest/abi/function_selector.d.ts.map +1 -1
  16. package/dest/abi/function_selector.js +2 -4
  17. package/dest/abi/function_signature_decoder.d.ts +43 -0
  18. package/dest/abi/function_signature_decoder.d.ts.map +1 -0
  19. package/dest/abi/function_signature_decoder.js +66 -0
  20. package/dest/abi/index.d.ts +2 -1
  21. package/dest/abi/index.d.ts.map +1 -1
  22. package/dest/abi/index.js +1 -0
  23. package/dest/abi/note_selector.d.ts +3 -6
  24. package/dest/abi/note_selector.d.ts.map +1 -1
  25. package/dest/abi/note_selector.js +1 -3
  26. package/dest/abi/selector.d.ts +2 -2
  27. package/dest/abi/selector.d.ts.map +1 -1
  28. package/dest/abi/selector.js +1 -1
  29. package/dest/avm/revert_code.d.ts +8 -18
  30. package/dest/avm/revert_code.d.ts.map +1 -1
  31. package/dest/avm/revert_code.js +15 -30
  32. package/dest/aztec-address/index.d.ts +3 -6
  33. package/dest/aztec-address/index.d.ts.map +1 -1
  34. package/dest/aztec-address/index.js +2 -4
  35. package/dest/block/block_data.d.ts +8 -8
  36. package/dest/block/block_data.d.ts.map +1 -1
  37. package/dest/block/block_data.js +2 -2
  38. package/dest/block/block_hash.d.ts +11 -10
  39. package/dest/block/block_hash.d.ts.map +1 -1
  40. package/dest/block/block_hash.js +10 -9
  41. package/dest/block/l2_block_info.d.ts +6 -5
  42. package/dest/block/l2_block_info.d.ts.map +1 -1
  43. package/dest/block/l2_block_info.js +6 -5
  44. package/dest/block/l2_block_source.d.ts +90 -10
  45. package/dest/block/l2_block_source.d.ts.map +1 -1
  46. package/dest/block/l2_block_source.js +1 -0
  47. package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
  48. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  49. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
  50. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  51. package/dest/block/l2_block_stream/l2_tips_store_base.js +18 -5
  52. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  53. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  54. package/dest/block/test/l2_tips_store_test_suite.js +4 -3
  55. package/dest/checkpoint/checkpoint.d.ts +7 -1
  56. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  57. package/dest/checkpoint/checkpoint.js +9 -1
  58. package/dest/checkpoint/checkpoint_data.d.ts +71 -5
  59. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  60. package/dest/checkpoint/checkpoint_data.js +10 -0
  61. package/dest/checkpoint/validate.js +2 -2
  62. package/dest/config/chain-config.d.ts +1 -1
  63. package/dest/config/chain-config.d.ts.map +1 -1
  64. package/dest/config/chain-config.js +7 -1
  65. package/dest/config/index.d.ts +2 -1
  66. package/dest/config/index.d.ts.map +1 -1
  67. package/dest/config/index.js +1 -0
  68. package/dest/config/pipelining-config.d.ts +19 -0
  69. package/dest/config/pipelining-config.d.ts.map +1 -0
  70. package/dest/config/pipelining-config.js +18 -0
  71. package/dest/config/sequencer-config.d.ts +2 -2
  72. package/dest/config/sequencer-config.d.ts.map +1 -1
  73. package/dest/config/sequencer-config.js +10 -3
  74. package/dest/contract/contract_address.d.ts +3 -3
  75. package/dest/contract/contract_address.js +3 -3
  76. package/dest/contract/contract_class_id.d.ts +2 -2
  77. package/dest/contract/contract_class_id.js +2 -2
  78. package/dest/contract/index.d.ts +1 -3
  79. package/dest/contract/index.d.ts.map +1 -1
  80. package/dest/contract/index.js +0 -2
  81. package/dest/contract/interfaces/contract_class.d.ts +3 -156
  82. package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
  83. package/dest/contract/interfaces/contract_class.js +1 -28
  84. package/dest/epoch-helpers/index.d.ts +11 -1
  85. package/dest/epoch-helpers/index.d.ts.map +1 -1
  86. package/dest/epoch-helpers/index.js +16 -2
  87. package/dest/file-store/factory.d.ts +4 -3
  88. package/dest/file-store/factory.d.ts.map +1 -1
  89. package/dest/file-store/factory.js +2 -2
  90. package/dest/file-store/http.d.ts +9 -2
  91. package/dest/file-store/http.d.ts.map +1 -1
  92. package/dest/file-store/http.js +20 -9
  93. package/dest/file-store/index.d.ts +2 -1
  94. package/dest/file-store/index.d.ts.map +1 -1
  95. package/dest/gas/fee_math.d.ts +49 -0
  96. package/dest/gas/fee_math.d.ts.map +1 -0
  97. package/dest/gas/fee_math.js +80 -0
  98. package/dest/gas/gas_fees.d.ts +1 -1
  99. package/dest/gas/gas_fees.d.ts.map +1 -1
  100. package/dest/gas/gas_fees.js +10 -1
  101. package/dest/gas/gas_settings.d.ts +40 -3
  102. package/dest/gas/gas_settings.d.ts.map +1 -1
  103. package/dest/gas/gas_settings.js +50 -6
  104. package/dest/gas/index.d.ts +2 -1
  105. package/dest/gas/index.d.ts.map +1 -1
  106. package/dest/gas/index.js +1 -0
  107. package/dest/ha-signing/index.d.ts +2 -2
  108. package/dest/ha-signing/index.d.ts.map +1 -1
  109. package/dest/ha-signing/index.js +1 -1
  110. package/dest/ha-signing/local_config.js +1 -1
  111. package/dest/ha-signing/types.d.ts +37 -32
  112. package/dest/ha-signing/types.d.ts.map +1 -1
  113. package/dest/ha-signing/types.js +13 -6
  114. package/dest/hash/hash.d.ts +19 -1
  115. package/dest/hash/hash.d.ts.map +1 -1
  116. package/dest/hash/hash.js +29 -0
  117. package/dest/interfaces/archiver.d.ts +1 -1
  118. package/dest/interfaces/archiver.d.ts.map +1 -1
  119. package/dest/interfaces/archiver.js +5 -3
  120. package/dest/interfaces/aztec-node-admin.d.ts +10 -14
  121. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  122. package/dest/interfaces/aztec-node-admin.js +3 -3
  123. package/dest/interfaces/aztec-node-debug.d.ts +21 -0
  124. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
  125. package/dest/interfaces/aztec-node-debug.js +18 -0
  126. package/dest/interfaces/aztec-node.d.ts +12 -2
  127. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  128. package/dest/interfaces/aztec-node.js +4 -0
  129. package/dest/interfaces/block-builder.d.ts +32 -11
  130. package/dest/interfaces/block-builder.d.ts.map +1 -1
  131. package/dest/interfaces/block-builder.js +6 -4
  132. package/dest/interfaces/client.d.ts +2 -1
  133. package/dest/interfaces/client.d.ts.map +1 -1
  134. package/dest/interfaces/client.js +1 -0
  135. package/dest/interfaces/configs.d.ts +7 -2
  136. package/dest/interfaces/configs.d.ts.map +1 -1
  137. package/dest/interfaces/configs.js +1 -0
  138. package/dest/interfaces/l2_logs_source.d.ts +5 -3
  139. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  140. package/dest/interfaces/merkle_tree_operations.d.ts +12 -21
  141. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  142. package/dest/interfaces/prover-client.d.ts +6 -1
  143. package/dest/interfaces/prover-client.d.ts.map +1 -1
  144. package/dest/interfaces/prover-client.js +7 -4
  145. package/dest/interfaces/proving-job.d.ts +200 -200
  146. package/dest/interfaces/slasher.d.ts +1 -10
  147. package/dest/interfaces/slasher.d.ts.map +1 -1
  148. package/dest/interfaces/slasher.js +0 -2
  149. package/dest/interfaces/validator.d.ts +9 -20
  150. package/dest/interfaces/validator.d.ts.map +1 -1
  151. package/dest/interfaces/validator.js +0 -1
  152. package/dest/interfaces/world_state.d.ts +5 -4
  153. package/dest/interfaces/world_state.d.ts.map +1 -1
  154. package/dest/l1-contracts/index.d.ts +2 -2
  155. package/dest/l1-contracts/index.d.ts.map +1 -1
  156. package/dest/l1-contracts/index.js +1 -1
  157. package/dest/logs/extended_directional_app_tagging_secret.d.ts +4 -4
  158. package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -1
  159. package/dest/logs/extended_directional_app_tagging_secret.js +12 -5
  160. package/dest/logs/index.d.ts +2 -1
  161. package/dest/logs/index.d.ts.map +1 -1
  162. package/dest/logs/index.js +1 -0
  163. package/dest/logs/log_filter.d.ts +4 -1
  164. package/dest/logs/log_filter.d.ts.map +1 -1
  165. package/dest/logs/log_filter.js +2 -1
  166. package/dest/logs/log_id.d.ts +1 -1
  167. package/dest/logs/log_id.d.ts.map +1 -1
  168. package/dest/logs/log_id.js +1 -2
  169. package/dest/logs/message_context.d.ts +4 -7
  170. package/dest/logs/message_context.d.ts.map +1 -1
  171. package/dest/logs/message_context.js +23 -9
  172. package/dest/logs/pending_tagged_log.d.ts +2 -3
  173. package/dest/logs/pending_tagged_log.d.ts.map +1 -1
  174. package/dest/logs/pending_tagged_log.js +2 -2
  175. package/dest/logs/shared_secret_derivation.d.ts +11 -10
  176. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  177. package/dest/logs/shared_secret_derivation.js +15 -9
  178. package/dest/logs/siloed_tag.d.ts +8 -7
  179. package/dest/logs/siloed_tag.d.ts.map +1 -1
  180. package/dest/logs/siloed_tag.js +11 -3
  181. package/dest/logs/tag.d.ts +5 -6
  182. package/dest/logs/tag.d.ts.map +1 -1
  183. package/dest/logs/tag.js +4 -0
  184. package/dest/logs/tagging_index_range.d.ts +40 -0
  185. package/dest/logs/tagging_index_range.d.ts.map +1 -0
  186. package/dest/logs/tagging_index_range.js +8 -0
  187. package/dest/logs/tx_scoped_l2_log.d.ts +3 -1
  188. package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
  189. package/dest/logs/tx_scoped_l2_log.js +7 -0
  190. package/dest/messaging/l1_to_l2_message.d.ts +3 -2
  191. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  192. package/dest/messaging/l1_to_l2_message.js +11 -13
  193. package/dest/messaging/l1_to_l2_message_source.d.ts +4 -2
  194. package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
  195. package/dest/messaging/l2_to_l1_membership.d.ts +32 -6
  196. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  197. package/dest/messaging/l2_to_l1_membership.js +69 -26
  198. package/dest/noir/index.d.ts +3 -3
  199. package/dest/noir/index.d.ts.map +1 -1
  200. package/dest/note/note_dao.d.ts +1 -1
  201. package/dest/note/note_dao.d.ts.map +1 -1
  202. package/dest/note/note_dao.js +1 -4
  203. package/dest/p2p/block_proposal.d.ts +6 -8
  204. package/dest/p2p/block_proposal.d.ts.map +1 -1
  205. package/dest/p2p/block_proposal.js +4 -9
  206. package/dest/p2p/checkpoint_attestation.d.ts +4 -6
  207. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  208. package/dest/p2p/checkpoint_attestation.js +2 -7
  209. package/dest/p2p/checkpoint_proposal.d.ts +8 -10
  210. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  211. package/dest/p2p/checkpoint_proposal.js +5 -22
  212. package/dest/p2p/gossipable.d.ts +4 -4
  213. package/dest/p2p/gossipable.d.ts.map +1 -1
  214. package/dest/proofs/chonk_proof.d.ts +46 -2
  215. package/dest/proofs/chonk_proof.d.ts.map +1 -1
  216. package/dest/proofs/chonk_proof.js +85 -10
  217. package/dest/slashing/index.d.ts +2 -3
  218. package/dest/slashing/index.d.ts.map +1 -1
  219. package/dest/slashing/index.js +1 -2
  220. package/dest/slashing/serialization.d.ts +2 -6
  221. package/dest/slashing/serialization.d.ts.map +1 -1
  222. package/dest/slashing/serialization.js +0 -60
  223. package/dest/slashing/types.d.ts +4 -90
  224. package/dest/slashing/types.d.ts.map +1 -1
  225. package/dest/slashing/types.js +0 -14
  226. package/dest/slashing/{tally.d.ts → votes.d.ts} +1 -1
  227. package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
  228. package/dest/slashing/{tally.js → votes.js} +1 -1
  229. package/dest/tests/factories.d.ts +2 -4
  230. package/dest/tests/factories.d.ts.map +1 -1
  231. package/dest/tests/factories.js +11 -28
  232. package/dest/tests/mocks.d.ts +1 -1
  233. package/dest/tests/mocks.d.ts.map +1 -1
  234. package/dest/tests/mocks.js +14 -19
  235. package/dest/timetable/index.d.ts +51 -1
  236. package/dest/timetable/index.d.ts.map +1 -1
  237. package/dest/timetable/index.js +204 -14
  238. package/dest/tx/block_header.d.ts +2 -2
  239. package/dest/tx/block_header.d.ts.map +1 -1
  240. package/dest/tx/block_header.js +1 -1
  241. package/dest/tx/capsule.d.ts +6 -2
  242. package/dest/tx/capsule.d.ts.map +1 -1
  243. package/dest/tx/capsule.js +9 -3
  244. package/dest/tx/fee_provider.d.ts +10 -0
  245. package/dest/tx/fee_provider.d.ts.map +1 -0
  246. package/dest/tx/fee_provider.js +1 -0
  247. package/dest/tx/global_variable_builder.d.ts +3 -4
  248. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  249. package/dest/tx/index.d.ts +2 -1
  250. package/dest/tx/index.d.ts.map +1 -1
  251. package/dest/tx/index.js +1 -0
  252. package/dest/tx/indexed_tx_effect.d.ts +1 -1
  253. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  254. package/dest/tx/indexed_tx_effect.js +1 -2
  255. package/dest/tx/private_execution_result.d.ts +6 -6
  256. package/dest/tx/private_execution_result.d.ts.map +1 -1
  257. package/dest/tx/private_execution_result.js +6 -6
  258. package/dest/tx/profiling.d.ts +14 -2
  259. package/dest/tx/profiling.d.ts.map +1 -1
  260. package/dest/tx/profiling.js +13 -3
  261. package/dest/tx/simulated_tx.d.ts +112 -4
  262. package/dest/tx/simulated_tx.d.ts.map +1 -1
  263. package/dest/tx/simulated_tx.js +3 -3
  264. package/dest/tx/tx.d.ts +3 -3
  265. package/dest/tx/tx.d.ts.map +1 -1
  266. package/dest/tx/tx_receipt.d.ts +14 -5
  267. package/dest/tx/tx_receipt.d.ts.map +1 -1
  268. package/dest/tx/tx_receipt.js +14 -18
  269. package/dest/tx/validator/error_texts.d.ts +5 -1
  270. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  271. package/dest/tx/validator/error_texts.js +6 -0
  272. package/dest/update-checker/package_version.d.ts +2 -2
  273. package/dest/update-checker/package_version.d.ts.map +1 -1
  274. package/dest/update-checker/package_version.js +16 -3
  275. package/dest/validators/errors.d.ts +6 -1
  276. package/dest/validators/errors.d.ts.map +1 -1
  277. package/dest/validators/errors.js +7 -0
  278. package/dest/versioning/versioning.d.ts +4 -2
  279. package/dest/versioning/versioning.d.ts.map +1 -1
  280. package/dest/versioning/versioning.js +4 -1
  281. package/dest/world-state/genesis_data.d.ts +11 -0
  282. package/dest/world-state/genesis_data.d.ts.map +1 -0
  283. package/dest/world-state/genesis_data.js +4 -0
  284. package/dest/world-state/index.d.ts +2 -1
  285. package/dest/world-state/index.d.ts.map +1 -1
  286. package/dest/world-state/index.js +1 -0
  287. package/package.json +8 -8
  288. package/src/abi/abi.ts +25 -2
  289. package/src/abi/authorization_selector.ts +2 -8
  290. package/src/abi/buffer.ts +25 -4
  291. package/src/abi/decoder.ts +23 -78
  292. package/src/abi/event_selector.ts +2 -8
  293. package/src/abi/function_selector.ts +4 -13
  294. package/src/abi/function_signature_decoder.ts +77 -0
  295. package/src/abi/index.ts +1 -0
  296. package/src/abi/note_selector.ts +3 -12
  297. package/src/abi/selector.ts +1 -1
  298. package/src/avm/revert_code.ts +25 -39
  299. package/src/aztec-address/index.ts +4 -10
  300. package/src/block/block_data.ts +3 -4
  301. package/src/block/block_hash.ts +21 -14
  302. package/src/block/l2_block_info.ts +8 -6
  303. package/src/block/l2_block_source.ts +20 -9
  304. package/src/block/l2_block_stream/interfaces.ts +6 -2
  305. package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
  306. package/src/block/test/l2_tips_store_test_suite.ts +9 -2
  307. package/src/checkpoint/checkpoint.ts +11 -1
  308. package/src/checkpoint/checkpoint_data.ts +40 -4
  309. package/src/checkpoint/validate.ts +2 -2
  310. package/src/config/chain-config.ts +7 -1
  311. package/src/config/index.ts +1 -0
  312. package/src/config/pipelining-config.ts +31 -0
  313. package/src/config/sequencer-config.ts +14 -4
  314. package/src/contract/contract_address.ts +3 -3
  315. package/src/contract/contract_class_id.ts +2 -2
  316. package/src/contract/index.ts +0 -2
  317. package/src/contract/interfaces/contract_class.ts +2 -82
  318. package/src/epoch-helpers/index.ts +27 -0
  319. package/src/file-store/factory.ts +13 -4
  320. package/src/file-store/http.ts +29 -10
  321. package/src/file-store/index.ts +1 -0
  322. package/src/gas/README.md +154 -0
  323. package/src/gas/fee_math.ts +120 -0
  324. package/src/gas/gas_fees.ts +12 -4
  325. package/src/gas/gas_settings.ts +65 -12
  326. package/src/gas/index.ts +1 -0
  327. package/src/ha-signing/index.ts +3 -1
  328. package/src/ha-signing/local_config.ts +1 -1
  329. package/src/ha-signing/types.ts +48 -34
  330. package/src/hash/hash.ts +34 -0
  331. package/src/interfaces/archiver.ts +5 -3
  332. package/src/interfaces/aztec-node-admin.ts +5 -7
  333. package/src/interfaces/aztec-node-debug.ts +40 -0
  334. package/src/interfaces/aztec-node.ts +25 -1
  335. package/src/interfaces/block-builder.ts +39 -13
  336. package/src/interfaces/client.ts +1 -0
  337. package/src/interfaces/configs.ts +4 -1
  338. package/src/interfaces/l2_logs_source.ts +4 -1
  339. package/src/interfaces/merkle_tree_operations.ts +11 -20
  340. package/src/interfaces/prover-client.ts +10 -5
  341. package/src/interfaces/slasher.ts +0 -6
  342. package/src/interfaces/validator.ts +16 -13
  343. package/src/interfaces/world_state.ts +4 -3
  344. package/src/l1-contracts/index.ts +1 -1
  345. package/src/logs/extended_directional_app_tagging_secret.ts +19 -8
  346. package/src/logs/index.ts +1 -0
  347. package/src/logs/log_filter.ts +5 -0
  348. package/src/logs/log_id.ts +1 -2
  349. package/src/logs/message_context.ts +17 -7
  350. package/src/logs/pending_tagged_log.ts +1 -3
  351. package/src/logs/shared_secret_derivation.ts +21 -10
  352. package/src/logs/siloed_tag.ts +15 -11
  353. package/src/logs/tag.ts +8 -8
  354. package/src/logs/tagging_index_range.ts +24 -0
  355. package/src/logs/tx_scoped_l2_log.ts +16 -0
  356. package/src/messaging/l1_to_l2_message.ts +12 -9
  357. package/src/messaging/l1_to_l2_message_source.ts +3 -1
  358. package/src/messaging/l2_to_l1_membership.ts +98 -33
  359. package/src/noir/index.ts +2 -2
  360. package/src/note/note_dao.ts +1 -4
  361. package/src/p2p/block_proposal.ts +13 -9
  362. package/src/p2p/checkpoint_attestation.ts +5 -9
  363. package/src/p2p/checkpoint_proposal.ts +19 -31
  364. package/src/p2p/gossipable.ts +4 -4
  365. package/src/proofs/chonk_proof.ts +91 -5
  366. package/src/slashing/index.ts +1 -2
  367. package/src/slashing/serialization.ts +1 -81
  368. package/src/slashing/types.ts +3 -35
  369. package/src/slashing/{tally.ts → votes.ts} +1 -1
  370. package/src/tests/factories.ts +5 -34
  371. package/src/tests/mocks.ts +16 -12
  372. package/src/timetable/index.ts +293 -13
  373. package/src/tx/block_header.ts +2 -2
  374. package/src/tx/capsule.ts +10 -2
  375. package/src/tx/fee_provider.ts +10 -0
  376. package/src/tx/global_variable_builder.ts +2 -3
  377. package/src/tx/index.ts +1 -0
  378. package/src/tx/indexed_tx_effect.ts +1 -2
  379. package/src/tx/private_execution_result.ts +5 -5
  380. package/src/tx/profiling.ts +11 -2
  381. package/src/tx/simulated_tx.ts +6 -2
  382. package/src/tx/tx.ts +2 -2
  383. package/src/tx/tx_receipt.ts +18 -16
  384. package/src/tx/validator/error_texts.ts +8 -0
  385. package/src/update-checker/package_version.ts +19 -6
  386. package/src/validators/errors.ts +9 -0
  387. package/src/versioning/versioning.ts +4 -1
  388. package/src/world-state/genesis_data.ts +15 -0
  389. package/src/world-state/index.ts +1 -0
  390. package/dest/contract/private_function_membership_proof.d.ts +0 -32
  391. package/dest/contract/private_function_membership_proof.d.ts.map +0 -1
  392. package/dest/contract/private_function_membership_proof.js +0 -124
  393. package/dest/contract/utility_function_membership_proof.d.ts +0 -27
  394. package/dest/contract/utility_function_membership_proof.d.ts.map +0 -1
  395. package/dest/contract/utility_function_membership_proof.js +0 -87
  396. package/dest/l1-contracts/slash_factory.d.ts +0 -45
  397. package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
  398. package/dest/l1-contracts/slash_factory.js +0 -158
  399. package/dest/slashing/empire.d.ts +0 -31
  400. package/dest/slashing/empire.d.ts.map +0 -1
  401. package/dest/slashing/empire.js +0 -87
  402. package/src/contract/private_function_membership_proof.ts +0 -167
  403. package/src/contract/utility_function_membership_proof.ts +0 -118
  404. package/src/l1-contracts/slash_factory.ts +0 -180
  405. package/src/slashing/empire.ts +0 -104
@@ -1,5 +1,11 @@
1
- import { BlockNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
2
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import {
2
+ BlockNumber,
3
+ BlockProposalHash,
4
+ type CheckpointNumber,
5
+ IndexWithinCheckpoint,
6
+ SlotNumber,
7
+ } from '@aztec/foundation/branded-types';
8
+ import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
3
9
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
10
  import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
11
  import { Fr } from '@aztec/foundation/curves/bn254';
@@ -23,11 +29,7 @@ import {
23
29
  import { SignedTxs } from './signed_txs.js';
24
30
  import { TopicType } from './topic_type.js';
25
31
 
26
- export class BlockProposalHash extends Buffer32 {
27
- constructor(hash: Buffer) {
28
- super(hash);
29
- }
30
- }
32
+ export type { BlockProposalHash } from '@aztec/foundation/branded-types';
31
33
 
32
34
  export type BlockProposalOptions = {
33
35
  /**
@@ -77,8 +79,8 @@ export class BlockProposal extends Gossipable {
77
79
  super();
78
80
  }
79
81
 
80
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
81
- return Promise.resolve(new BlockProposalHash(keccak256(this.signature.toBuffer())));
82
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
83
+ return Promise.resolve(BlockProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
82
84
  }
83
85
 
84
86
  get archive(): Fr {
@@ -126,6 +128,7 @@ export class BlockProposal extends Gossipable {
126
128
 
127
129
  static async createProposalFromSigner(
128
130
  blockHeader: BlockHeader,
131
+ checkpointNumber: CheckpointNumber,
129
132
  indexWithinCheckpoint: IndexWithinCheckpoint,
130
133
  inHash: Fr,
131
134
  archiveRoot: Fr,
@@ -147,6 +150,7 @@ export class BlockProposal extends Gossipable {
147
150
  const blockContext: SigningContext = {
148
151
  slot: blockHeader.globalVariables.slotNumber,
149
152
  blockNumber: blockHeader.globalVariables.blockNumber,
153
+ checkpointNumber,
150
154
  blockIndexWithinCheckpoint: indexWithinCheckpoint,
151
155
  dutyType: DutyType.BLOCK_PROPOSAL,
152
156
  };
@@ -1,5 +1,5 @@
1
- import { SlotNumber } from '@aztec/foundation/branded-types';
2
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import { CheckpointAttestationHash, SlotNumber } from '@aztec/foundation/branded-types';
2
+ import type { BaseBuffer32 } from '@aztec/foundation/buffer';
3
3
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
4
  import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
5
  import type { Fr } from '@aztec/foundation/curves/bn254';
@@ -16,11 +16,7 @@ import { Gossipable } from './gossipable.js';
16
16
  import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
17
17
  import { TopicType } from './topic_type.js';
18
18
 
19
- export class CheckpointAttestationHash extends Buffer32 {
20
- constructor(hash: Buffer) {
21
- super(hash);
22
- }
23
- }
19
+ export type { CheckpointAttestationHash } from '@aztec/foundation/branded-types';
24
20
 
25
21
  /**
26
22
  * CheckpointAttestation
@@ -57,8 +53,8 @@ export class CheckpointAttestation extends Gossipable {
57
53
  .transform(obj => new CheckpointAttestation(obj.payload, obj.signature, obj.proposerSignature));
58
54
  }
59
55
 
60
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
61
- return Promise.resolve(new CheckpointAttestationHash(keccak256(this.signature.toBuffer())));
56
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
57
+ return Promise.resolve(CheckpointAttestationHash.fromBuffer(keccak256(this.signature.toBuffer())));
62
58
  }
63
59
 
64
60
  get archive(): Fr {
@@ -1,5 +1,10 @@
1
- import { BlockNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
2
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import {
2
+ type CheckpointNumber,
3
+ CheckpointProposalHash,
4
+ IndexWithinCheckpoint,
5
+ SlotNumber,
6
+ } from '@aztec/foundation/branded-types';
7
+ import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
3
8
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
9
  import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
10
  import { Fr } from '@aztec/foundation/curves/bn254';
@@ -24,12 +29,7 @@ import {
24
29
  import { SignedTxs } from './signed_txs.js';
25
30
  import { TopicType } from './topic_type.js';
26
31
 
27
- // REFACTOR(palla): Use a branded type instead of a subclass of Buffer32
28
- export class CheckpointProposalHash extends Buffer32 {
29
- constructor(hash: Buffer) {
30
- super(hash);
31
- }
32
- }
32
+ export type { CheckpointProposalHash } from '@aztec/foundation/branded-types';
33
33
 
34
34
  export type CheckpointProposalOptions = {
35
35
  /**
@@ -93,8 +93,8 @@ export class CheckpointProposal extends Gossipable {
93
93
  super();
94
94
  }
95
95
 
96
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
97
- return Promise.resolve(new CheckpointProposalHash(keccak256(this.signature.toBuffer())));
96
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
97
+ return Promise.resolve(CheckpointProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
98
98
  }
99
99
 
100
100
  get slotNumber(): SlotNumber {
@@ -160,8 +160,9 @@ export class CheckpointProposal extends Gossipable {
160
160
  static async createProposalFromSigner(
161
161
  checkpointHeader: CheckpointHeader,
162
162
  archiveRoot: Fr,
163
+ checkpointNumber: CheckpointNumber,
163
164
  feeAssetPriceModifier: bigint,
164
- lastBlockInfo: CheckpointLastBlockData | undefined,
165
+ lastBlockProposal: BlockProposal | undefined,
165
166
  payloadSigner: (payload: Buffer32, context: SigningContext) => Promise<Signature>,
166
167
  ): Promise<CheckpointProposal> {
167
168
  // Sign the checkpoint payload with CHECKPOINT_PROPOSAL duty type
@@ -175,32 +176,19 @@ export class CheckpointProposal extends Gossipable {
175
176
 
176
177
  const checkpointContext: SigningContext = {
177
178
  slot: checkpointHeader.slotNumber,
178
- blockNumber: lastBlockInfo?.blockHeader?.globalVariables.blockNumber ?? BlockNumber(0),
179
+ checkpointNumber,
179
180
  dutyType: DutyType.CHECKPOINT_PROPOSAL,
180
181
  };
181
- const checkpointSignature = await payloadSigner(checkpointHash, checkpointContext);
182
182
 
183
- if (!lastBlockInfo) {
184
- return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature);
185
- }
183
+ const checkpointSignature = await payloadSigner(checkpointHash, checkpointContext);
186
184
 
187
- const lastBlockProposal = await BlockProposal.createProposalFromSigner(
188
- lastBlockInfo.blockHeader,
189
- lastBlockInfo.indexWithinCheckpoint,
190
- checkpointHeader.inHash,
185
+ return new CheckpointProposal(
186
+ checkpointHeader,
191
187
  archiveRoot,
192
- lastBlockInfo.txHashes,
193
- lastBlockInfo.txs,
194
- payloadSigner,
188
+ feeAssetPriceModifier,
189
+ checkpointSignature,
190
+ lastBlockProposal,
195
191
  );
196
-
197
- return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature, {
198
- blockHeader: lastBlockInfo.blockHeader,
199
- indexWithinCheckpoint: lastBlockInfo.indexWithinCheckpoint,
200
- txHashes: lastBlockInfo.txHashes,
201
- signature: lastBlockProposal.signature,
202
- signedTxs: lastBlockProposal.signedTxs,
203
- });
204
192
  }
205
193
 
206
194
  /**
@@ -1,4 +1,4 @@
1
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import { BaseBuffer32 } from '@aztec/foundation/buffer';
2
2
  import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
3
3
 
4
4
  import type { TopicType } from './topic_type.js';
@@ -46,7 +46,7 @@ export class P2PMessage {
46
46
  * Any class which extends gossipable will be able to be Gossiped over the p2p network
47
47
  */
48
48
  export abstract class Gossipable {
49
- private cachedId: Buffer32 | undefined;
49
+ private cachedId: BaseBuffer32 | undefined;
50
50
  /** The p2p topic identifier, this determines how the message is handled */
51
51
  static p2pTopic: TopicType;
52
52
 
@@ -54,7 +54,7 @@ export abstract class Gossipable {
54
54
  * A digest of the message information **used for logging only**.
55
55
  * The identifier used for deduplication is `getMsgIdFn` as defined in `encoding.ts` which is a hash over topic and data.
56
56
  */
57
- async p2pMessageLoggingIdentifier(): Promise<Buffer32> {
57
+ async p2pMessageLoggingIdentifier(): Promise<BaseBuffer32> {
58
58
  if (this.cachedId) {
59
59
  return this.cachedId;
60
60
  }
@@ -62,7 +62,7 @@ export abstract class Gossipable {
62
62
  return this.cachedId;
63
63
  }
64
64
 
65
- abstract generateP2PMessageIdentifier(): Promise<Buffer32>;
65
+ abstract generateP2PMessageIdentifier(): Promise<BaseBuffer32>;
66
66
 
67
67
  abstract toBuffer(): Buffer;
68
68
 
@@ -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,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'];
@@ -28,7 +28,7 @@ export function getSlashConsensusVotesFromOffenses(
28
28
  targetCommitteeSize: number;
29
29
  maxSlashedValidators?: number;
30
30
  },
31
- logger: Logger = createLogger('slasher:tally'),
31
+ logger: Logger = createLogger('slasher:votes'),
32
32
  ): ValidatorSlashVote[] {
33
33
  const { slashingAmounts, targetCommitteeSize, maxSlashedValidators } = settings;
34
34
 
@@ -92,10 +92,8 @@ import {
92
92
  type ContractClassPublic,
93
93
  ContractDeploymentData,
94
94
  type ContractInstanceWithAddress,
95
- type ExecutablePrivateFunctionWithMembershipProof,
96
95
  type PrivateFunction,
97
96
  SerializableContractInstance,
98
- type UtilityFunctionWithMembershipProof,
99
97
  computeContractClassId,
100
98
  computePublicBytecodeCommitment,
101
99
  } from '../contract/index.js';
@@ -234,7 +232,7 @@ export function makeTxContext(seed: number = 1): TxContext {
234
232
  * Creates a default instance of gas settings. No seed value is used to ensure we allocate a sensible amount of gas for testing.
235
233
  */
236
234
  export function makeGasSettings() {
237
- return GasSettings.default({ maxFeesPerGas: new GasFees(10, 10) });
235
+ return GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) });
238
236
  }
239
237
 
240
238
  /**
@@ -1183,35 +1181,6 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
1183
1181
  });
1184
1182
  }
1185
1183
 
1186
- export function makeExecutablePrivateFunctionWithMembershipProof(
1187
- seed = 0,
1188
- ): ExecutablePrivateFunctionWithMembershipProof {
1189
- return {
1190
- selector: makeSelector(seed),
1191
- bytecode: makeBytes(100, seed + 1),
1192
- artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
1193
- artifactTreeLeafIndex: seed + 2,
1194
- privateFunctionTreeSiblingPath: makeTuple(3, fr, seed + 3),
1195
- privateFunctionTreeLeafIndex: seed + 3,
1196
- artifactMetadataHash: fr(seed + 4),
1197
- functionMetadataHash: fr(seed + 5),
1198
- utilityFunctionsTreeRoot: fr(seed + 6),
1199
- vkHash: fr(seed + 7),
1200
- };
1201
- }
1202
-
1203
- export function makeUtilityFunctionWithMembershipProof(seed = 0): UtilityFunctionWithMembershipProof {
1204
- return {
1205
- selector: makeSelector(seed),
1206
- bytecode: makeBytes(100, seed + 1),
1207
- artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
1208
- artifactTreeLeafIndex: seed + 2,
1209
- artifactMetadataHash: fr(seed + 4),
1210
- functionMetadataHash: fr(seed + 5),
1211
- privateFunctionsArtifactTreeRoot: fr(seed + 6),
1212
- };
1213
- }
1214
-
1215
1184
  export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer): Promise<ContractClassPublic> {
1216
1185
  const artifactHash = fr(seed + 1);
1217
1186
  const privateFunctionsRoot = fr(seed + 3);
@@ -1223,8 +1192,6 @@ export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer)
1223
1192
  artifactHash,
1224
1193
  packedBytecode,
1225
1194
  privateFunctionsRoot,
1226
- privateFunctions: [],
1227
- utilityFunctions: [],
1228
1195
  version: 1,
1229
1196
  };
1230
1197
  }
@@ -1748,6 +1715,10 @@ export function makeL2Tips(
1748
1715
  block: { number: bn, hash },
1749
1716
  checkpoint: { number: cpn, hash: cph },
1750
1717
  },
1718
+ proposedCheckpoint: {
1719
+ block: { number: bn, hash },
1720
+ checkpoint: { number: cpn, hash: cph },
1721
+ },
1751
1722
  proven: {
1752
1723
  block: { number: bn, hash },
1753
1724
  checkpoint: { number: cpn, hash: cph },
@@ -134,7 +134,7 @@ export const mockTx = async (
134
134
  const data = PrivateKernelTailCircuitPublicInputs.empty();
135
135
  const firstNullifier = new Nullifier(new Fr(seed + 1), Fr.ZERO, 0);
136
136
  data.constants.anchorBlockHeader = anchorBlockHeader;
137
- data.constants.txContext.gasSettings = GasSettings.default({ gasLimits, maxFeesPerGas, maxPriorityFeesPerGas });
137
+ data.constants.txContext.gasSettings = GasSettings.fallback({ gasLimits, maxFeesPerGas, maxPriorityFeesPerGas });
138
138
  data.feePayer = feePayer ?? (await AztecAddress.random());
139
139
  data.gasUsed = gasUsed;
140
140
  data.constants.txContext.chainId = chainId;
@@ -200,7 +200,7 @@ export async function mockProcessedTx({
200
200
  db,
201
201
  chainId = Fr.ZERO,
202
202
  version = Fr.ZERO,
203
- gasSettings = GasSettings.default({ maxFeesPerGas: new GasFees(10, 10) }),
203
+ gasSettings = GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) }),
204
204
  vkTreeRoot = Fr.ZERO,
205
205
  protocolContracts = makeProtocolContracts(seed + 0x100),
206
206
  globalVariables = GlobalVariables.empty(),
@@ -587,6 +587,7 @@ export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<B
587
587
 
588
588
  return BlockProposal.createProposalFromSigner(
589
589
  blockHeader,
590
+ CheckpointNumber(1),
590
591
  indexWithinCheckpoint,
591
592
  inHash,
592
593
  archiveRoot,
@@ -596,28 +597,31 @@ export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<B
596
597
  );
597
598
  };
598
599
 
599
- export const makeCheckpointProposal = (options?: MakeCheckpointProposalOptions): Promise<CheckpointProposal> => {
600
- const blockHeader = options?.lastBlock?.blockHeader ?? makeBlockHeader(1);
600
+ export const makeCheckpointProposal = async (options?: MakeCheckpointProposalOptions): Promise<CheckpointProposal> => {
601
601
  const checkpointHeader = options?.checkpointHeader ?? makeCheckpointHeader(1);
602
602
  const archiveRoot = options?.archiveRoot ?? Fr.random();
603
603
  const feeAssetPriceModifier = options?.feeAssetPriceModifier ?? 0n;
604
604
  const signer = options?.signer ?? Secp256k1Signer.random();
605
605
 
606
- // Build lastBlock info if provided
607
- const lastBlockInfo = options?.lastBlock
608
- ? {
609
- blockHeader,
610
- indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? IndexWithinCheckpoint(4), // Last block in a 5-block checkpoint
611
- txHashes: options.lastBlock.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random()),
606
+ // Build a signed block proposal if lastBlock options are provided
607
+ const lastBlockProposal = options?.lastBlock
608
+ ? await makeBlockProposal({
609
+ blockHeader: options.lastBlock.blockHeader,
610
+ indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? IndexWithinCheckpoint(4),
611
+ inHash: checkpointHeader.inHash,
612
+ archiveRoot,
613
+ txHashes: options.lastBlock.txHashes,
612
614
  txs: options.lastBlock.txs,
613
- }
615
+ signer,
616
+ })
614
617
  : undefined;
615
618
 
616
619
  return CheckpointProposal.createProposalFromSigner(
617
620
  checkpointHeader,
618
621
  archiveRoot,
622
+ CheckpointNumber(1),
619
623
  feeAssetPriceModifier,
620
- lastBlockInfo,
624
+ lastBlockProposal,
621
625
  payload => Promise.resolve(signer.signMessage(payload)),
622
626
  );
623
627
  };