@aztec/stdlib 6.0.0-nightly.20260605 → 6.0.0-nightly.20260721

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 (499) hide show
  1. package/dest/abi/buffer.d.ts +6 -2
  2. package/dest/abi/buffer.d.ts.map +1 -1
  3. package/dest/abi/buffer.js +13 -1
  4. package/dest/avm/avm.js +1 -1
  5. package/dest/avm/avm_proving_request.d.ts +70 -70
  6. package/dest/avm/index.d.ts +1 -6
  7. package/dest/avm/index.d.ts.map +1 -1
  8. package/dest/avm/index.js +0 -5
  9. package/dest/aztec-address/index.d.ts +35 -5
  10. package/dest/aztec-address/index.d.ts.map +1 -1
  11. package/dest/aztec-address/index.js +32 -8
  12. package/dest/block/attestation_info.d.ts +1 -1
  13. package/dest/block/attestation_info.d.ts.map +1 -1
  14. package/dest/block/attestation_info.js +7 -4
  15. package/dest/block/l2_block_source.d.ts +46 -23
  16. package/dest/block/l2_block_source.d.ts.map +1 -1
  17. package/dest/block/l2_block_source.js +15 -1
  18. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +39 -0
  19. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -0
  20. package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +165 -0
  21. package/dest/block/l2_block_stream/index.d.ts +2 -1
  22. package/dest/block/l2_block_stream/index.d.ts.map +1 -1
  23. package/dest/block/l2_block_stream/index.js +1 -0
  24. package/dest/block/l2_block_stream/interfaces.d.ts +81 -11
  25. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  26. package/dest/block/l2_block_stream/interfaces.js +25 -1
  27. package/dest/block/l2_block_stream/l2_block_stream.d.ts +23 -15
  28. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  29. package/dest/block/l2_block_stream/l2_block_stream.js +149 -152
  30. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +6 -12
  31. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
  32. package/dest/block/l2_block_stream/l2_tips_memory_store.js +8 -32
  33. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +17 -18
  34. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  35. package/dest/block/l2_block_stream/l2_tips_store_base.js +70 -58
  36. package/dest/block/proposal/attestations_and_signers.d.ts +19 -1
  37. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  38. package/dest/block/proposal/attestations_and_signers.js +47 -7
  39. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  40. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  41. package/dest/block/test/l2_tips_store_test_suite.js +296 -37
  42. package/dest/block/validate_block_result.d.ts +16 -1
  43. package/dest/block/validate_block_result.d.ts.map +1 -1
  44. package/dest/block/validate_block_result.js +18 -3
  45. package/dest/checkpoint/checkpoint.js +2 -2
  46. package/dest/checkpoint/index.d.ts +2 -1
  47. package/dest/checkpoint/index.d.ts.map +1 -1
  48. package/dest/checkpoint/index.js +1 -0
  49. package/dest/checkpoint/simulation_overrides.d.ts +61 -0
  50. package/dest/checkpoint/simulation_overrides.d.ts.map +1 -0
  51. package/dest/checkpoint/simulation_overrides.js +98 -0
  52. package/dest/checkpoint/validate.d.ts +11 -3
  53. package/dest/checkpoint/validate.d.ts.map +1 -1
  54. package/dest/checkpoint/validate.js +9 -6
  55. package/dest/config/index.d.ts +2 -1
  56. package/dest/config/index.d.ts.map +1 -1
  57. package/dest/config/index.js +1 -0
  58. package/dest/config/network-consensus-config.d.ts +72 -0
  59. package/dest/config/network-consensus-config.d.ts.map +1 -0
  60. package/dest/config/network-consensus-config.js +223 -0
  61. package/dest/config/sequencer-config.d.ts +4 -2
  62. package/dest/config/sequencer-config.d.ts.map +1 -1
  63. package/dest/config/sequencer-config.js +22 -3
  64. package/dest/contract/contract_address.d.ts +5 -4
  65. package/dest/contract/contract_address.d.ts.map +1 -1
  66. package/dest/contract/contract_class.d.ts +1 -1
  67. package/dest/contract/contract_class.d.ts.map +1 -1
  68. package/dest/contract/contract_class.js +3 -2
  69. package/dest/contract/contract_instance.d.ts +16 -2
  70. package/dest/contract/contract_instance.d.ts.map +1 -1
  71. package/dest/contract/contract_instance.js +45 -0
  72. package/dest/contract/index.d.ts +1 -2
  73. package/dest/contract/index.d.ts.map +1 -1
  74. package/dest/contract/index.js +0 -1
  75. package/dest/contract/interfaces/contract_data_source.d.ts +3 -5
  76. package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
  77. package/dest/contract/interfaces/contract_instance.d.ts +71 -10
  78. package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
  79. package/dest/contract/interfaces/contract_instance.js +7 -2
  80. package/dest/contract/interfaces/node-info.d.ts +11 -1
  81. package/dest/contract/interfaces/node-info.d.ts.map +1 -1
  82. package/dest/contract/interfaces/node-info.js +7 -1
  83. package/dest/contract/partial_address.d.ts +9 -3
  84. package/dest/contract/partial_address.d.ts.map +1 -1
  85. package/dest/contract/partial_address.js +8 -2
  86. package/dest/database-version/version_manager.d.ts +18 -4
  87. package/dest/database-version/version_manager.d.ts.map +1 -1
  88. package/dest/database-version/version_manager.js +76 -6
  89. package/dest/deserialization/index.d.ts +35 -3
  90. package/dest/deserialization/index.d.ts.map +1 -1
  91. package/dest/deserialization/index.js +32 -1
  92. package/dest/file-store/factory.d.ts +1 -1
  93. package/dest/file-store/factory.d.ts.map +1 -1
  94. package/dest/file-store/factory.js +7 -0
  95. package/dest/file-store/index.d.ts +2 -1
  96. package/dest/file-store/index.d.ts.map +1 -1
  97. package/dest/file-store/index.js +1 -0
  98. package/dest/file-store/memory.d.ts +24 -0
  99. package/dest/file-store/memory.d.ts.map +1 -0
  100. package/dest/file-store/memory.js +80 -0
  101. package/dest/gas/gas_settings.d.ts +7 -13
  102. package/dest/gas/gas_settings.d.ts.map +1 -1
  103. package/dest/gas/gas_settings.js +9 -16
  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/gas/tx_gas_limits.d.ts +72 -0
  108. package/dest/gas/tx_gas_limits.d.ts.map +1 -0
  109. package/dest/gas/tx_gas_limits.js +85 -0
  110. package/dest/ha-signing/config.d.ts +19 -5
  111. package/dest/ha-signing/config.d.ts.map +1 -1
  112. package/dest/ha-signing/config.js +9 -3
  113. package/dest/ha-signing/local_config.d.ts +10 -2
  114. package/dest/ha-signing/local_config.d.ts.map +1 -1
  115. package/dest/ha-signing/local_config.js +8 -2
  116. package/dest/interfaces/archiver.d.ts +7 -9
  117. package/dest/interfaces/archiver.d.ts.map +1 -1
  118. package/dest/interfaces/archiver.js +3 -2
  119. package/dest/interfaces/aztec-node-admin.d.ts +24 -17
  120. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  121. package/dest/interfaces/aztec-node-admin.js +1 -1
  122. package/dest/interfaces/aztec-node-debug.d.ts +40 -2
  123. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -1
  124. package/dest/interfaces/aztec-node-debug.js +29 -1
  125. package/dest/interfaces/aztec-node.d.ts +69 -28
  126. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  127. package/dest/interfaces/aztec-node.js +56 -20
  128. package/dest/interfaces/block-builder.d.ts +3 -1
  129. package/dest/interfaces/block-builder.d.ts.map +1 -1
  130. package/dest/interfaces/chain_tips.d.ts +8 -47
  131. package/dest/interfaces/chain_tips.d.ts.map +1 -1
  132. package/dest/interfaces/chain_tips.js +1 -6
  133. package/dest/interfaces/checkpoint_parameter.d.ts +3 -3
  134. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -1
  135. package/dest/interfaces/checkpoint_parameter.js +3 -3
  136. package/dest/interfaces/client.d.ts +2 -1
  137. package/dest/interfaces/client.d.ts.map +1 -1
  138. package/dest/interfaces/configs.d.ts +27 -6
  139. package/dest/interfaces/configs.d.ts.map +1 -1
  140. package/dest/interfaces/configs.js +5 -1
  141. package/dest/interfaces/get_tx_by_hash_options.d.ts +9 -0
  142. package/dest/interfaces/get_tx_by_hash_options.d.ts.map +1 -0
  143. package/dest/interfaces/get_tx_by_hash_options.js +4 -0
  144. package/dest/interfaces/merkle_tree_operations.d.ts +8 -3
  145. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  146. package/dest/interfaces/p2p.d.ts +38 -9
  147. package/dest/interfaces/p2p.d.ts.map +1 -1
  148. package/dest/interfaces/p2p.js +14 -2
  149. package/dest/interfaces/private_kernel_prover.d.ts +71 -12
  150. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  151. package/dest/interfaces/prover-client.d.ts +2 -3
  152. package/dest/interfaces/prover-client.d.ts.map +1 -1
  153. package/dest/interfaces/prover-node.d.ts +12 -8
  154. package/dest/interfaces/prover-node.d.ts.map +1 -1
  155. package/dest/interfaces/prover-node.js +24 -17
  156. package/dest/interfaces/proving-job.d.ts +4 -4
  157. package/dest/interfaces/proving-job.d.ts.map +1 -1
  158. package/dest/interfaces/proving-job.js +2 -2
  159. package/dest/interfaces/server.d.ts +1 -3
  160. package/dest/interfaces/server.d.ts.map +1 -1
  161. package/dest/interfaces/server.js +0 -2
  162. package/dest/interfaces/server_circuit_prover.d.ts +3 -3
  163. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  164. package/dest/interfaces/validator.d.ts +15 -4
  165. package/dest/interfaces/validator.d.ts.map +1 -1
  166. package/dest/interfaces/validator.js +3 -1
  167. package/dest/interfaces/world_state.d.ts +14 -1
  168. package/dest/interfaces/world_state.d.ts.map +1 -1
  169. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
  170. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
  171. package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
  172. package/dest/kernel/hints/index.d.ts +1 -2
  173. package/dest/kernel/hints/index.d.ts.map +1 -1
  174. package/dest/kernel/hints/index.js +0 -1
  175. package/dest/kernel/hints/read_request.js +1 -1
  176. package/dest/kernel/index.d.ts +6 -2
  177. package/dest/kernel/index.d.ts.map +1 -1
  178. package/dest/kernel/index.js +5 -1
  179. package/dest/kernel/log_hash.d.ts +1 -1
  180. package/dest/kernel/log_hash.d.ts.map +1 -1
  181. package/dest/kernel/log_hash.js +2 -2
  182. package/dest/kernel/note_hash.js +1 -1
  183. package/dest/kernel/nullifier.js +1 -1
  184. package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
  185. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  186. package/dest/kernel/private_circuit_public_inputs.js +14 -7
  187. package/dest/kernel/private_context_inputs.d.ts +4 -3
  188. package/dest/kernel/private_context_inputs.d.ts.map +1 -1
  189. package/dest/kernel/private_context_inputs.js +7 -3
  190. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -9
  191. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  192. package/dest/kernel/private_kernel_circuit_public_inputs.js +10 -7
  193. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
  194. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
  195. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
  196. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
  197. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
  198. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
  199. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts +24 -0
  200. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts.map +1 -0
  201. package/dest/kernel/private_kernel_init_4_circuit_private_inputs.js +37 -0
  202. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts +25 -0
  203. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts.map +1 -0
  204. package/dest/kernel/private_kernel_init_5_circuit_private_inputs.js +39 -0
  205. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
  206. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
  207. package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
  208. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts +18 -0
  209. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts.map +1 -0
  210. package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.js +27 -0
  211. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts +19 -0
  212. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts.map +1 -0
  213. package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.js +29 -0
  214. package/dest/kernel/private_kernel_prover_output.d.ts +4 -1
  215. package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
  216. package/dest/kernel/private_kernel_prover_output.js +4 -1
  217. package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
  218. package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
  219. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
  220. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
  221. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
  222. package/dest/kernel/private_kernel_simulated_output.d.ts +1 -7
  223. package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
  224. package/dest/kernel/private_kernel_simulated_output.js +2 -1
  225. package/dest/kernel/private_log_data.d.ts +1 -1
  226. package/dest/kernel/private_log_data.d.ts.map +1 -1
  227. package/dest/kernel/private_log_data.js +1 -1
  228. package/dest/kernel/utils/index.d.ts +1 -2
  229. package/dest/kernel/utils/index.d.ts.map +1 -1
  230. package/dest/kernel/utils/index.js +0 -1
  231. package/dest/keys/derivation.d.ts +41 -5
  232. package/dest/keys/derivation.d.ts.map +1 -1
  233. package/dest/keys/derivation.js +53 -23
  234. package/dest/logs/app_tagging_secret.d.ts +30 -7
  235. package/dest/logs/app_tagging_secret.d.ts.map +1 -1
  236. package/dest/logs/app_tagging_secret.js +44 -28
  237. package/dest/logs/app_tagging_secret_kind.js +1 -1
  238. package/dest/logs/contract_class_log.d.ts +1 -2
  239. package/dest/logs/contract_class_log.d.ts.map +1 -1
  240. package/dest/logs/contract_class_log.js +0 -4
  241. package/dest/logs/message_context.d.ts +5 -15
  242. package/dest/logs/message_context.d.ts.map +1 -1
  243. package/dest/logs/message_context.js +1 -66
  244. package/dest/logs/pending_tagged_log.d.ts +6 -8
  245. package/dest/logs/pending_tagged_log.d.ts.map +1 -1
  246. package/dest/logs/pending_tagged_log.js +1 -31
  247. package/dest/logs/shared_secret_derivation.d.ts +19 -6
  248. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  249. package/dest/logs/shared_secret_derivation.js +26 -11
  250. package/dest/p2p/attestation_utils.d.ts +1 -1
  251. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  252. package/dest/p2p/attestation_utils.js +8 -1
  253. package/dest/p2p/checkpoint_attestation.d.ts +10 -1
  254. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  255. package/dest/p2p/checkpoint_attestation.js +10 -0
  256. package/dest/p2p/checkpoint_proposal.d.ts +2 -1
  257. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  258. package/dest/p2p/consensus_payload.d.ts +2 -1
  259. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  260. package/dest/p2p/index.d.ts +1 -2
  261. package/dest/p2p/index.d.ts.map +1 -1
  262. package/dest/p2p/index.js +0 -1
  263. package/dest/p2p/signature_utils.d.ts +10 -1
  264. package/dest/p2p/signature_utils.d.ts.map +1 -1
  265. package/dest/p2p/signature_utils.js +9 -1
  266. package/dest/rollup/avm_proof_data.d.ts +3 -3
  267. package/dest/rollup/avm_proof_data.d.ts.map +1 -1
  268. package/dest/rollup/checkpoint_header.d.ts +8 -3
  269. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  270. package/dest/rollup/checkpoint_header.js +20 -10
  271. package/dest/stats/stats.d.ts +2 -2
  272. package/dest/stats/stats.d.ts.map +1 -1
  273. package/dest/tests/factories.d.ts +1 -27
  274. package/dest/tests/factories.d.ts.map +1 -1
  275. package/dest/tests/factories.js +10 -45
  276. package/dest/tests/mocks.d.ts +1 -1
  277. package/dest/tests/mocks.d.ts.map +1 -1
  278. package/dest/tests/mocks.js +3 -2
  279. package/dest/timetable/budgets.d.ts +57 -0
  280. package/dest/timetable/budgets.d.ts.map +1 -0
  281. package/dest/timetable/budgets.js +56 -0
  282. package/dest/timetable/build_proposer_timetable.d.ts +21 -0
  283. package/dest/timetable/build_proposer_timetable.d.ts.map +1 -0
  284. package/dest/timetable/build_proposer_timetable.js +17 -0
  285. package/dest/timetable/consensus_timetable.d.ts +70 -0
  286. package/dest/timetable/consensus_timetable.d.ts.map +1 -0
  287. package/dest/timetable/consensus_timetable.js +89 -0
  288. package/dest/timetable/index.d.ts +5 -84
  289. package/dest/timetable/index.d.ts.map +1 -1
  290. package/dest/timetable/index.js +4 -209
  291. package/dest/timetable/proposer_timetable.d.ts +106 -0
  292. package/dest/timetable/proposer_timetable.d.ts.map +1 -0
  293. package/dest/timetable/proposer_timetable.js +132 -0
  294. package/dest/trees/nullifier_membership_witness.d.ts +5 -8
  295. package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
  296. package/dest/trees/nullifier_membership_witness.js +0 -9
  297. package/dest/trees/public_data_witness.d.ts +7 -17
  298. package/dest/trees/public_data_witness.d.ts.map +1 -1
  299. package/dest/trees/public_data_witness.js +0 -27
  300. package/dest/tx/execution_payload.d.ts +1 -1
  301. package/dest/tx/execution_payload.d.ts.map +1 -1
  302. package/dest/tx/execution_payload.js +1 -1
  303. package/dest/tx/fee_provider.d.ts +2 -2
  304. package/dest/tx/fee_provider.d.ts.map +1 -1
  305. package/dest/tx/global_variable_builder.d.ts +2 -12
  306. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  307. package/dest/tx/global_variables.js +2 -2
  308. package/dest/tx/index.d.ts +1 -2
  309. package/dest/tx/index.d.ts.map +1 -1
  310. package/dest/tx/index.js +0 -1
  311. package/dest/tx/private_tx_constant_data.d.ts +18 -2
  312. package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
  313. package/dest/tx/private_tx_constant_data.js +13 -4
  314. package/dest/tx/profiling.d.ts +1 -1
  315. package/dest/tx/profiling.d.ts.map +1 -1
  316. package/dest/tx/profiling.js +2 -0
  317. package/dest/tx/simulated_tx.d.ts +10 -6
  318. package/dest/tx/simulated_tx.d.ts.map +1 -1
  319. package/dest/tx/tx.d.ts +9 -1
  320. package/dest/tx/tx.d.ts.map +1 -1
  321. package/dest/tx/tx.js +15 -0
  322. package/dest/tx/validator/error_texts.d.ts +2 -2
  323. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  324. package/dest/tx/validator/error_texts.js +1 -1
  325. package/dest/world-state/world_state_revision.d.ts +1 -18
  326. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  327. package/dest/world-state/world_state_revision.js +0 -20
  328. package/package.json +8 -8
  329. package/src/abi/buffer.ts +13 -1
  330. package/src/avm/avm.ts +1 -1
  331. package/src/avm/index.ts +0 -5
  332. package/src/aztec-address/index.ts +36 -6
  333. package/src/block/attestation_info.ts +7 -2
  334. package/src/block/l2_block_source.ts +67 -13
  335. package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +207 -0
  336. package/src/block/l2_block_stream/index.ts +1 -0
  337. package/src/block/l2_block_stream/interfaces.ts +96 -10
  338. package/src/block/l2_block_stream/l2_block_stream.ts +216 -175
  339. package/src/block/l2_block_stream/l2_tips_memory_store.ts +12 -41
  340. package/src/block/l2_block_stream/l2_tips_store_base.ts +84 -93
  341. package/src/block/proposal/attestations_and_signers.ts +53 -7
  342. package/src/block/test/l2_tips_store_test_suite.ts +270 -28
  343. package/src/block/validate_block_result.ts +48 -2
  344. package/src/checkpoint/checkpoint.ts +2 -2
  345. package/src/checkpoint/index.ts +1 -0
  346. package/src/checkpoint/simulation_overrides.ts +171 -0
  347. package/src/checkpoint/validate.ts +16 -6
  348. package/src/config/index.ts +1 -0
  349. package/src/config/network-consensus-config.ts +291 -0
  350. package/src/config/sequencer-config.ts +36 -5
  351. package/src/contract/contract_address.ts +4 -3
  352. package/src/contract/contract_class.ts +3 -2
  353. package/src/contract/contract_instance.ts +62 -1
  354. package/src/contract/index.ts +0 -1
  355. package/src/contract/interfaces/contract_data_source.ts +2 -4
  356. package/src/contract/interfaces/contract_instance.ts +26 -8
  357. package/src/contract/interfaces/node-info.ts +11 -0
  358. package/src/contract/partial_address.ts +8 -2
  359. package/src/database-version/version_manager.ts +96 -6
  360. package/src/deserialization/index.ts +35 -2
  361. package/src/file-store/factory.ts +7 -0
  362. package/src/file-store/index.ts +1 -0
  363. package/src/file-store/memory.ts +94 -0
  364. package/src/gas/README.md +92 -0
  365. package/src/gas/gas_settings.ts +11 -21
  366. package/src/gas/index.ts +1 -0
  367. package/src/gas/tx_gas_limits.ts +123 -0
  368. package/src/ha-signing/config.ts +23 -5
  369. package/src/ha-signing/local_config.ts +20 -1
  370. package/src/interfaces/archiver.ts +8 -9
  371. package/src/interfaces/aztec-node-admin.ts +1 -1
  372. package/src/interfaces/aztec-node-debug.ts +54 -2
  373. package/src/interfaces/aztec-node.ts +121 -43
  374. package/src/interfaces/block-builder.ts +2 -0
  375. package/src/interfaces/chain_tips.ts +8 -16
  376. package/src/interfaces/checkpoint_parameter.ts +3 -3
  377. package/src/interfaces/client.ts +1 -0
  378. package/src/interfaces/configs.ts +27 -6
  379. package/src/interfaces/get_tx_by_hash_options.ts +14 -0
  380. package/src/interfaces/merkle_tree_operations.ts +8 -2
  381. package/src/interfaces/p2p.ts +29 -9
  382. package/src/interfaces/private_kernel_prover.ts +104 -13
  383. package/src/interfaces/prover-client.ts +1 -3
  384. package/src/interfaces/prover-node.ts +32 -17
  385. package/src/interfaces/proving-job.ts +3 -3
  386. package/src/interfaces/server.ts +0 -2
  387. package/src/interfaces/server_circuit_prover.ts +2 -2
  388. package/src/interfaces/validator.ts +11 -0
  389. package/src/interfaces/world_state.ts +14 -0
  390. package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
  391. package/src/kernel/hints/index.ts +0 -1
  392. package/src/kernel/hints/read_request.ts +1 -1
  393. package/src/kernel/index.ts +5 -1
  394. package/src/kernel/log_hash.ts +5 -2
  395. package/src/kernel/note_hash.ts +1 -1
  396. package/src/kernel/nullifier.ts +1 -1
  397. package/src/kernel/private_circuit_public_inputs.ts +12 -1
  398. package/src/kernel/private_context_inputs.ts +10 -3
  399. package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -7
  400. package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
  401. package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
  402. package/src/kernel/private_kernel_init_4_circuit_private_inputs.ts +52 -0
  403. package/src/kernel/private_kernel_init_5_circuit_private_inputs.ts +55 -0
  404. package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
  405. package/src/kernel/private_kernel_inner_4_circuit_private_inputs.ts +39 -0
  406. package/src/kernel/private_kernel_inner_5_circuit_private_inputs.ts +42 -0
  407. package/src/kernel/private_kernel_prover_output.ts +4 -0
  408. package/src/kernel/private_kernel_reset_dimensions.ts +15 -5
  409. package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
  410. package/src/kernel/private_kernel_simulated_output.ts +0 -7
  411. package/src/kernel/private_log_data.ts +4 -1
  412. package/src/kernel/utils/index.ts +0 -1
  413. package/src/keys/derivation.ts +71 -21
  414. package/src/logs/app_tagging_secret.ts +56 -24
  415. package/src/logs/app_tagging_secret_kind.ts +1 -1
  416. package/src/logs/contract_class_log.ts +0 -9
  417. package/src/logs/message_context.ts +7 -65
  418. package/src/logs/pending_tagged_log.ts +6 -33
  419. package/src/logs/shared_secret_derivation.ts +31 -15
  420. package/src/p2p/attestation_utils.ts +8 -1
  421. package/src/p2p/checkpoint_attestation.ts +12 -0
  422. package/src/p2p/index.ts +0 -1
  423. package/src/p2p/signature_utils.ts +9 -0
  424. package/src/rollup/avm_proof_data.ts +2 -2
  425. package/src/rollup/checkpoint_header.ts +16 -2
  426. package/src/stats/stats.ts +6 -2
  427. package/src/tests/factories.ts +13 -51
  428. package/src/tests/mocks.ts +7 -2
  429. package/src/timetable/README.md +609 -0
  430. package/src/timetable/budgets.ts +87 -0
  431. package/src/timetable/build_proposer_timetable.ts +42 -0
  432. package/src/timetable/consensus_timetable.ts +126 -0
  433. package/src/timetable/index.ts +4 -304
  434. package/src/timetable/proposer_timetable.ts +190 -0
  435. package/src/timetable/timetable-example.svg +108 -0
  436. package/src/trees/nullifier_membership_witness.ts +0 -11
  437. package/src/trees/public_data_witness.ts +0 -31
  438. package/src/tx/execution_payload.ts +2 -1
  439. package/src/tx/fee_provider.ts +1 -1
  440. package/src/tx/global_variable_builder.ts +1 -17
  441. package/src/tx/global_variables.ts +2 -2
  442. package/src/tx/index.ts +0 -1
  443. package/src/tx/private_tx_constant_data.ts +25 -2
  444. package/src/tx/profiling.ts +2 -0
  445. package/src/tx/tx.ts +17 -0
  446. package/src/tx/validator/error_texts.ts +2 -1
  447. package/src/world-state/world_state_revision.ts +0 -33
  448. package/dest/avm/contract_storage_read.d.ts +0 -58
  449. package/dest/avm/contract_storage_read.d.ts.map +0 -1
  450. package/dest/avm/contract_storage_read.js +0 -65
  451. package/dest/avm/contract_storage_update_request.d.ts +0 -65
  452. package/dest/avm/contract_storage_update_request.d.ts.map +0 -1
  453. package/dest/avm/contract_storage_update_request.js +0 -80
  454. package/dest/avm/public_call_stack_item_compressed.d.ts +0 -43
  455. package/dest/avm/public_call_stack_item_compressed.d.ts.map +0 -1
  456. package/dest/avm/public_call_stack_item_compressed.js +0 -70
  457. package/dest/avm/public_data_update_request.d.ts +0 -62
  458. package/dest/avm/public_data_update_request.d.ts.map +0 -1
  459. package/dest/avm/public_data_update_request.js +0 -67
  460. package/dest/avm/public_inner_call_request.d.ts +0 -50
  461. package/dest/avm/public_inner_call_request.d.ts.map +0 -1
  462. package/dest/avm/public_inner_call_request.js +0 -74
  463. package/dest/contract/deployment_info.d.ts +0 -24
  464. package/dest/contract/deployment_info.d.ts.map +0 -1
  465. package/dest/contract/deployment_info.js +0 -3
  466. package/dest/interfaces/epoch-prover.d.ts +0 -57
  467. package/dest/interfaces/epoch-prover.d.ts.map +0 -1
  468. package/dest/interfaces/epoch-prover.js +0 -1
  469. package/dest/interfaces/prover-coordination.d.ts +0 -15
  470. package/dest/interfaces/prover-coordination.d.ts.map +0 -1
  471. package/dest/interfaces/prover-coordination.js +0 -1
  472. package/dest/kernel/hints/tree_leaf_read_request.d.ts +0 -14
  473. package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +0 -1
  474. package/dest/kernel/hints/tree_leaf_read_request.js +0 -33
  475. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
  476. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
  477. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
  478. package/dest/kernel/utils/optional_number.d.ts +0 -31
  479. package/dest/kernel/utils/optional_number.d.ts.map +0 -1
  480. package/dest/kernel/utils/optional_number.js +0 -42
  481. package/dest/p2p/interface.d.ts +0 -5
  482. package/dest/p2p/interface.d.ts.map +0 -1
  483. package/dest/p2p/interface.js +0 -1
  484. package/dest/tx/validator/empty_validator.d.ts +0 -5
  485. package/dest/tx/validator/empty_validator.d.ts.map +0 -1
  486. package/dest/tx/validator/empty_validator.js +0 -7
  487. package/src/avm/contract_storage_read.ts +0 -77
  488. package/src/avm/contract_storage_update_request.ts +0 -93
  489. package/src/avm/public_call_stack_item_compressed.ts +0 -113
  490. package/src/avm/public_data_update_request.ts +0 -106
  491. package/src/avm/public_inner_call_request.ts +0 -85
  492. package/src/contract/deployment_info.ts +0 -25
  493. package/src/interfaces/epoch-prover.ts +0 -72
  494. package/src/interfaces/prover-coordination.ts +0 -17
  495. package/src/kernel/hints/tree_leaf_read_request.ts +0 -35
  496. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
  497. package/src/kernel/utils/optional_number.ts +0 -50
  498. package/src/p2p/interface.ts +0 -4
  499. package/src/tx/validator/empty_validator.ts +0 -7
