@aztec/stdlib 0.0.1-commit.936cb2cae → 0.0.1-commit.949a33fd8

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 (353) hide show
  1. package/dest/abi/authorization_selector.d.ts +3 -6
  2. package/dest/abi/authorization_selector.d.ts.map +1 -1
  3. package/dest/abi/encoder.d.ts +1 -1
  4. package/dest/abi/encoder.d.ts.map +1 -1
  5. package/dest/abi/encoder.js +32 -6
  6. package/dest/abi/event_selector.d.ts +3 -6
  7. package/dest/abi/event_selector.d.ts.map +1 -1
  8. package/dest/abi/function_selector.d.ts +3 -6
  9. package/dest/abi/function_selector.d.ts.map +1 -1
  10. package/dest/abi/function_selector.js +1 -3
  11. package/dest/abi/note_selector.d.ts +3 -6
  12. package/dest/abi/note_selector.d.ts.map +1 -1
  13. package/dest/abi/note_selector.js +1 -3
  14. package/dest/abi/selector.d.ts +2 -2
  15. package/dest/abi/selector.d.ts.map +1 -1
  16. package/dest/abi/selector.js +1 -1
  17. package/dest/avm/revert_code.d.ts +8 -18
  18. package/dest/avm/revert_code.d.ts.map +1 -1
  19. package/dest/avm/revert_code.js +15 -30
  20. package/dest/aztec-address/index.d.ts +3 -6
  21. package/dest/aztec-address/index.d.ts.map +1 -1
  22. package/dest/aztec-address/index.js +2 -4
  23. package/dest/block/attestation_info.d.ts +3 -2
  24. package/dest/block/attestation_info.d.ts.map +1 -1
  25. package/dest/block/attestation_info.js +7 -5
  26. package/dest/block/block_data.d.ts +297 -8
  27. package/dest/block/block_data.d.ts.map +1 -1
  28. package/dest/block/block_data.js +16 -2
  29. package/dest/block/block_hash.d.ts +11 -10
  30. package/dest/block/block_hash.d.ts.map +1 -1
  31. package/dest/block/block_hash.js +10 -9
  32. package/dest/block/block_parameter.d.ts +30 -3
  33. package/dest/block/block_parameter.d.ts.map +1 -1
  34. package/dest/block/block_parameter.js +36 -2
  35. package/dest/block/l2_block_info.d.ts +6 -5
  36. package/dest/block/l2_block_info.d.ts.map +1 -1
  37. package/dest/block/l2_block_info.js +6 -5
  38. package/dest/block/l2_block_source.d.ts +116 -4
  39. package/dest/block/l2_block_source.d.ts.map +1 -1
  40. package/dest/block/l2_block_source.js +1 -0
  41. package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
  42. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  43. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
  44. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  45. package/dest/block/l2_block_stream/l2_tips_store_base.js +18 -5
  46. package/dest/block/proposal/attestations_and_signers.d.ts +13 -6
  47. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  48. package/dest/block/proposal/attestations_and_signers.js +26 -18
  49. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  50. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  51. package/dest/block/test/l2_tips_store_test_suite.js +4 -3
  52. package/dest/checkpoint/checkpoint.d.ts +7 -1
  53. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  54. package/dest/checkpoint/checkpoint.js +9 -1
  55. package/dest/checkpoint/checkpoint_data.d.ts +77 -5
  56. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  57. package/dest/checkpoint/checkpoint_data.js +12 -0
  58. package/dest/config/chain-config.d.ts +2 -2
  59. package/dest/config/chain-config.d.ts.map +1 -1
  60. package/dest/config/chain-config.js +9 -3
  61. package/dest/config/sequencer-config.d.ts +3 -3
  62. package/dest/config/sequencer-config.d.ts.map +1 -1
  63. package/dest/config/sequencer-config.js +11 -4
  64. package/dest/contract/contract_address.d.ts +1 -1
  65. package/dest/contract/contract_address.js +2 -2
  66. package/dest/contract/private_function.d.ts +1 -1
  67. package/dest/contract/private_function.d.ts.map +1 -1
  68. package/dest/contract/private_function.js +2 -4
  69. package/dest/epoch-helpers/index.d.ts +3 -1
  70. package/dest/epoch-helpers/index.d.ts.map +1 -1
  71. package/dest/epoch-helpers/index.js +3 -0
  72. package/dest/gas/fee_math.d.ts +49 -0
  73. package/dest/gas/fee_math.d.ts.map +1 -0
  74. package/dest/gas/fee_math.js +80 -0
  75. package/dest/gas/gas_fees.d.ts +5 -1
  76. package/dest/gas/gas_fees.d.ts.map +1 -1
  77. package/dest/gas/gas_fees.js +10 -1
  78. package/dest/gas/gas_settings.d.ts +40 -3
  79. package/dest/gas/gas_settings.d.ts.map +1 -1
  80. package/dest/gas/gas_settings.js +50 -6
  81. package/dest/gas/index.d.ts +2 -1
  82. package/dest/gas/index.d.ts.map +1 -1
  83. package/dest/gas/index.js +1 -0
  84. package/dest/ha-signing/config.d.ts +6 -6
  85. package/dest/ha-signing/config.d.ts.map +1 -1
  86. package/dest/ha-signing/config.js +4 -3
  87. package/dest/ha-signing/index.d.ts +2 -2
  88. package/dest/ha-signing/index.d.ts.map +1 -1
  89. package/dest/ha-signing/index.js +1 -1
  90. package/dest/ha-signing/local_config.d.ts +1 -1
  91. package/dest/ha-signing/local_config.d.ts.map +1 -1
  92. package/dest/ha-signing/local_config.js +2 -2
  93. package/dest/ha-signing/types.d.ts +37 -32
  94. package/dest/ha-signing/types.d.ts.map +1 -1
  95. package/dest/ha-signing/types.js +13 -6
  96. package/dest/hash/hash.d.ts +16 -1
  97. package/dest/hash/hash.d.ts.map +1 -1
  98. package/dest/hash/hash.js +32 -0
  99. package/dest/interfaces/archiver.d.ts +11 -1
  100. package/dest/interfaces/archiver.d.ts.map +1 -1
  101. package/dest/interfaces/archiver.js +11 -3
  102. package/dest/interfaces/aztec-node-admin.d.ts +19 -14
  103. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  104. package/dest/interfaces/aztec-node-admin.js +5 -4
  105. package/dest/interfaces/aztec-node-debug.d.ts +21 -0
  106. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
  107. package/dest/interfaces/aztec-node-debug.js +18 -0
  108. package/dest/interfaces/aztec-node.d.ts +54 -55
  109. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  110. package/dest/interfaces/aztec-node.js +20 -16
  111. package/dest/interfaces/block_response.d.ts +156 -0
  112. package/dest/interfaces/block_response.d.ts.map +1 -0
  113. package/dest/interfaces/block_response.js +24 -0
  114. package/dest/interfaces/chain_tips.d.ts +304 -0
  115. package/dest/interfaces/chain_tips.d.ts.map +1 -0
  116. package/dest/interfaces/chain_tips.js +11 -0
  117. package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
  118. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
  119. package/dest/interfaces/checkpoint_parameter.js +20 -0
  120. package/dest/interfaces/checkpoint_response.d.ts +312 -0
  121. package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
  122. package/dest/interfaces/checkpoint_response.js +26 -0
  123. package/dest/interfaces/client.d.ts +7 -1
  124. package/dest/interfaces/client.d.ts.map +1 -1
  125. package/dest/interfaces/client.js +6 -0
  126. package/dest/interfaces/configs.d.ts +7 -2
  127. package/dest/interfaces/configs.d.ts.map +1 -1
  128. package/dest/interfaces/configs.js +2 -1
  129. package/dest/interfaces/l1_publish_info.d.ts +43 -0
  130. package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
  131. package/dest/interfaces/l1_publish_info.js +26 -0
  132. package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
  133. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  134. package/dest/interfaces/prover-client.d.ts +1 -1
  135. package/dest/interfaces/prover-client.d.ts.map +1 -1
  136. package/dest/interfaces/prover-client.js +0 -3
  137. package/dest/interfaces/proving-job.d.ts +166 -166
  138. package/dest/interfaces/server.d.ts +6 -1
  139. package/dest/interfaces/server.d.ts.map +1 -1
  140. package/dest/interfaces/server.js +5 -0
  141. package/dest/interfaces/slasher.d.ts +1 -10
  142. package/dest/interfaces/slasher.d.ts.map +1 -1
  143. package/dest/interfaces/slasher.js +0 -2
  144. package/dest/interfaces/validator.d.ts +23 -17
  145. package/dest/interfaces/validator.d.ts.map +1 -1
  146. package/dest/interfaces/validator.js +1 -0
  147. package/dest/l1-contracts/index.d.ts +2 -2
  148. package/dest/l1-contracts/index.d.ts.map +1 -1
  149. package/dest/l1-contracts/index.js +1 -1
  150. package/dest/logs/extended_directional_app_tagging_secret.d.ts +4 -4
  151. package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -1
  152. package/dest/logs/extended_directional_app_tagging_secret.js +12 -5
  153. package/dest/logs/log_id.d.ts +1 -1
  154. package/dest/logs/log_id.d.ts.map +1 -1
  155. package/dest/logs/log_id.js +1 -2
  156. package/dest/logs/siloed_tag.d.ts +5 -7
  157. package/dest/logs/siloed_tag.d.ts.map +1 -1
  158. package/dest/logs/siloed_tag.js +4 -0
  159. package/dest/logs/tag.d.ts +5 -6
  160. package/dest/logs/tag.d.ts.map +1 -1
  161. package/dest/logs/tag.js +4 -0
  162. package/dest/p2p/block_proposal.d.ts +22 -14
  163. package/dest/p2p/block_proposal.d.ts.map +1 -1
  164. package/dest/p2p/block_proposal.js +45 -40
  165. package/dest/p2p/checkpoint_attestation.d.ts +10 -8
  166. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  167. package/dest/p2p/checkpoint_attestation.js +17 -24
  168. package/dest/p2p/checkpoint_proposal.d.ts +20 -14
  169. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  170. package/dest/p2p/checkpoint_proposal.js +34 -51
  171. package/dest/p2p/consensus_payload.d.ts +18 -7
  172. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  173. package/dest/p2p/consensus_payload.js +31 -19
  174. package/dest/p2p/gossipable.d.ts +4 -4
  175. package/dest/p2p/gossipable.d.ts.map +1 -1
  176. package/dest/p2p/signature_utils.d.ts +28 -19
  177. package/dest/p2p/signature_utils.d.ts.map +1 -1
  178. package/dest/p2p/signature_utils.js +118 -21
  179. package/dest/p2p/signed_txs.d.ts +15 -13
  180. package/dest/p2p/signed_txs.d.ts.map +1 -1
  181. package/dest/p2p/signed_txs.js +26 -24
  182. package/dest/parity/parity_base_private_inputs.d.ts +7 -3
  183. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  184. package/dest/parity/parity_base_private_inputs.js +7 -5
  185. package/dest/parity/parity_public_inputs.d.ts +7 -3
  186. package/dest/parity/parity_public_inputs.d.ts.map +1 -1
  187. package/dest/parity/parity_public_inputs.js +6 -3
  188. package/dest/rollup/block_headers_hash.d.ts +1 -1
  189. package/dest/rollup/block_headers_hash.d.ts.map +1 -1
  190. package/dest/rollup/block_headers_hash.js +8 -2
  191. package/dest/slashing/index.d.ts +2 -3
  192. package/dest/slashing/index.d.ts.map +1 -1
  193. package/dest/slashing/index.js +1 -2
  194. package/dest/slashing/serialization.d.ts +2 -6
  195. package/dest/slashing/serialization.d.ts.map +1 -1
  196. package/dest/slashing/serialization.js +0 -60
  197. package/dest/slashing/types.d.ts +4 -90
  198. package/dest/slashing/types.d.ts.map +1 -1
  199. package/dest/slashing/types.js +0 -14
  200. package/dest/slashing/{tally.d.ts → votes.d.ts} +1 -1
  201. package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
  202. package/dest/slashing/{tally.js → votes.js} +1 -1
  203. package/dest/tests/factories.d.ts +2 -7
  204. package/dest/tests/factories.d.ts.map +1 -1
  205. package/dest/tests/factories.js +19 -19
  206. package/dest/tests/mocks.d.ts +7 -1
  207. package/dest/tests/mocks.d.ts.map +1 -1
  208. package/dest/tests/mocks.js +39 -30
  209. package/dest/timetable/index.d.ts +51 -1
  210. package/dest/timetable/index.d.ts.map +1 -1
  211. package/dest/timetable/index.js +218 -14
  212. package/dest/trees/nullifier_leaf.d.ts +2 -1
  213. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  214. package/dest/trees/nullifier_leaf.js +3 -0
  215. package/dest/tx/block_header.d.ts +2 -2
  216. package/dest/tx/block_header.d.ts.map +1 -1
  217. package/dest/tx/block_header.js +1 -1
  218. package/dest/tx/fee_provider.d.ts +10 -0
  219. package/dest/tx/fee_provider.d.ts.map +1 -0
  220. package/dest/tx/fee_provider.js +1 -0
  221. package/dest/tx/global_variable_builder.d.ts +3 -4
  222. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  223. package/dest/tx/index.d.ts +2 -1
  224. package/dest/tx/index.d.ts.map +1 -1
  225. package/dest/tx/index.js +1 -0
  226. package/dest/tx/indexed_tx_effect.d.ts +1 -1
  227. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  228. package/dest/tx/indexed_tx_effect.js +1 -2
  229. package/dest/tx/profiling.js +4 -4
  230. package/dest/tx/simulated_tx.d.ts +4 -4
  231. package/dest/tx/simulated_tx.d.ts.map +1 -1
  232. package/dest/tx/simulated_tx.js +3 -3
  233. package/dest/tx/tx.d.ts +3 -3
  234. package/dest/tx/tx.d.ts.map +1 -1
  235. package/dest/tx/tx_receipt.d.ts +8 -4
  236. package/dest/tx/tx_receipt.d.ts.map +1 -1
  237. package/dest/tx/tx_receipt.js +8 -15
  238. package/dest/types/shared.d.ts +1 -10
  239. package/dest/types/shared.d.ts.map +1 -1
  240. package/dest/types/shared.js +0 -9
  241. package/dest/vks/verification_key.d.ts +2 -137
  242. package/dest/vks/verification_key.d.ts.map +1 -1
  243. package/dest/vks/verification_key.js +5 -126
  244. package/dest/world-state/genesis_data.d.ts +11 -0
  245. package/dest/world-state/genesis_data.d.ts.map +1 -0
  246. package/dest/world-state/genesis_data.js +4 -0
  247. package/dest/world-state/index.d.ts +2 -1
  248. package/dest/world-state/index.d.ts.map +1 -1
  249. package/dest/world-state/index.js +1 -0
  250. package/dest/world-state/world_state_revision.d.ts +8 -1
  251. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  252. package/dest/world-state/world_state_revision.js +7 -1
  253. package/package.json +8 -8
  254. package/src/abi/authorization_selector.ts +2 -8
  255. package/src/abi/encoder.ts +42 -6
  256. package/src/abi/event_selector.ts +2 -8
  257. package/src/abi/function_selector.ts +3 -12
  258. package/src/abi/note_selector.ts +3 -12
  259. package/src/abi/selector.ts +1 -1
  260. package/src/avm/revert_code.ts +25 -39
  261. package/src/aztec-address/index.ts +4 -10
  262. package/src/block/attestation_info.ts +11 -11
  263. package/src/block/block_data.ts +20 -4
  264. package/src/block/block_hash.ts +21 -14
  265. package/src/block/block_parameter.ts +35 -2
  266. package/src/block/l2_block_info.ts +8 -6
  267. package/src/block/l2_block_source.ts +51 -3
  268. package/src/block/l2_block_stream/interfaces.ts +6 -2
  269. package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
  270. package/src/block/proposal/attestations_and_signers.ts +32 -17
  271. package/src/block/test/l2_tips_store_test_suite.ts +9 -2
  272. package/src/checkpoint/checkpoint.ts +11 -1
  273. package/src/checkpoint/checkpoint_data.ts +44 -4
  274. package/src/config/chain-config.ts +9 -4
  275. package/src/config/sequencer-config.ts +20 -6
  276. package/src/contract/contract_address.ts +2 -2
  277. package/src/contract/private_function.ts +3 -1
  278. package/src/epoch-helpers/index.ts +5 -0
  279. package/src/gas/README.md +31 -0
  280. package/src/gas/fee_math.ts +120 -0
  281. package/src/gas/gas_fees.ts +17 -4
  282. package/src/gas/gas_settings.ts +65 -12
  283. package/src/gas/index.ts +1 -0
  284. package/src/ha-signing/config.ts +5 -2
  285. package/src/ha-signing/index.ts +3 -1
  286. package/src/ha-signing/local_config.ts +2 -2
  287. package/src/ha-signing/types.ts +48 -34
  288. package/src/hash/hash.ts +27 -0
  289. package/src/interfaces/archiver.ts +22 -2
  290. package/src/interfaces/aztec-node-admin.ts +8 -8
  291. package/src/interfaces/aztec-node-debug.ts +40 -0
  292. package/src/interfaces/aztec-node.ts +120 -95
  293. package/src/interfaces/block_response.ts +79 -0
  294. package/src/interfaces/chain_tips.ts +24 -0
  295. package/src/interfaces/checkpoint_parameter.ts +22 -0
  296. package/src/interfaces/checkpoint_response.ts +84 -0
  297. package/src/interfaces/client.ts +6 -0
  298. package/src/interfaces/configs.ts +5 -1
  299. package/src/interfaces/l1_publish_info.ts +40 -0
  300. package/src/interfaces/merkle_tree_operations.ts +3 -2
  301. package/src/interfaces/prover-client.ts +2 -5
  302. package/src/interfaces/server.ts +5 -0
  303. package/src/interfaces/slasher.ts +0 -6
  304. package/src/interfaces/validator.ts +20 -8
  305. package/src/l1-contracts/index.ts +1 -1
  306. package/src/logs/extended_directional_app_tagging_secret.ts +19 -8
  307. package/src/logs/log_id.ts +1 -2
  308. package/src/logs/siloed_tag.ts +8 -9
  309. package/src/logs/tag.ts +8 -8
  310. package/src/p2p/block_proposal.ts +96 -36
  311. package/src/p2p/checkpoint_attestation.ts +20 -29
  312. package/src/p2p/checkpoint_proposal.ts +88 -71
  313. package/src/p2p/consensus_payload.ts +50 -28
  314. package/src/p2p/gossipable.ts +4 -4
  315. package/src/p2p/signature_utils.ts +110 -25
  316. package/src/p2p/signed_txs.ts +46 -28
  317. package/src/parity/parity_base_private_inputs.ts +10 -4
  318. package/src/parity/parity_public_inputs.ts +9 -2
  319. package/src/rollup/block_headers_hash.ts +11 -2
  320. package/src/slashing/index.ts +1 -2
  321. package/src/slashing/serialization.ts +1 -81
  322. package/src/slashing/types.ts +3 -35
  323. package/src/slashing/{tally.ts → votes.ts} +1 -1
  324. package/src/tests/factories.ts +19 -21
  325. package/src/tests/mocks.ts +63 -39
  326. package/src/timetable/index.ts +308 -13
  327. package/src/trees/nullifier_leaf.ts +4 -0
  328. package/src/tx/block_header.ts +2 -2
  329. package/src/tx/fee_provider.ts +10 -0
  330. package/src/tx/global_variable_builder.ts +2 -3
  331. package/src/tx/index.ts +1 -0
  332. package/src/tx/indexed_tx_effect.ts +1 -2
  333. package/src/tx/profiling.ts +4 -4
  334. package/src/tx/simulated_tx.ts +6 -2
  335. package/src/tx/tx.ts +2 -2
  336. package/src/tx/tx_receipt.ts +11 -14
  337. package/src/types/shared.ts +0 -10
  338. package/src/vks/verification_key.ts +5 -184
  339. package/src/world-state/genesis_data.ts +15 -0
  340. package/src/world-state/index.ts +1 -0
  341. package/src/world-state/world_state_revision.ts +9 -1
  342. package/dest/abi/mocked_keys.d.ts +0 -2
  343. package/dest/abi/mocked_keys.d.ts.map +0 -1
  344. package/dest/abi/mocked_keys.js +0 -1
  345. package/dest/l1-contracts/slash_factory.d.ts +0 -45
  346. package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
  347. package/dest/l1-contracts/slash_factory.js +0 -158
  348. package/dest/slashing/empire.d.ts +0 -31
  349. package/dest/slashing/empire.d.ts.map +0 -1
  350. package/dest/slashing/empire.js +0 -87
  351. package/src/abi/mocked_keys.ts +0 -2
  352. package/src/l1-contracts/slash_factory.ts +0 -180
  353. package/src/slashing/empire.ts +0 -104