@@ -1,84 +1,5 @@
1
- /**
2
- * Timetable constants used for sequencer timing calculations.
3
- * These define the time budgets for various phases of block production.
4
- *
5
- * The sequencer slot is divided into phases:
6
- * 1. Checkpoint initialization (sync + proposer check)
7
- * 2. Block building (execution)
8
- * 3. Checkpoint assembly
9
- * 4. P2P propagation for proposal and attestations (round-trip)
10
- * 5. L1 publishing
11
- */
12
- /** Time budget for checkpoint initialization (sync + proposer check) in seconds */
13
- export declare const CHECKPOINT_INITIALIZATION_TIME = 1;
14
- /** Time budget for assembling a checkpoint after building the last block in seconds */
15
- export declare const CHECKPOINT_ASSEMBLE_TIME = 1;
16
- /** Default one-way P2P propagation time for proposals and attestations in seconds */
17
- export declare const DEFAULT_P2P_PROPAGATION_TIME = 2;
18
- /** Default L1 publishing time (matches Ethereum slot duration on mainnet) in seconds */
19
- export declare const DEFAULT_L1_PUBLISHING_TIME = 12;
20
- /** Minimum execution time for building a block in seconds */
21
- export declare const MIN_EXECUTION_TIME = 2;
22
- export type CheckpointTimingConfig = {
23
- aztecSlotDuration: number;
24
- ethereumSlotDuration?: number;
25
- blockDuration?: number;
26
- checkpointAssembleTime?: number;
27
- checkpointInitializationTime?: number;
28
- l1PublishingTime?: number;
29
- minExecutionTime?: number;
30
- p2pPropagationTime?: number;
31
- };
32
- export interface CheckpointTiming {
33
- readonly aztecSlotDuration: number;
34
- readonly blockDuration: number | undefined;
35
- readonly checkpointAssembleTime: number;
36
- readonly checkpointInitializationTime: number;
37
- readonly l1PublishingTime: number;
38
- readonly minExecutionTime: number;
39
- readonly p2pPropagationTime: number;
40
- readonly checkpointFinalizationTime: number;
41
- readonly pipeliningAttestationGracePeriod: number;
42
- readonly timeReservedAtEnd: number;
43
- readonly minimumBuildSlotWork: number;
44
- readonly initializeDeadline: number;
45
- readonly checkpointAssemblyDeadline: number;
46
- readonly checkpointAttestationStartDeadline: number;
47
- readonly checkpointAttestationDeadline: number;
48
- readonly checkpointPublishingDeadline: number;
49
- calculateMaxBlocksPerSlot(): number;
50
- }
51
- export interface PipelinedCheckpointTiming extends CheckpointTiming {
52
- readonly proposalWindowIntoTargetSlot: number;
53
- readonly attestationWindowIntoTargetSlot: number;
54
- }
55
- /**
56
- * Creates a checkpoint timing model.
57
- *
58
- * Most callers should use this factory and depend only on the shared
59
- * `CheckpointTiming` interface.
60
- */
61
- export declare function createCheckpointTimingModel(opts: CheckpointTimingConfig): CheckpointTiming;
62
- /**
63
- * Creates a checkpoint timing model exposing the target-slot window accessors.
64
- *
65
- * Use this when the caller specifically needs the pipelined timing surface, such
66
- * as proposal or attestation acceptance windows into the target slot.
67
- */
68
- export declare function createPipelinedCheckpointTimingModel(opts: CheckpointTimingConfig): PipelinedCheckpointTiming;
69
- /**
70
- * Calculates the maximum number of blocks that can be built in a slot.
71
- * Used by both the sequencer timetable and p2p gossipsub scoring.
72
- *
73
- * @param aztecSlotDurationSec - Aztec slot duration in seconds
74
- * @param blockDurationSec - Duration per block in seconds (undefined = single block mode)
75
- * @param opts - Optional overrides for timing constants
76
- * @returns Maximum number of blocks per slot
77
- */
78
- export declare function calculateMaxBlocksPerSlot(aztecSlotDurationSec: number, blockDurationSec: number | undefined, opts?: {
79
- checkpointInitializationTime?: number;
80
- checkpointAssembleTime?: number;
81
- p2pPropagationTime?: number;
82
- l1PublishingTime?: number;
83
- }): number;
84
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90aW1ldGFibGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7R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UFBSSxHQUFFO0lBQ0osNEJBQTRCLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDdEMsc0JBQXNCLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDaEMsa0JBQWtCLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDNUIsZ0JBQWdCLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDdEIsR0FDTCxNQUFNLENBU1IifQ==
1
+ export * from './budgets.js';
2
+ export * from './build_proposer_timetable.js';
3
+ export * from './consensus_timetable.js';
4
+ export * from './proposer_timetable.js';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90aW1ldGFibGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMseUJBQXlCLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/timetable/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,mFAAmF;AACnF,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,qFAAqF;AACrF,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC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AED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,IAAI,EAAE,sBAAsB,GAAG,yBAAyB,CAO5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,oBAAoB,EAAE,MAAM,EAC5B,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,IAAI,GAAE;IACJ,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACtB,GACL,MAAM,CASR"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/timetable/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
@@ -1,209 +1,4 @@
1
- /**
2
- * Timetable constants used for sequencer timing calculations.
3
- * These define the time budgets for various phases of block production.
4
- *
5
- * The sequencer slot is divided into phases:
6
- * 1. Checkpoint initialization (sync + proposer check)
7
- * 2. Block building (execution)
8
- * 3. Checkpoint assembly
9
- * 4. P2P propagation for proposal and attestations (round-trip)
10
- * 5. L1 publishing
11
- */ /** Time budget for checkpoint initialization (sync + proposer check) in seconds */ export const CHECKPOINT_INITIALIZATION_TIME = 1;
12
- /** Time budget for assembling a checkpoint after building the last block in seconds */ export const CHECKPOINT_ASSEMBLE_TIME = 1;
13
- /** Default one-way P2P propagation time for proposals and attestations in seconds */ export const DEFAULT_P2P_PROPAGATION_TIME = 2;
14
- /** Default L1 publishing time (matches Ethereum slot duration on mainnet) in seconds */ export const DEFAULT_L1_PUBLISHING_TIME = 12;
15
- /** Minimum execution time for building a block in seconds */ export const MIN_EXECUTION_TIME = 2;
16
- /**
17
- * Checkpoint timing model for proposer pipelining.
18
- *
19
- * The build work starts at the wall-clock slot boundary and the checkpoint
20
- * proposal is broadcast early enough that attestations complete by the end of
21
- * the build slot. L1 submission can then be sent at the boundary of the target
22
- * slot. The target-slot window getters are intended for consumers such as P2P
23
- * validators that need to validate pipelined messages against wallclock time.
24
- */ class CheckpointTimingModel {
25
- aztecSlotDuration;
26
- blockDuration;
27
- checkpointAssembleTime;
28
- checkpointInitializationTime;
29
- l1PublishingTime;
30
- minExecutionTime;
31
- p2pPropagationTime;
32
- ethereumSlotDuration;
33
- constructor(opts){
34
- this.aztecSlotDuration = opts.aztecSlotDuration;
35
- this.blockDuration = opts.blockDuration;
36
- this.checkpointAssembleTime = opts.checkpointAssembleTime ?? CHECKPOINT_ASSEMBLE_TIME;
37
- this.checkpointInitializationTime = opts.checkpointInitializationTime ?? CHECKPOINT_INITIALIZATION_TIME;
38
- this.l1PublishingTime = opts.l1PublishingTime ?? DEFAULT_L1_PUBLISHING_TIME;
39
- this.minExecutionTime = opts.minExecutionTime ?? MIN_EXECUTION_TIME;
40
- this.p2pPropagationTime = opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME;
41
- this.ethereumSlotDuration = opts.ethereumSlotDuration ?? this.l1PublishingTime;
42
- }
43
- get checkpointFinalizationTime() {
44
- // Allow enough time to
45
- // - build the checkpoint
46
- // - Round-trip over p2p
47
- // - Publish to L1
48
- return this.checkpointAssembleTime + this.p2pPropagationTime * 2 + this.l1PublishingTime;
49
- }
50
- get proposalWindowIntoTargetSlot() {
51
- // Proposals no longer spill into the target slot: they are broadcast early
52
- // enough in the build slot that attestations complete before the boundary.
53
- // Any residual tolerance into the target slot is covered by clock disparity.
54
- return 0;
55
- }
56
- get attestationWindowIntoTargetSlot() {
57
- // Span from the target-slot start to the L1 publish deadline (12s before the last L1 block of
58
- // the target slot). The p2p layer accepts slot-N attestations until right before the publish
59
- // deadline so the proposer can keep collecting useful attestations up to the latest moment the
60
- // checkpoint can still land on L1 in the target slot.
61
- return Math.max(0, this.aztecSlotDuration - 2 * this.ethereumSlotDuration);
62
- }
63
- get pipeliningAttestationGracePeriod() {
64
- // Under the early-pipelining regime attestations complete inside the build slot itself. Local
65
- // networks can publish much faster than the Ethereum slot geometry, so they may use the target
66
- // slot attestation window without moving the L1 publish cutoff.
67
- return this.l1PublishingTime < this.ethereumSlotDuration ? this.attestationWindowIntoTargetSlot : 0;
68
- }
69
- get timeReservedAtEnd() {
70
- // Reserve enough time at the end of the build slot for:
71
- // - assembling and broadcasting the checkpoint proposal
72
- // - round-trip p2p propagation (proposal out, attestations back)
73
- // - validators re-executing the last block
74
- return this.checkpointAssembleTime + 2 * this.p2pPropagationTime + (this.blockDuration ?? 0);
75
- }
76
- get minimumBuildSlotWork() {
77
- return this.checkpointInitializationTime + this.minExecutionTime * 2;
78
- }
79
- get initializeDeadline() {
80
- return this.aztecSlotDuration - this.minimumBuildSlotWork;
81
- }
82
- get checkpointAssemblyDeadline() {
83
- // Allow enough time to build all blocks and receive attestations. With
84
- // `pipeliningAttestationGracePeriod = 0` this equals `aztecSlotDuration`.
85
- return this.aztecSlotDuration + this.pipeliningAttestationGracePeriod;
86
- }
87
- get checkpointAttestationStartDeadline() {
88
- return this.checkpointAssemblyDeadline;
89
- }
90
- get checkpointAttestationDeadline() {
91
- // L1 publish deadline — 12s (one Ethereum slot) before the last L1 block of the target L2 slot;
92
- // the latest the checkpoint can be submitted and still land on L1 in the target slot. This is an
93
- // L1-geometry bound (ethereumSlotDuration), matching the publisher's send lead in sendRequestsAt
94
- // (which also targets one Ethereum slot before the target slot start).
95
- return this.aztecSlotDuration * 2 - this.ethereumSlotDuration;
96
- }
97
- get checkpointPublishingDeadline() {
98
- // L1 publish deadline — 12s (one Ethereum slot) before the last L1 block of the target L2 slot;
99
- // the latest the checkpoint can be submitted and still land on L1 in the target slot.
100
- return this.aztecSlotDuration * 2 - this.ethereumSlotDuration;
101
- }
102
- calculateMaxBlocksPerSlot() {
103
- if (!this.blockDuration) {
104
- return 1;
105
- }
106
- const timeAvailableForBlocks = this.aztecSlotDuration - this.checkpointInitializationTime - this.timeReservedAtEnd;
107
- return Math.floor(timeAvailableForBlocks / this.blockDuration);
108
- }
109
- }
110
- /**
111
- * Creates a checkpoint timing model.
112
- *
113
- * Most callers should use this factory and depend only on the shared
114
- * `CheckpointTiming` interface.
115
- */ export function createCheckpointTimingModel(opts) {
116
- return createPipelinedCheckpointTimingModel(opts);
117
- }
118
- /**
119
- * Creates a checkpoint timing model exposing the target-slot window accessors.
120
- *
121
- * Use this when the caller specifically needs the pipelined timing surface, such
122
- * as proposal or attestation acceptance windows into the target slot.
123
- */ export function createPipelinedCheckpointTimingModel(opts) {
124
- validateCheckpointTimingConfig(opts);
125
- const normalizedOpts = normalizeCheckpointTimingConfig(opts);
126
- const timing = new CheckpointTimingModel(normalizedOpts);
127
- validateCheckpointTimingModel(timing);
128
- return timing;
129
- }
130
- /**
131
- * Calculates the maximum number of blocks that can be built in a slot.
132
- * Used by both the sequencer timetable and p2p gossipsub scoring.
133
- *
134
- * @param aztecSlotDurationSec - Aztec slot duration in seconds
135
- * @param blockDurationSec - Duration per block in seconds (undefined = single block mode)
136
- * @param opts - Optional overrides for timing constants
137
- * @returns Maximum number of blocks per slot
138
- */ export function calculateMaxBlocksPerSlot(aztecSlotDurationSec, blockDurationSec, opts = {}) {
139
- return createCheckpointTimingModel({
140
- aztecSlotDuration: aztecSlotDurationSec,
141
- blockDuration: blockDurationSec,
142
- checkpointAssembleTime: opts.checkpointAssembleTime,
143
- checkpointInitializationTime: opts.checkpointInitializationTime,
144
- l1PublishingTime: opts.l1PublishingTime,
145
- p2pPropagationTime: opts.p2pPropagationTime
146
- }).calculateMaxBlocksPerSlot();
147
- }
148
- function assertNonNegative(name, value) {
149
- if (value < 0) {
150
- throw new Error(`${name} must be non-negative (got ${value})`);
151
- }
152
- }
153
- function validateCheckpointTimingConfig(opts) {
154
- if (opts.aztecSlotDuration <= 0) {
155
- throw new Error(`aztecSlotDuration must be positive (got ${opts.aztecSlotDuration})`);
156
- }
157
- if (opts.ethereumSlotDuration !== undefined && opts.ethereumSlotDuration <= 0) {
158
- throw new Error(`ethereumSlotDuration must be positive when provided (got ${opts.ethereumSlotDuration})`);
159
- }
160
- if (opts.blockDuration !== undefined && opts.blockDuration <= 0) {
161
- throw new Error(`blockDuration must be positive when provided (got ${opts.blockDuration})`);
162
- }
163
- if (opts.minExecutionTime !== undefined && opts.minExecutionTime <= 0) {
164
- throw new Error(`minExecutionTime must be positive when provided (got ${opts.minExecutionTime})`);
165
- }
166
- if (opts.checkpointAssembleTime !== undefined) {
167
- assertNonNegative('checkpointAssembleTime', opts.checkpointAssembleTime);
168
- }
169
- if (opts.checkpointInitializationTime !== undefined) {
170
- assertNonNegative('checkpointInitializationTime', opts.checkpointInitializationTime);
171
- }
172
- if (opts.l1PublishingTime !== undefined) {
173
- assertNonNegative('l1PublishingTime', opts.l1PublishingTime);
174
- }
175
- if (opts.p2pPropagationTime !== undefined) {
176
- assertNonNegative('p2pPropagationTime', opts.p2pPropagationTime);
177
- }
178
- }
179
- function normalizeCheckpointTimingConfig(opts) {
180
- let checkpointAssembleTime = opts.checkpointAssembleTime ?? CHECKPOINT_ASSEMBLE_TIME;
181
- let checkpointInitializationTime = opts.checkpointInitializationTime ?? CHECKPOINT_INITIALIZATION_TIME;
182
- let minExecutionTime = opts.minExecutionTime ?? MIN_EXECUTION_TIME;
183
- let p2pPropagationTime = opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME;
184
- if (opts.ethereumSlotDuration !== undefined && opts.ethereumSlotDuration < 8) {
185
- p2pPropagationTime = 0;
186
- checkpointAssembleTime = 0.5;
187
- checkpointInitializationTime = 0.5;
188
- minExecutionTime = 1;
189
- }
190
- if (opts.blockDuration !== undefined && minExecutionTime > opts.blockDuration) {
191
- minExecutionTime = opts.blockDuration;
192
- }
193
- return {
194
- ...opts,
195
- checkpointAssembleTime,
196
- checkpointInitializationTime,
197
- minExecutionTime,
198
- p2pPropagationTime
199
- };
200
- }
201
- function validateCheckpointTimingModel(model) {
202
- if (model.blockDuration === undefined) {
203
- return;
204
- }
205
- const timeAvailableForBlocks = model.aztecSlotDuration - model.checkpointInitializationTime - model.timeReservedAtEnd;
206
- if (timeAvailableForBlocks < model.blockDuration) {
207
- throw new Error(`Invalid timing configuration: only ${timeAvailableForBlocks}s available for block building, which is less than one blockDuration (${model.blockDuration}s).`);
208
- }
209
- }
1
+ export * from './budgets.js';
2
+ export * from './build_proposer_timetable.js';
3
+ export * from './consensus_timetable.js';
4
+ export * from './proposer_timetable.js';
@@ -0,0 +1,106 @@
1
+ import type { SlotNumber } from '@aztec/foundation/branded-types';
2
+ import type { Logger } from '@aztec/foundation/log';
3
+ import { ConsensusTimetable, type SlotTimingConstants } from './consensus_timetable.js';
4
+ /** Result of selecting the next block sub-slot to build. */
5
+ export type SubslotSelection = {
6
+ canStart: false;
7
+ index: undefined;
8
+ deadline: undefined;
9
+ isLastBlock: false;
10
+ } | {
11
+ canStart: true;
12
+ index: number;
13
+ deadline: number;
14
+ isLastBlock: boolean;
15
+ };
16
+ /**
17
+ * Proposer ideal/happy-path schedule and block sub-slot timetable.
18
+ *
19
+ * Composes a {@link ConsensusTimetable} and adds the operational budgets that only the proposer needs
20
+ * (`min_block_duration`, `p2p_propagation_time`, `checkpoint_proposal_prepare_time`). Used by the
21
+ * sequencer and checkpoint-proposal job. All getters take a target slot and return an absolute
22
+ * wall-clock timestamp in seconds (or sub-slot deadlines in seconds for {@link selectNextSubslot}).
23
+ *
24
+ * The single hard deadline {@link getAttestationDeadline} is inherited from the composed
25
+ * {@link ConsensusTimetable}, so the proposer uses one object.
26
+ *
27
+ * `maxBlocksPerCheckpoint` is computed from the local operational budgets and then clamped down to the optional
28
+ * network-provided value when that value is lower; a network value at or above the computed count leaves the
29
+ * computed count in effect. When clamping down occurs and a logger is supplied, a warning is emitted.
30
+ */
31
+ export declare class ProposerTimetable extends ConsensusTimetable {
32
+ /** Minimum block-building time (`min_block_duration`) in seconds. */
33
+ readonly minBlockDuration: number;
34
+ /** One-way proposal/attestation propagation budget (`p2p_propagation_time`) in seconds. */
35
+ readonly p2pPropagationTime: number;
36
+ /** Local checkpoint proposal preparation budget (`checkpoint_proposal_prepare_time`) in seconds. */
37
+ readonly checkpointProposalPrepareTime: number;
38
+ /** Proposer initialization budget (`checkpoint_proposal_init_time`) reserved before the first sub-slot, in seconds. */
39
+ readonly checkpointProposalInitTime: number;
40
+ /**
41
+ * Effective maximum number of block sub-slots per checkpoint: the value the local operational budgets compute,
42
+ * clamped down to the explicit network value when that value is lower. A network value above the computed
43
+ * count has no effect (the computed count is used) and is not logged.
44
+ */
45
+ readonly maxBlocksPerCheckpoint: number;
46
+ constructor(opts: {
47
+ l1Constants: SlotTimingConstants;
48
+ blockDuration: number;
49
+ minBlockDuration: number;
50
+ p2pPropagationTime: number;
51
+ checkpointProposalPrepareTime: number;
52
+ checkpointProposalInitTime: number;
53
+ checkpointProposalSyncGrace?: number;
54
+ /** Explicit network max blocks per checkpoint; the effective value is clamped down to this when it is lower. */
55
+ maxBlocksPerCheckpoint?: number;
56
+ /** Optional logger; warns when the local budgets compute more blocks than the network value allows. */
57
+ logger?: Logger;
58
+ });
59
+ /**
60
+ * Computes the maximum number of full-duration block sub-slots in a checkpoint from the already-resolved
61
+ * budgets. Derived from the spec's `max_blocks_per_checkpoint = floor((last_block_build_time -
62
+ * first_subslot_start) / D)`, where the first sub-slot starts one `checkpoint_proposal_init_time` (`init`)
63
+ * after `build_frame_start`, so it simplifies to `floor((S - init - D - 2P - prepCp) / D)`.
64
+ */
65
+ private computeMaxBlocksPerCheckpoint;
66
+ /**
67
+ * Ideal time the last block must finish building by to make the ideal L1 publish path:
68
+ * `target_slot_start - E - D - 2P - prepCp` (= `checkpoint_proposal_send_time - prepCp`). Single value;
69
+ * the proposer sizes block production around the ideal L1-publish path only.
70
+ */
71
+ getLastBlockBuildTime(slot: SlotNumber): number;
72
+ /**
73
+ * Latest start at which the proposer can still squeeze in a minimum-duration block.
74
+ *
75
+ * Multi-block mode: `last_block_build_time - min_block_duration`, an ideal-derived cutoff
76
+ * intentionally earlier (by `P`) than the consensus receive gate would strictly allow, and
77
+ * conservatively no later than the final sub-slot's start cutoff in {@link selectNextSubslot}.
78
+ *
79
+ */
80
+ getBuildStartDeadline(slot: SlotNumber): number;
81
+ /** Ideal L1 publish/send time: `target_slot_start - E`. Also the ideal attestation-receipt target. */
82
+ getL1PublishIdealTime(slot: SlotNumber): number;
83
+ /**
84
+ * Build deadline for sub-slot `k` (zero-based): `build_frame_start + init + (k + 1) * D`.
85
+ *
86
+ * The `init` (`checkpoint_proposal_init_time`) offset reserves the proposer's sync/proposer-check/init
87
+ * budget at the start of the build frame, so the first sub-slot still has its full duration once the
88
+ * prologue finishes rather than being eaten by it.
89
+ */
90
+ getBlockBuildDeadline(slot: SlotNumber, blockIndex: number): number;
91
+ /** Latest time to keep waiting for txs for sub-slot `k`: `block_build_deadline(k) - min_block_duration`. */
92
+ getWaitForTxsDeadline(slot: SlotNumber, blockIndex: number): number;
93
+ /** Maximum number of full-duration block sub-slots for this timing config. */
94
+ getMaxBlocksPerCheckpoint(): number;
95
+ /**
96
+ * Selects the next block sub-slot to build for the target slot given the current wall-clock time.
97
+ *
98
+ * Scans sub-slots in order and picks the first whose build deadline is at least `min_block_duration`
99
+ * in the future. Sub-slots with insufficient remaining headroom are skipped.
100
+ *
101
+ * @param slot - Target slot the checkpoint commits to.
102
+ * @param now - Current wall-clock time in seconds.
103
+ */
104
+ selectNextSubslot(slot: SlotNumber, now: number): SubslotSelection;
105
+ }
106
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvcG9zZXJfdGltZXRhYmxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGltZXRhYmxlL3Byb3Bvc2VyX3RpbWV0YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxpQ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;QACvG,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,EAsCA;IAED;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAWrC;;;;OAIG;IACI,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQrD;IAED;;;;;;;OAOG;IACI,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAErD;IAED,sGAAsG;IAC/F,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAErD;IAED;;;;;;OAMG;IACI,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzE;IAED,4GAA4G;IACrG,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzE;IAED,8EAA8E;IACvE,yBAAyB,IAAI,MAAM,CAEzC;IAED;;;;;;;;OAQG;IACI,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAWxE;CACF"}
@@ -0,0 +1,132 @@
1
+ import { getDefaultCheckpointProposalSyncGrace, resolveTimingBudgets } from './budgets.js';
2
+ import { ConsensusTimetable } from './consensus_timetable.js';
3
+ /**
4
+ * Proposer ideal/happy-path schedule and block sub-slot timetable.
5
+ *
6
+ * Composes a {@link ConsensusTimetable} and adds the operational budgets that only the proposer needs
7
+ * (`min_block_duration`, `p2p_propagation_time`, `checkpoint_proposal_prepare_time`). Used by the
8
+ * sequencer and checkpoint-proposal job. All getters take a target slot and return an absolute
9
+ * wall-clock timestamp in seconds (or sub-slot deadlines in seconds for {@link selectNextSubslot}).
10
+ *
11
+ * The single hard deadline {@link getAttestationDeadline} is inherited from the composed
12
+ * {@link ConsensusTimetable}, so the proposer uses one object.
13
+ *
14
+ * `maxBlocksPerCheckpoint` is computed from the local operational budgets and then clamped down to the optional
15
+ * network-provided value when that value is lower; a network value at or above the computed count leaves the
16
+ * computed count in effect. When clamping down occurs and a logger is supplied, a warning is emitted.
17
+ */ export class ProposerTimetable extends ConsensusTimetable {
18
+ /** Minimum block-building time (`min_block_duration`) in seconds. */ minBlockDuration;
19
+ /** One-way proposal/attestation propagation budget (`p2p_propagation_time`) in seconds. */ p2pPropagationTime;
20
+ /** Local checkpoint proposal preparation budget (`checkpoint_proposal_prepare_time`) in seconds. */ checkpointProposalPrepareTime;
21
+ /** Proposer initialization budget (`checkpoint_proposal_init_time`) reserved before the first sub-slot, in seconds. */ checkpointProposalInitTime;
22
+ /**
23
+ * Effective maximum number of block sub-slots per checkpoint: the value the local operational budgets compute,
24
+ * clamped down to the explicit network value when that value is lower. A network value above the computed
25
+ * count has no effect (the computed count is used) and is not logged.
26
+ */ maxBlocksPerCheckpoint;
27
+ constructor(opts){
28
+ super({
29
+ l1Constants: opts.l1Constants,
30
+ blockDuration: opts.blockDuration,
31
+ checkpointProposalSyncGrace: opts.checkpointProposalSyncGrace ?? getDefaultCheckpointProposalSyncGrace(opts.blockDuration)
32
+ });
33
+ // Resolve operational budgets, applying the fast local/e2e profile for low ethereum slot durations so a
34
+ // fast network does not inherit the conservative production budgets (which would shrink the build window).
35
+ const budgets = resolveTimingBudgets(this.ethereumSlotDuration, {
36
+ minBlockDuration: opts.minBlockDuration,
37
+ p2pPropagationTime: opts.p2pPropagationTime,
38
+ checkpointProposalPrepareTime: opts.checkpointProposalPrepareTime,
39
+ checkpointProposalInitTime: opts.checkpointProposalInitTime
40
+ });
41
+ this.p2pPropagationTime = budgets.p2pPropagationTime;
42
+ this.checkpointProposalPrepareTime = budgets.checkpointProposalPrepareTime;
43
+ this.checkpointProposalInitTime = budgets.checkpointProposalInitTime;
44
+ // Clamp min block duration to the block duration so a single sub-slot is always startable.
45
+ this.minBlockDuration = Math.min(budgets.minBlockDuration, this.blockDuration);
46
+ const computed = this.computeMaxBlocksPerCheckpoint();
47
+ this.maxBlocksPerCheckpoint = opts.maxBlocksPerCheckpoint !== undefined ? Math.min(computed, opts.maxBlocksPerCheckpoint) : computed;
48
+ if (opts.maxBlocksPerCheckpoint !== undefined && opts.maxBlocksPerCheckpoint < computed) {
49
+ opts.logger?.warn(`Locally computed max blocks per checkpoint clamped down to the network-provided value`, {
50
+ computed,
51
+ maxBlocksPerCheckpoint: opts.maxBlocksPerCheckpoint
52
+ });
53
+ }
54
+ if (this.maxBlocksPerCheckpoint < 1) {
55
+ throw new Error(`Invalid timing configuration: derived ${this.maxBlocksPerCheckpoint} blocks per checkpoint for ` + `slot duration ${this.aztecSlotDuration}s and block duration ${this.blockDuration}s.`);
56
+ }
57
+ }
58
+ /**
59
+ * Computes the maximum number of full-duration block sub-slots in a checkpoint from the already-resolved
60
+ * budgets. Derived from the spec's `max_blocks_per_checkpoint = floor((last_block_build_time -
61
+ * first_subslot_start) / D)`, where the first sub-slot starts one `checkpoint_proposal_init_time` (`init`)
62
+ * after `build_frame_start`, so it simplifies to `floor((S - init - D - 2P - prepCp) / D)`.
63
+ */ computeMaxBlocksPerCheckpoint() {
64
+ // last_block_build_time - (build_frame_start + init) = S - init - D - 2P - prepCp.
65
+ const timeAvailableForBlocks = this.aztecSlotDuration - this.checkpointProposalInitTime - this.blockDuration - 2 * this.p2pPropagationTime - this.checkpointProposalPrepareTime;
66
+ return Math.floor(timeAvailableForBlocks / this.blockDuration);
67
+ }
68
+ /**
69
+ * Ideal time the last block must finish building by to make the ideal L1 publish path:
70
+ * `target_slot_start - E - D - 2P - prepCp` (= `checkpoint_proposal_send_time - prepCp`). Single value;
71
+ * the proposer sizes block production around the ideal L1-publish path only.
72
+ */ getLastBlockBuildTime(slot) {
73
+ return this.getTargetSlotStart(slot) - this.ethereumSlotDuration - this.blockDuration - 2 * this.p2pPropagationTime - this.checkpointProposalPrepareTime;
74
+ }
75
+ /**
76
+ * Latest start at which the proposer can still squeeze in a minimum-duration block.
77
+ *
78
+ * Multi-block mode: `last_block_build_time - min_block_duration`, an ideal-derived cutoff
79
+ * intentionally earlier (by `P`) than the consensus receive gate would strictly allow, and
80
+ * conservatively no later than the final sub-slot's start cutoff in {@link selectNextSubslot}.
81
+ *
82
+ */ getBuildStartDeadline(slot) {
83
+ return this.getLastBlockBuildTime(slot) - this.minBlockDuration;
84
+ }
85
+ /** Ideal L1 publish/send time: `target_slot_start - E`. Also the ideal attestation-receipt target. */ getL1PublishIdealTime(slot) {
86
+ return this.getTargetSlotStart(slot) - this.ethereumSlotDuration;
87
+ }
88
+ /**
89
+ * Build deadline for sub-slot `k` (zero-based): `build_frame_start + init + (k + 1) * D`.
90
+ *
91
+ * The `init` (`checkpoint_proposal_init_time`) offset reserves the proposer's sync/proposer-check/init
92
+ * budget at the start of the build frame, so the first sub-slot still has its full duration once the
93
+ * prologue finishes rather than being eaten by it.
94
+ */ getBlockBuildDeadline(slot, blockIndex) {
95
+ return this.getBuildFrameStart(slot) + this.checkpointProposalInitTime + (blockIndex + 1) * this.blockDuration;
96
+ }
97
+ /** Latest time to keep waiting for txs for sub-slot `k`: `block_build_deadline(k) - min_block_duration`. */ getWaitForTxsDeadline(slot, blockIndex) {
98
+ return this.getBlockBuildDeadline(slot, blockIndex) - this.minBlockDuration;
99
+ }
100
+ /** Maximum number of full-duration block sub-slots for this timing config. */ getMaxBlocksPerCheckpoint() {
101
+ return this.maxBlocksPerCheckpoint;
102
+ }
103
+ /**
104
+ * Selects the next block sub-slot to build for the target slot given the current wall-clock time.
105
+ *
106
+ * Scans sub-slots in order and picks the first whose build deadline is at least `min_block_duration`
107
+ * in the future. Sub-slots with insufficient remaining headroom are skipped.
108
+ *
109
+ * @param slot - Target slot the checkpoint commits to.
110
+ * @param now - Current wall-clock time in seconds.
111
+ */ selectNextSubslot(slot, now) {
112
+ const maxBlocks = this.maxBlocksPerCheckpoint;
113
+ for(let index = 0; index < maxBlocks; index++){
114
+ const deadline = this.getBlockBuildDeadline(slot, index);
115
+ if (deadline - now >= this.minBlockDuration) {
116
+ const isLastBlock = index === maxBlocks - 1;
117
+ return {
118
+ canStart: true,
119
+ index,
120
+ deadline,
121
+ isLastBlock
122
+ };
123
+ }
124
+ }
125
+ return {
126
+ canStart: false,
127
+ index: undefined,
128
+ deadline: undefined,
129
+ isLastBlock: false
130
+ };
131
+ }
132
+ }
@@ -1,5 +1,4 @@
1
1
  import { NULLIFIER_TREE_HEIGHT } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/curves/bn254';
3
2
  import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
4
3
  import { z } from 'zod';
5
4
  import { NullifierLeafPreimage } from './nullifier_leaf.js';
@@ -39,15 +38,15 @@ export declare class NullifierMembershipWitness {
39
38
  index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
40
39
  leafPreimage: z.ZodPipe<z.ZodObject<{
41
40
  leaf: z.ZodPipe<z.ZodObject<{
42
- nullifier: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
41
+ nullifier: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
43
42
  }, z.core.$strip>, z.ZodTransform<import("./nullifier_leaf.js").NullifierLeaf, {
44
- nullifier: Fr;
43
+ nullifier: import("@aztec/foundation/schemas").Fr;
45
44
  }>>;
46
- nextKey: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
45
+ nextKey: z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>;
47
46
  nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
48
47
  }, z.core.$strip>, z.ZodTransform<NullifierLeafPreimage, {
49
48
  leaf: import("./nullifier_leaf.js").NullifierLeaf;
50
- nextKey: Fr;
49
+ nextKey: import("@aztec/foundation/schemas").Fr;
51
50
  nextIndex: bigint;
52
51
  }>>;
53
52
  siblingPath: z.ZodPipe<import("../schemas/index.js").ZodFor<Buffer<ArrayBufferLike>>, z.ZodTransform<SiblingPath<42>, Buffer<ArrayBufferLike>>>;
@@ -58,7 +57,5 @@ export declare class NullifierMembershipWitness {
58
57
  }>>;
59
58
  static random(): NullifierMembershipWitness;
60
59
  withoutPreimage(): MembershipWitness<typeof NULLIFIER_TREE_HEIGHT>;
61
- /** Serializes as `(NullifierLeafPreimage, MembershipWitness)` to match the Noir oracle return type. */
62
- toNoirRepresentation(): (string | string[])[];
63
60
  }