@@ -71,7 +71,7 @@ export const proverConfigMappings: ConfigMappingsType<ProverConfig> = {
71
71
  },
72
72
  proverId: {
73
73
  env: 'PROVER_ID',
74
- parseEnv: (val?: string) => parseProverId(val),
74
+ parseEnv: (val: string) => parseProverId(val),
75
75
  description: 'Hex value that identifies the prover. Defaults to the address used for submitting proofs if not set.',
76
76
  },
77
77
  proverTestDelayType: {
@@ -117,10 +117,7 @@ export const proverConfigMappings: ConfigMappingsType<ProverConfig> = {
117
117
  },
118
118
  };
119
119
 
120
- function parseProverId(str?: string) {
121
- if (!str) {
122
- return undefined;
123
- }
120
+ function parseProverId(str: string) {
124
121
  return EthAddress.fromString(str);
125
122
  }
126
123
 
@@ -2,6 +2,11 @@ export * from './allowed_element.js';
2
2
  export * from './api_limit.js';
3
3
  export * from './archiver.js';
4
4
  export * from './aztec-node.js';
5
+ export * from './block_response.js';
6
+ export * from './chain_tips.js';
7
+ export * from './checkpoint_parameter.js';
8
+ export * from './checkpoint_response.js';
9
+ export * from './l1_publish_info.js';
5
10
  export * from './block-builder.js';
6
11
  export * from './configs.js';
7
12
  export * from './epoch-prover.js';
@@ -3,12 +3,8 @@ import { schemas, zodFor } from '@aztec/foundation/schemas';
3
3
 
4
4
  import { z } from 'zod';
5
5
 
6
- export type SlasherClientType = 'empire' | 'tally';
7
-
8
6
  export interface SlasherConfig {
9
7
  slashOverridePayload?: EthAddress;
10
- slashMinPenaltyPercentage: number;
11
- slashMaxPenaltyPercentage: number;
12
8
  slashSelfAllowed?: boolean; // Whether to allow slashes to own validators
13
9
  slashValidatorsAlways: EthAddress[]; // Array of validator addresses
14
10
  slashValidatorsNever: EthAddress[]; // Array of validator addresses
@@ -32,8 +28,6 @@ export interface SlasherConfig {
32
28
  export const SlasherConfigSchema = zodFor<SlasherConfig>()(
33
29
  z.object({
34
30
  slashOverridePayload: schemas.EthAddress.optional(),
35
- slashMinPenaltyPercentage: z.number(),
36
- slashMaxPenaltyPercentage: z.number(),
37
31
  slashValidatorsAlways: z.array(schemas.EthAddress),
38
32
  slashValidatorsNever: z.array(schemas.EthAddress),
39
33
  slashPrunePenalty: schemas.BigInt,
@@ -1,4 +1,4 @@
1
- import type { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
1
+ import type { CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
2
2
  import type { SecretValue } from '@aztec/foundation/config';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
@@ -9,7 +9,6 @@ import type {
9
9
  BlockProposal,
10
10
  BlockProposalOptions,
11
11
  CheckpointAttestation,
12
- CheckpointLastBlockData,
13
12
  CheckpointProposal,
14
13
  CheckpointProposalOptions,
15
14
  } from '@aztec/stdlib/p2p';
@@ -20,6 +19,7 @@ import type { PeerId } from '@libp2p/interface';
20
19
  import { z } from 'zod';
21
20
 
22
21
  import type { CommitteeAttestationsAndSigners } from '../block/index.js';
22
+ import type { ChainConfig } from '../config/chain-config.js';
23
23
  import {
24
24
  type LocalSignerConfig,
25
25
  LocalSignerConfigSchema,
@@ -33,6 +33,9 @@ import { AllowedElementSchema } from './allowed_element.js';
33
33
  */
34
34
  export type ValidatorClientConfig = ValidatorHASignerConfig &
35
35
  LocalSignerConfig & {
36
+ /** The L1 chain id used for EIP-712 proposal-path signing. */
37
+ l1ChainId: ChainConfig['l1ChainId'];
38
+
36
39
  /** The private keys of the validators participating in attestation duties */
37
40
  validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
38
41
 
@@ -91,6 +94,7 @@ export type ValidatorClientFullConfig = ValidatorClientConfig &
91
94
 
92
95
  export const ValidatorClientConfigSchema = zodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>()(
93
96
  ValidatorHASignerConfigSchema.merge(LocalSignerConfigSchema).extend({
97
+ l1ChainId: z.number().int().nonnegative(),
94
98
  validatorAddresses: z.array(schemas.EthAddress).optional(),
95
99
  disableValidator: z.boolean(),
96
100
  disabledValidators: z.array(schemas.EthAddress),
@@ -118,8 +122,6 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
118
122
  }),
119
123
  );
120
124
 
121
- export type CreateCheckpointProposalLastBlockData = Omit<CheckpointLastBlockData, 'txHashes'> & { txs: Tx[] };
122
-
123
125
  export interface Validator {
124
126
  start(): Promise<void>;
125
127
  updateConfig(config: Partial<ValidatorClientFullConfig>): void;
@@ -127,6 +129,7 @@ export interface Validator {
127
129
  // Block validation responsibilities
128
130
  createBlockProposal(
129
131
  blockHeader: BlockHeader,
132
+ checkpointNumber: CheckpointNumber,
130
133
  indexWithinCheckpoint: number,
131
134
  inHash: Fr,
132
135
  archive: Fr,
@@ -139,8 +142,9 @@ export interface Validator {
139
142
  createCheckpointProposal(
140
143
  checkpointHeader: CheckpointHeader,
141
144
  archive: Fr,
145
+ checkpointNumber: CheckpointNumber,
142
146
  feeAssetPriceModifier: bigint,
143
- lastBlockInfo: CreateCheckpointProposalLastBlockData | undefined,
147
+ lastBlockProposal: BlockProposal | undefined,
144
148
  proposerAddress: EthAddress | undefined,
145
149
  options: CheckpointProposalOptions,
146
150
  ): Promise<CheckpointProposal>;
@@ -164,15 +168,23 @@ export interface Validator {
164
168
  broadcastBlockProposal(proposal: BlockProposal): Promise<void>;
165
169
 
166
170
  /** Collect own attestations for a checkpoint proposal (used when skipping p2p attestation collection) */
167
- collectOwnAttestations(proposal: CheckpointProposal): Promise<CheckpointAttestation[]>;
171
+ collectOwnAttestations(
172
+ proposal: CheckpointProposal,
173
+ checkpointNumber: CheckpointNumber,
174
+ ): Promise<CheckpointAttestation[]>;
168
175
 
169
176
  /** Collect attestations from the p2p network for a checkpoint proposal */
170
- collectAttestations(proposal: CheckpointProposal, required: number, deadline: Date): Promise<CheckpointAttestation[]>;
177
+ collectAttestations(
178
+ proposal: CheckpointProposal,
179
+ required: number,
180
+ deadline: Date,
181
+ checkpointNumber: CheckpointNumber,
182
+ ): Promise<CheckpointAttestation[]>;
171
183
 
172
184
  signAttestationsAndSigners(
173
185
  attestationsAndSigners: CommitteeAttestationsAndSigners,
174
186
  proposer: EthAddress,
175
187
  slot: SlotNumber,
176
- blockNumber: BlockNumber | CheckpointNumber,
188
+ checkpointNumber: CheckpointNumber,
177
189
  ): Promise<Signature>;
178
190
  }
@@ -1 +1 @@
1
- export * from './slash_factory.js';
1
+ // No exports.
@@ -23,14 +23,14 @@ import { computeAddressSecret, computePreaddress } from '../keys/derivation.js';
23
23
  * doesn't seem to be a good way around this.
24
24
  */
25
25
  export class ExtendedDirectionalAppTaggingSecret {
26
- private constructor(
26
+ constructor(
27
27
  public readonly secret: Fr,
28
28
  public readonly app: AztecAddress,
29
29
  ) {}
30
30
 
31
31
  /**
32
32
  * Derives shared tagging secret and from that, the app address and recipient derives the directional app tagging
33
- * secret.
33
+ * secret. Returns undefined if `externalAddress` is an invalid address.
34
34
  *
35
35
  * @param localAddress - The complete address of entity A in the shared tagging secret derivation scheme
36
36
  * @param localIvsk - The incoming viewing secret key of entity A
@@ -45,8 +45,12 @@ export class ExtendedDirectionalAppTaggingSecret {
45
45
  externalAddress: AztecAddress,
46
46
  app: AztecAddress,
47
47
  recipient: AztecAddress,
48
- ): Promise<ExtendedDirectionalAppTaggingSecret> {
48
+ ): Promise<ExtendedDirectionalAppTaggingSecret | undefined> {
49
49
  const taggingSecretPoint = await computeSharedTaggingSecret(localAddress, localIvsk, externalAddress);
50
+ if (!taggingSecretPoint) {
51
+ return undefined;
52
+ }
53
+
50
54
  const appTaggingSecret = await poseidon2Hash([taggingSecretPoint.x, taggingSecretPoint.y, app]);
51
55
  const directionalAppTaggingSecret = await poseidon2Hash([appTaggingSecret, recipient]);
52
56
 
@@ -63,18 +67,25 @@ export class ExtendedDirectionalAppTaggingSecret {
63
67
  }
64
68
  }
65
69
 
66
- // Returns shared tagging secret computed with Diffie-Hellman key exchange.
70
+ // Returns shared tagging secret computed with Diffie-Hellman key exchange, or undefined if `externalAddress` is an
71
+ // invalid address.
67
72
  async function computeSharedTaggingSecret(
68
73
  localAddress: CompleteAddress,
69
74
  localIvsk: Fq,
70
75
  externalAddress: AztecAddress,
71
- ): Promise<Point> {
72
- const knownPreaddress = await computePreaddress(await localAddress.publicKeys.hash(), localAddress.partialAddress);
73
- // TODO: #8970 - Computation of address point from x coordinate might fail
74
- const externalAddressPoint = await externalAddress.toAddressPoint();
76
+ ): Promise<Point | undefined> {
75
77
  // Given A (local complete address) -> B (external address) and h == preaddress
76
78
  // Compute shared secret as S = (h_A + local_ivsk_A) * Addr_Point_B
77
79
 
80
+ const knownPreaddress = await computePreaddress(await localAddress.publicKeys.hash(), localAddress.partialAddress);
81
+
82
+ // An invalid address has no corresponding address point
83
+ if (!(await externalAddress.isValid())) {
84
+ return undefined;
85
+ }
86
+
87
+ const externalAddressPoint = await externalAddress.toAddressPoint();
88
+
78
89
  // Beware! h_a + local_ivsk_a (also known as the address secret) can lead to an address point with a negative
79
90
  // y-coordinate, since there's two possible candidates computeAddressSecret takes care of selecting the one that
80
91
  // leads to a positive y-coordinate, which is the only valid address point
@@ -1,7 +1,6 @@
1
1
  import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
2
2
  import { toBufferBE } from '@aztec/foundation/bigint-buffer';
3
3
  import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
4
- import { Fr } from '@aztec/foundation/curves/bn254';
5
4
  import { BufferReader } from '@aztec/foundation/serialize';
6
5
 
7
6
  import { z } from 'zod';
@@ -83,7 +82,7 @@ export class LogId {
83
82
  const reader = BufferReader.asReader(buffer);
84
83
 
85
84
  const blockNumber = BlockNumber(reader.readNumber());
86
- const blockHash = new BlockHash(reader.readObject(Fr));
85
+ const blockHash = BlockHash.fromBuffer(reader);
87
86
  const txHash = reader.readObject(TxHash);
88
87
  const txIndex = reader.readNumber();
89
88
  const logIndex = reader.readNumber();
@@ -1,5 +1,5 @@
1
1
  import { DomainSeparator } from '@aztec/constants';
2
- import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import type { ZodFor } from '@aztec/foundation/schemas';
4
4
 
5
5
  import type { AztecAddress } from '../aztec-address/index.js';
@@ -8,19 +8,14 @@ import { schemas } from '../schemas/schemas.js';
8
8
  import type { PreTag } from './pre_tag.js';
9
9
  import { Tag } from './tag.js';
10
10
 
11
- /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
12
-
13
- /** Branding to ensure fields are not interchangeable types. */
14
- export interface SiloedTag {
15
- /** Brand. */
16
- _branding: 'SiloedTag';
17
- }
18
-
19
11
  /**
20
12
  * Represents a tag used in private log as it "appears on the chain" - that is the tag is siloed with a contract
21
13
  * address that emitted the log.
22
14
  */
23
15
  export class SiloedTag {
16
+ /** Branding for nominal typing. */
17
+ declare private readonly _branding: 'SiloedTag';
18
+
24
19
  constructor(public readonly value: Fr) {}
25
20
 
26
21
  static async compute(preTag: PreTag): Promise<SiloedTag> {
@@ -49,6 +44,10 @@ export class SiloedTag {
49
44
  return this.value.equals(other.value);
50
45
  }
51
46
 
47
+ static random(): SiloedTag {
48
+ return new SiloedTag(Fr.random());
49
+ }
50
+
52
51
  static get schema(): ZodFor<SiloedTag> {
53
52
  return schemas.Fr.transform((fr: Fr) => new SiloedTag(fr));
54
53
  }
package/src/logs/tag.ts CHANGED
@@ -1,22 +1,18 @@
1
1
  import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
2
- import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import type { ZodFor } from '@aztec/foundation/schemas';
4
4
 
5
5
  import { schemas } from '../schemas/schemas.js';
6
6
  import type { PreTag } from './pre_tag.js';
7
7
 
8
- /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
9
-
10
- export interface Tag {
11
- /** Brand. */
12
- _branding: 'Tag';
13
- }
14
-
15
8
  /**
16
9
  * Represents a tag of a private log. This is not the tag that "appears" on the chain as this tag is first siloed
17
10
  * with a contract address by kernels before being included in the final log.
18
11
  */
19
12
  export class Tag {
13
+ /** Branding for nominal typing. */
14
+ declare private readonly _branding: 'Tag';
15
+
20
16
  constructor(public readonly value: Fr) {}
21
17
 
22
18
  static async compute(preTag: PreTag): Promise<Tag> {
@@ -36,6 +32,10 @@ export class Tag {
36
32
  return this.value.equals(other.value);
37
33
  }
38
34
 
35
+ static random(): Tag {
36
+ return new Tag(Fr.random());
37
+ }
38
+
39
39
  static get schema(): ZodFor<Tag> {
40
40
  return schemas.Fr.transform((fr: Fr) => new Tag(fr));
41
41
  }
@@ -1,12 +1,19 @@
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 } from '@aztec/foundation/buffer';
3
9
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
- import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
10
  import { Fr } from '@aztec/foundation/curves/bn254';
6
11
  import type { EthAddress } from '@aztec/foundation/eth-address';
7
12
  import { Signature } from '@aztec/foundation/eth-signature';
8
13
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
9
14
 
15
+ import type { TypedDataDefinition } from 'viem';
16
+
10
17
  import type { L2Block } from '../block/l2_block.js';
11
18
  import type { L2BlockInfo } from '../block/l2_block_info.js';
12
19
  import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
@@ -16,18 +23,20 @@ import { TxHash } from '../tx/index.js';
16
23
  import type { Tx } from '../tx/tx.js';
17
24
  import { Gossipable } from './gossipable.js';
18
25
  import {
19
- SignatureDomainSeparator,
20
- getHashedSignaturePayload,
21
- getHashedSignaturePayloadEthSignedMessage,
26
+ type CoordinationSignatureContext,
27
+ type CoordinationSignatureType,
28
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
29
+ type Signable,
30
+ coordinationSignatureContextEquals,
31
+ getCoordinationSignatureTypedData,
32
+ readCoordinationSignatureContext,
33
+ recoverCoordinationSigner,
34
+ serializeCoordinationSignatureContext,
22
35
  } from './signature_utils.js';
23
36
  import { SignedTxs } from './signed_txs.js';
24
37
  import { TopicType } from './topic_type.js';
25
38
 
26
- export class BlockProposalHash extends Buffer32 {
27
- constructor(hash: Buffer) {
28
- super(hash);
29
- }
30
- }
39
+ export type { BlockProposalHash } from '@aztec/foundation/branded-types';
31
40
 
32
41
  export type BlockProposalOptions = {
33
42
  /**
@@ -47,10 +56,12 @@ export type BlockProposalOptions = {
47
56
  * to be included in a block within a checkpoint. This is used for non-last blocks in a slot.
48
57
  * The last block is sent as part of a CheckpointProposal.
49
58
  */
50
- export class BlockProposal extends Gossipable {
59
+ export class BlockProposal extends Gossipable implements Signable {
51
60
  static override p2pTopic = TopicType.block_proposal;
52
61
 
53
- private sender: EthAddress | undefined;
62
+ readonly primaryType: CoordinationSignatureType = 'BlockProposal';
63
+
64
+ private cachedSender: EthAddress | undefined | null = undefined;
54
65
 
55
66
  constructor(
56
67
  /** The per-block header containing block state and global variables */
@@ -71,14 +82,17 @@ export class BlockProposal extends Gossipable {
71
82
  /** The proposer's signature over the block data */
72
83
  public readonly signature: Signature,
73
84
 
85
+ /** The signing domain (chainId + rollupAddress) the signature is bound to */
86
+ public readonly signatureContext: CoordinationSignatureContext,
87
+
74
88
  /** The signed transactions in the block (optional, for DA guarantees) */
75
89
  public readonly signedTxs?: SignedTxs,
76
90
  ) {
77
91
  super();
78
92
  }
79
93
 
80
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
81
- return Promise.resolve(new BlockProposalHash(keccak256(this.signature.toBuffer())));
94
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
95
+ return Promise.resolve(BlockProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
82
96
  }
83
97
 
84
98
  get archive(): Fr {
@@ -112,9 +126,8 @@ export class BlockProposal extends Gossipable {
112
126
  * Get the payload to sign for this block proposal.
113
127
  * The signature is over: blockHeader + indexWithinCheckpoint + inHash + archiveRoot + txHashes
114
128
  */
115
- getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
129
+ getPayloadToSign(): Buffer {
116
130
  return serializeToBuffer([
117
- domainSeparator,
118
131
  this.blockHeader,
119
132
  this.indexWithinCheckpoint,
120
133
  this.inHash,
@@ -126,12 +139,15 @@ export class BlockProposal extends Gossipable {
126
139
 
127
140
  static async createProposalFromSigner(
128
141
  blockHeader: BlockHeader,
142
+ checkpointNumber: CheckpointNumber,
129
143
  indexWithinCheckpoint: IndexWithinCheckpoint,
130
144
  inHash: Fr,
131
145
  archiveRoot: Fr,
132
146
  txHashes: TxHash[],
133
147
  txs: Tx[] | undefined,
134
- payloadSigner: (payload: Buffer32, context: SigningContext) => Promise<Signature>,
148
+ signatureContext: CoordinationSignatureContext,
149
+ proposalSigner: (typedData: TypedDataDefinition, context: SigningContext) => Promise<Signature>,
150
+ txsSigner?: (typedData: TypedDataDefinition, context: SigningContext) => Promise<Signature>,
135
151
  ): Promise<BlockProposal> {
136
152
  // Create a temporary proposal to get the payload to sign
137
153
  const tempProposal = new BlockProposal(
@@ -141,57 +157,76 @@ export class BlockProposal extends Gossipable {
141
157
  archiveRoot,
142
158
  txHashes,
143
159
  Signature.empty(),
160
+ signatureContext,
144
161
  );
145
162
 
146
163
  // Create the block signing context
147
164
  const blockContext: SigningContext = {
148
165
  slot: blockHeader.globalVariables.slotNumber,
149
166
  blockNumber: blockHeader.globalVariables.blockNumber,
167
+ checkpointNumber,
150
168
  blockIndexWithinCheckpoint: indexWithinCheckpoint,
151
169
  dutyType: DutyType.BLOCK_PROPOSAL,
152
170
  };
153
171
 
154
- const hashed = getHashedSignaturePayload(tempProposal, SignatureDomainSeparator.blockProposal);
155
- const sig = await payloadSigner(hashed, blockContext);
172
+ const typedData = getCoordinationSignatureTypedData(tempProposal);
173
+ const sig = await proposalSigner(typedData, blockContext);
156
174
 
157
175
  // If txs are provided, sign them as well
158
176
  let signedTxs: SignedTxs | undefined;
159
177
  if (txs) {
160
178
  const txsSigningContext: SigningContext = { dutyType: DutyType.TXS };
161
- const txsSigner = (payload: Buffer32) => payloadSigner(payload, txsSigningContext);
162
- signedTxs = await SignedTxs.createFromSigner(txs, txsSigner);
179
+ if (!txsSigner) {
180
+ throw new Error('signed_txs requires a typed-data signer');
181
+ }
182
+ signedTxs = await SignedTxs.createFromSigner(txs, signatureContext, typedData =>
183
+ txsSigner(typedData, txsSigningContext),
184
+ );
163
185
  }
164
186
 
165
- return new BlockProposal(blockHeader, indexWithinCheckpoint, inHash, archiveRoot, txHashes, sig, signedTxs);
187
+ return new BlockProposal(
188
+ blockHeader,
189
+ indexWithinCheckpoint,
190
+ inHash,
191
+ archiveRoot,
192
+ txHashes,
193
+ sig,
194
+ signatureContext,
195
+ signedTxs,
196
+ );
166
197
  }
167
198
 
168
199
  /**
169
200
  * Lazily evaluate the sender of the proposal; result is cached.
170
- * If there's signedTxs, also verifies the signedTxs sender matches the block proposal sender.
171
- * @returns The sender address, or undefined if signature recovery fails or senders don't match
201
+ * If there's signedTxs, also verifies that its signing domain matches this proposal's and
202
+ * that the signedTxs sender matches the block proposal sender. This prevents a proposer
203
+ * from wrapping a foreign-chain SignedTxs bundle inside a local-chain proposal.
204
+ * @returns The sender address, or undefined if signature recovery fails or inner/outer mismatch
172
205
  */
173
206
  getSender(): EthAddress | undefined {
174
- if (!this.sender) {
175
- const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.blockProposal);
176
- const blockSender = tryRecoverAddress(hashed, this.signature);
207
+ if (this.cachedSender === undefined) {
208
+ const blockSender = recoverCoordinationSigner(this, this.signature);
177
209
 
178
- // If there's signedTxs, verify the sender matches
179
210
  if (blockSender && this.signedTxs) {
211
+ if (!coordinationSignatureContextEquals(this.signedTxs.signatureContext, this.signatureContext)) {
212
+ this.cachedSender = null;
213
+ return undefined;
214
+ }
180
215
  const txsSender = this.signedTxs.getSender();
181
216
  if (!txsSender || !txsSender.equals(blockSender)) {
182
- return undefined; // Sender mismatch - fail
217
+ this.cachedSender = null;
218
+ return undefined;
183
219
  }
184
220
  }
185
221
 
186
- // Cache the sender for later use
187
- this.sender = blockSender;
222
+ this.cachedSender = blockSender ?? null;
188
223
  }
189
224
 
190
- return this.sender;
225
+ return this.cachedSender ?? undefined;
191
226
  }
192
227
 
193
228
  getPayload() {
194
- return this.getPayloadToSign(SignatureDomainSeparator.blockProposal);
229
+ return this.getPayloadToSign();
195
230
  }
196
231
 
197
232
  toBuffer(): Buffer {
@@ -201,6 +236,7 @@ export class BlockProposal extends Gossipable {
201
236
  this.inHash,
202
237
  this.archiveRoot,
203
238
  this.signature,
239
+ serializeCoordinationSignatureContext(this.signatureContext),
204
240
  this.txHashes.length,
205
241
  this.txHashes,
206
242
  ];
@@ -221,6 +257,7 @@ export class BlockProposal extends Gossipable {
221
257
  const inHash = reader.readObject(Fr);
222
258
  const archiveRoot = reader.readObject(Fr);
223
259
  const signature = reader.readObject(Signature);
260
+ const signatureContext = readCoordinationSignatureContext(reader);
224
261
  const txHashCount = reader.readNumber();
225
262
  if (txHashCount > MAX_TXS_PER_BLOCK) {
226
263
  throw new Error(`txHashes count ${txHashCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
@@ -238,12 +275,21 @@ export class BlockProposal extends Gossipable {
238
275
  archiveRoot,
239
276
  txHashes,
240
277
  signature,
278
+ signatureContext,
241
279
  signedTxs,
242
280
  );
243
281
  }
244
282
  }
245
283
 
246
- return new BlockProposal(blockHeader, indexWithinCheckpoint, inHash, archiveRoot, txHashes, signature);
284
+ return new BlockProposal(
285
+ blockHeader,
286
+ indexWithinCheckpoint,
287
+ inHash,
288
+ archiveRoot,
289
+ txHashes,
290
+ signature,
291
+ signatureContext,
292
+ );
247
293
  }
248
294
 
249
295
  getSize(): number {
@@ -253,6 +299,8 @@ export class BlockProposal extends Gossipable {
253
299
  this.inHash.size +
254
300
  this.archiveRoot.size +
255
301
  this.signature.getSize() +
302
+ 4 /* chainId */ +
303
+ 20 /* rollupAddress */ +
256
304
  4 /* txHashes.length */ +
257
305
  this.txHashes.length * TxHash.SIZE +
258
306
  4 /* hasSignedTxs flag */ +
@@ -261,7 +309,15 @@ export class BlockProposal extends Gossipable {
261
309
  }
262
310
 
263
311
  static empty(): BlockProposal {
264
- return new BlockProposal(BlockHeader.empty(), IndexWithinCheckpoint(0), Fr.ZERO, Fr.ZERO, [], Signature.empty());
312
+ return new BlockProposal(
313
+ BlockHeader.empty(),
314
+ IndexWithinCheckpoint(0),
315
+ Fr.ZERO,
316
+ Fr.ZERO,
317
+ [],
318
+ Signature.empty(),
319
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
320
+ );
265
321
  }
266
322
 
267
323
  static random(): BlockProposal {
@@ -272,6 +328,7 @@ export class BlockProposal extends Gossipable {
272
328
  Fr.random(),
273
329
  [TxHash.random(), TxHash.random()],
274
330
  Signature.random(),
331
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
275
332
  );
276
333
  }
277
334
 
@@ -283,6 +340,8 @@ export class BlockProposal extends Gossipable {
283
340
  archiveRoot: this.archiveRoot.toString(),
284
341
  signature: this.signature.toString(),
285
342
  txHashes: this.txHashes.map(h => h.toString()),
343
+ chainId: this.signatureContext.chainId,
344
+ rollupAddress: this.signatureContext.rollupAddress.toString(),
286
345
  };
287
346
  }
288
347
 
@@ -308,6 +367,7 @@ export class BlockProposal extends Gossipable {
308
367
  this.archiveRoot,
309
368
  this.txHashes,
310
369
  this.signature,
370
+ this.signatureContext,
311
371
  );
312
372
  }
313
373
  }