64
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVsbGlmaWVyX21lbWJlcnNoaXBfd2l0bmVzcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3RyZWVzL251bGxpZmllcl9tZW1iZXJzaGlwX3dpdG5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDekQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxXQUFXLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUV6RSxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sS0FBSyxDQUFDO0FBR3hCLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRTVEOzs7OztHQUtHO0FBQ0gscUJBQWEsMEJBQTBCO0lBRW5DOztPQUVHO2FBQ2EsS0FBSyxFQUFFLE1BQU07SUFDN0I7O09BRUc7YUFDYSxZQUFZLEVBQUUscUJBQXFCO0lBQ25EOztPQUVHO2FBQ2EsV0FBVyxFQUFFLFdBQVcsQ0FBQyxPQUFPLHFCQUFxQixDQUFDO0lBWnhFO0lBQ0U7O09BRUc7SUFDYSxL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hB;IAED,MAAM,CAAC,MAAM,+BAMZ;IAEM,eAAe,IAAI,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAExE;IAED,uGAAuG;IAChG,oBAAoB,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAOnD;CACF"}
1
+ {"version":3,"file":"nullifier_membership_witness.d.ts","sourceRoot":"","sources":["../../src/trees/nullifier_membership_witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;GAKG;AACH,qBAAa,0BAA0B;IAEnC;;OAEG;aACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;aACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;aACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC;IAZxE;IACE;;OAEG;IACa,KAAK,EAAE,MAAM;IAC7B;;OAEG;IACa,YAAY,EAAE,qBAAqB;IACnD;;OAEG;IACa,WAAW,EAAE,WAAW,CAAC,OAAO,qBAAqB,CAAC,EACpE;IAEJ,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;QAUhB;IAED,MAAM,CAAC,MAAM,+BAMZ;IAEM,eAAe,IAAI,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAExE;CACF"}
@@ -1,5 +1,4 @@
1
1
  import { NULLIFIER_TREE_HEIGHT } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/curves/bn254';
3
2
  import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
4
3
  import { z } from 'zod';
5
4
  import { schemas } from '../schemas/index.js';
@@ -37,12 +36,4 @@ import { NullifierLeafPreimage } from './nullifier_leaf.js';
37
36
  withoutPreimage() {
38
37
  return new MembershipWitness(NULLIFIER_TREE_HEIGHT, this.index, this.siblingPath.toTuple());
39
38
  }
40
- /** Serializes as `(NullifierLeafPreimage, MembershipWitness)` to match the Noir oracle return type. */ toNoirRepresentation() {
41
- // TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
42
- return [
43
- ...this.leafPreimage.toFields().map((fr)=>fr.toString()),
44
- new Fr(this.index).toString(),
45
- this.siblingPath.toFields().map((fr)=>fr.toString())
46
- ];
47
- }
48
39
  }