@aztec/stdlib 0.0.1-commit.e588bc7e5 → 0.0.1-commit.e5a3663dd

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 (338) 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 +39 -4
  39. package/dest/block/l2_block_source.d.ts.map +1 -1
  40. package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
  41. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  42. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
  43. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  44. package/dest/block/l2_block_stream/l2_tips_store_base.js +1 -1
  45. package/dest/block/proposal/attestations_and_signers.d.ts +13 -6
  46. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  47. package/dest/block/proposal/attestations_and_signers.js +26 -18
  48. package/dest/block/test/l2_tips_store_test_suite.js +1 -1
  49. package/dest/checkpoint/checkpoint_data.d.ts +7 -1
  50. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  51. package/dest/checkpoint/checkpoint_data.js +2 -0
  52. package/dest/config/chain-config.d.ts +2 -2
  53. package/dest/config/chain-config.d.ts.map +1 -1
  54. package/dest/config/chain-config.js +9 -3
  55. package/dest/config/sequencer-config.d.ts +5 -3
  56. package/dest/config/sequencer-config.d.ts.map +1 -1
  57. package/dest/config/sequencer-config.js +18 -4
  58. package/dest/contract/contract_address.d.ts +1 -1
  59. package/dest/contract/contract_address.js +2 -2
  60. package/dest/contract/private_function.d.ts +1 -1
  61. package/dest/contract/private_function.d.ts.map +1 -1
  62. package/dest/contract/private_function.js +2 -4
  63. package/dest/gas/fee_math.d.ts +49 -0
  64. package/dest/gas/fee_math.d.ts.map +1 -0
  65. package/dest/gas/fee_math.js +80 -0
  66. package/dest/gas/gas_fees.d.ts +5 -1
  67. package/dest/gas/gas_fees.d.ts.map +1 -1
  68. package/dest/gas/gas_fees.js +10 -1
  69. package/dest/gas/gas_settings.d.ts +40 -3
  70. package/dest/gas/gas_settings.d.ts.map +1 -1
  71. package/dest/gas/gas_settings.js +50 -6
  72. package/dest/gas/index.d.ts +2 -1
  73. package/dest/gas/index.d.ts.map +1 -1
  74. package/dest/gas/index.js +1 -0
  75. package/dest/ha-signing/config.d.ts +6 -6
  76. package/dest/ha-signing/config.d.ts.map +1 -1
  77. package/dest/ha-signing/config.js +4 -3
  78. package/dest/ha-signing/index.d.ts +2 -2
  79. package/dest/ha-signing/index.d.ts.map +1 -1
  80. package/dest/ha-signing/index.js +1 -1
  81. package/dest/ha-signing/local_config.d.ts +1 -1
  82. package/dest/ha-signing/local_config.d.ts.map +1 -1
  83. package/dest/ha-signing/local_config.js +2 -2
  84. package/dest/ha-signing/types.d.ts +37 -32
  85. package/dest/ha-signing/types.d.ts.map +1 -1
  86. package/dest/ha-signing/types.js +13 -6
  87. package/dest/hash/hash.d.ts +16 -1
  88. package/dest/hash/hash.d.ts.map +1 -1
  89. package/dest/hash/hash.js +32 -0
  90. package/dest/interfaces/archiver.d.ts +11 -1
  91. package/dest/interfaces/archiver.d.ts.map +1 -1
  92. package/dest/interfaces/archiver.js +10 -4
  93. package/dest/interfaces/aztec-node-admin.d.ts +22 -14
  94. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  95. package/dest/interfaces/aztec-node-admin.js +5 -4
  96. package/dest/interfaces/aztec-node-debug.d.ts +21 -0
  97. package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
  98. package/dest/interfaces/aztec-node-debug.js +18 -0
  99. package/dest/interfaces/aztec-node.d.ts +54 -55
  100. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  101. package/dest/interfaces/aztec-node.js +20 -16
  102. package/dest/interfaces/block_response.d.ts +156 -0
  103. package/dest/interfaces/block_response.d.ts.map +1 -0
  104. package/dest/interfaces/block_response.js +24 -0
  105. package/dest/interfaces/chain_tips.d.ts +304 -0
  106. package/dest/interfaces/chain_tips.d.ts.map +1 -0
  107. package/dest/interfaces/chain_tips.js +11 -0
  108. package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
  109. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
  110. package/dest/interfaces/checkpoint_parameter.js +20 -0
  111. package/dest/interfaces/checkpoint_response.d.ts +312 -0
  112. package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
  113. package/dest/interfaces/checkpoint_response.js +26 -0
  114. package/dest/interfaces/client.d.ts +7 -1
  115. package/dest/interfaces/client.d.ts.map +1 -1
  116. package/dest/interfaces/client.js +6 -0
  117. package/dest/interfaces/configs.d.ts +12 -2
  118. package/dest/interfaces/configs.d.ts.map +1 -1
  119. package/dest/interfaces/configs.js +3 -1
  120. package/dest/interfaces/l1_publish_info.d.ts +43 -0
  121. package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
  122. package/dest/interfaces/l1_publish_info.js +26 -0
  123. package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
  124. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  125. package/dest/interfaces/prover-client.d.ts +1 -1
  126. package/dest/interfaces/prover-client.d.ts.map +1 -1
  127. package/dest/interfaces/prover-client.js +0 -3
  128. package/dest/interfaces/proving-job.d.ts +166 -166
  129. package/dest/interfaces/server.d.ts +6 -1
  130. package/dest/interfaces/server.d.ts.map +1 -1
  131. package/dest/interfaces/server.js +5 -0
  132. package/dest/interfaces/slasher.d.ts +1 -10
  133. package/dest/interfaces/slasher.d.ts.map +1 -1
  134. package/dest/interfaces/slasher.js +0 -2
  135. package/dest/interfaces/validator.d.ts +27 -18
  136. package/dest/interfaces/validator.d.ts.map +1 -1
  137. package/dest/interfaces/validator.js +2 -0
  138. package/dest/l1-contracts/index.d.ts +2 -2
  139. package/dest/l1-contracts/index.d.ts.map +1 -1
  140. package/dest/l1-contracts/index.js +1 -1
  141. package/dest/logs/log_id.d.ts +1 -1
  142. package/dest/logs/log_id.d.ts.map +1 -1
  143. package/dest/logs/log_id.js +1 -2
  144. package/dest/logs/siloed_tag.d.ts +5 -7
  145. package/dest/logs/siloed_tag.d.ts.map +1 -1
  146. package/dest/logs/siloed_tag.js +4 -0
  147. package/dest/logs/tag.d.ts +5 -6
  148. package/dest/logs/tag.d.ts.map +1 -1
  149. package/dest/logs/tag.js +4 -0
  150. package/dest/p2p/block_proposal.d.ts +22 -14
  151. package/dest/p2p/block_proposal.d.ts.map +1 -1
  152. package/dest/p2p/block_proposal.js +45 -40
  153. package/dest/p2p/checkpoint_attestation.d.ts +10 -8
  154. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  155. package/dest/p2p/checkpoint_attestation.js +17 -24
  156. package/dest/p2p/checkpoint_proposal.d.ts +20 -14
  157. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  158. package/dest/p2p/checkpoint_proposal.js +34 -51
  159. package/dest/p2p/consensus_payload.d.ts +18 -7
  160. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  161. package/dest/p2p/consensus_payload.js +31 -19
  162. package/dest/p2p/gossipable.d.ts +4 -4
  163. package/dest/p2p/gossipable.d.ts.map +1 -1
  164. package/dest/p2p/signature_utils.d.ts +28 -19
  165. package/dest/p2p/signature_utils.d.ts.map +1 -1
  166. package/dest/p2p/signature_utils.js +118 -21
  167. package/dest/p2p/signed_txs.d.ts +15 -13
  168. package/dest/p2p/signed_txs.d.ts.map +1 -1
  169. package/dest/p2p/signed_txs.js +26 -24
  170. package/dest/parity/parity_base_private_inputs.d.ts +7 -3
  171. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  172. package/dest/parity/parity_base_private_inputs.js +7 -5
  173. package/dest/parity/parity_public_inputs.d.ts +7 -3
  174. package/dest/parity/parity_public_inputs.d.ts.map +1 -1
  175. package/dest/parity/parity_public_inputs.js +6 -3
  176. package/dest/rollup/block_headers_hash.d.ts +1 -1
  177. package/dest/rollup/block_headers_hash.d.ts.map +1 -1
  178. package/dest/rollup/block_headers_hash.js +8 -2
  179. package/dest/slashing/index.d.ts +2 -3
  180. package/dest/slashing/index.d.ts.map +1 -1
  181. package/dest/slashing/index.js +1 -2
  182. package/dest/slashing/serialization.d.ts +2 -6
  183. package/dest/slashing/serialization.d.ts.map +1 -1
  184. package/dest/slashing/serialization.js +0 -60
  185. package/dest/slashing/types.d.ts +4 -90
  186. package/dest/slashing/types.d.ts.map +1 -1
  187. package/dest/slashing/types.js +0 -14
  188. package/dest/slashing/{tally.d.ts → votes.d.ts} +1 -1
  189. package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
  190. package/dest/slashing/{tally.js → votes.js} +1 -1
  191. package/dest/tests/factories.d.ts +2 -7
  192. package/dest/tests/factories.d.ts.map +1 -1
  193. package/dest/tests/factories.js +9 -19
  194. package/dest/tests/mocks.d.ts +7 -1
  195. package/dest/tests/mocks.d.ts.map +1 -1
  196. package/dest/tests/mocks.js +39 -30
  197. package/dest/timetable/index.d.ts +51 -1
  198. package/dest/timetable/index.d.ts.map +1 -1
  199. package/dest/timetable/index.js +218 -14
  200. package/dest/trees/nullifier_leaf.d.ts +2 -1
  201. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  202. package/dest/trees/nullifier_leaf.js +3 -0
  203. package/dest/tx/block_header.d.ts +2 -2
  204. package/dest/tx/block_header.d.ts.map +1 -1
  205. package/dest/tx/block_header.js +1 -1
  206. package/dest/tx/fee_provider.d.ts +10 -0
  207. package/dest/tx/fee_provider.d.ts.map +1 -0
  208. package/dest/tx/fee_provider.js +1 -0
  209. package/dest/tx/global_variable_builder.d.ts +3 -16
  210. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  211. package/dest/tx/index.d.ts +2 -1
  212. package/dest/tx/index.d.ts.map +1 -1
  213. package/dest/tx/index.js +1 -0
  214. package/dest/tx/indexed_tx_effect.d.ts +1 -1
  215. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  216. package/dest/tx/indexed_tx_effect.js +1 -2
  217. package/dest/tx/profiling.js +4 -4
  218. package/dest/tx/simulated_tx.d.ts +4 -4
  219. package/dest/tx/simulated_tx.d.ts.map +1 -1
  220. package/dest/tx/simulated_tx.js +3 -3
  221. package/dest/tx/tx.d.ts +3 -3
  222. package/dest/tx/tx.d.ts.map +1 -1
  223. package/dest/tx/tx_receipt.d.ts +8 -4
  224. package/dest/tx/tx_receipt.d.ts.map +1 -1
  225. package/dest/tx/tx_receipt.js +8 -15
  226. package/dest/types/shared.d.ts +1 -10
  227. package/dest/types/shared.d.ts.map +1 -1
  228. package/dest/types/shared.js +0 -9
  229. package/dest/vks/verification_key.d.ts +2 -137
  230. package/dest/vks/verification_key.d.ts.map +1 -1
  231. package/dest/vks/verification_key.js +5 -126
  232. package/dest/world-state/genesis_data.d.ts +11 -0
  233. package/dest/world-state/genesis_data.d.ts.map +1 -0
  234. package/dest/world-state/genesis_data.js +4 -0
  235. package/dest/world-state/index.d.ts +2 -1
  236. package/dest/world-state/index.d.ts.map +1 -1
  237. package/dest/world-state/index.js +1 -0
  238. package/dest/world-state/world_state_revision.d.ts +8 -1
  239. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  240. package/dest/world-state/world_state_revision.js +7 -1
  241. package/package.json +8 -8
  242. package/src/abi/authorization_selector.ts +2 -8
  243. package/src/abi/encoder.ts +42 -6
  244. package/src/abi/event_selector.ts +2 -8
  245. package/src/abi/function_selector.ts +3 -12
  246. package/src/abi/note_selector.ts +3 -12
  247. package/src/abi/selector.ts +1 -1
  248. package/src/avm/revert_code.ts +25 -39
  249. package/src/aztec-address/index.ts +4 -10
  250. package/src/block/attestation_info.ts +11 -11
  251. package/src/block/block_data.ts +20 -4
  252. package/src/block/block_hash.ts +21 -14
  253. package/src/block/block_parameter.ts +35 -2
  254. package/src/block/l2_block_info.ts +8 -6
  255. package/src/block/l2_block_source.ts +43 -3
  256. package/src/block/l2_block_stream/interfaces.ts +6 -2
  257. package/src/block/l2_block_stream/l2_tips_store_base.ts +1 -1
  258. package/src/block/proposal/attestations_and_signers.ts +32 -17
  259. package/src/block/test/l2_tips_store_test_suite.ts +1 -1
  260. package/src/checkpoint/checkpoint_data.ts +4 -0
  261. package/src/config/chain-config.ts +9 -4
  262. package/src/config/sequencer-config.ts +34 -6
  263. package/src/contract/contract_address.ts +2 -2
  264. package/src/contract/private_function.ts +3 -1
  265. package/src/gas/README.md +31 -0
  266. package/src/gas/fee_math.ts +120 -0
  267. package/src/gas/gas_fees.ts +17 -4
  268. package/src/gas/gas_settings.ts +65 -12
  269. package/src/gas/index.ts +1 -0
  270. package/src/ha-signing/config.ts +5 -2
  271. package/src/ha-signing/index.ts +3 -1
  272. package/src/ha-signing/local_config.ts +2 -2
  273. package/src/ha-signing/types.ts +48 -34
  274. package/src/hash/hash.ts +27 -0
  275. package/src/interfaces/archiver.ts +21 -3
  276. package/src/interfaces/aztec-node-admin.ts +8 -8
  277. package/src/interfaces/aztec-node-debug.ts +40 -0
  278. package/src/interfaces/aztec-node.ts +120 -95
  279. package/src/interfaces/block_response.ts +79 -0
  280. package/src/interfaces/chain_tips.ts +24 -0
  281. package/src/interfaces/checkpoint_parameter.ts +22 -0
  282. package/src/interfaces/checkpoint_response.ts +84 -0
  283. package/src/interfaces/client.ts +6 -0
  284. package/src/interfaces/configs.ts +8 -1
  285. package/src/interfaces/l1_publish_info.ts +40 -0
  286. package/src/interfaces/merkle_tree_operations.ts +3 -2
  287. package/src/interfaces/prover-client.ts +2 -5
  288. package/src/interfaces/server.ts +5 -0
  289. package/src/interfaces/slasher.ts +0 -6
  290. package/src/interfaces/validator.ts +22 -9
  291. package/src/l1-contracts/index.ts +1 -1
  292. package/src/logs/log_id.ts +1 -2
  293. package/src/logs/siloed_tag.ts +8 -9
  294. package/src/logs/tag.ts +8 -8
  295. package/src/p2p/block_proposal.ts +96 -36
  296. package/src/p2p/checkpoint_attestation.ts +20 -29
  297. package/src/p2p/checkpoint_proposal.ts +88 -71
  298. package/src/p2p/consensus_payload.ts +50 -28
  299. package/src/p2p/gossipable.ts +4 -4
  300. package/src/p2p/signature_utils.ts +110 -25
  301. package/src/p2p/signed_txs.ts +46 -28
  302. package/src/parity/parity_base_private_inputs.ts +10 -4
  303. package/src/parity/parity_public_inputs.ts +9 -2
  304. package/src/rollup/block_headers_hash.ts +11 -2
  305. package/src/slashing/index.ts +1 -2
  306. package/src/slashing/serialization.ts +1 -81
  307. package/src/slashing/types.ts +3 -35
  308. package/src/slashing/{tally.ts → votes.ts} +1 -1
  309. package/src/tests/factories.ts +15 -21
  310. package/src/tests/mocks.ts +63 -39
  311. package/src/timetable/index.ts +308 -13
  312. package/src/trees/nullifier_leaf.ts +4 -0
  313. package/src/tx/block_header.ts +2 -2
  314. package/src/tx/fee_provider.ts +10 -0
  315. package/src/tx/global_variable_builder.ts +2 -18
  316. package/src/tx/index.ts +1 -0
  317. package/src/tx/indexed_tx_effect.ts +1 -2
  318. package/src/tx/profiling.ts +4 -4
  319. package/src/tx/simulated_tx.ts +6 -2
  320. package/src/tx/tx.ts +2 -2
  321. package/src/tx/tx_receipt.ts +11 -14
  322. package/src/types/shared.ts +0 -10
  323. package/src/vks/verification_key.ts +5 -184
  324. package/src/world-state/genesis_data.ts +15 -0
  325. package/src/world-state/index.ts +1 -0
  326. package/src/world-state/world_state_revision.ts +9 -1
  327. package/dest/abi/mocked_keys.d.ts +0 -2
  328. package/dest/abi/mocked_keys.d.ts.map +0 -1
  329. package/dest/abi/mocked_keys.js +0 -1
  330. package/dest/l1-contracts/slash_factory.d.ts +0 -45
  331. package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
  332. package/dest/l1-contracts/slash_factory.js +0 -158
  333. package/dest/slashing/empire.d.ts +0 -31
  334. package/dest/slashing/empire.d.ts.map +0 -1
  335. package/dest/slashing/empire.js +0 -87
  336. package/src/abi/mocked_keys.ts +0 -2
  337. package/src/l1-contracts/slash_factory.ts +0 -180
  338. package/src/slashing/empire.ts +0 -104
@@ -1,7 +1,6 @@
1
- import { SlotNumber } from '@aztec/foundation/branded-types';
2
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import { CheckpointAttestationHash, SlotNumber } from '@aztec/foundation/branded-types';
2
+ import type { BaseBuffer32 } from '@aztec/foundation/buffer';
3
3
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
- import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
4
  import type { Fr } from '@aztec/foundation/curves/bn254';
6
5
  import type { EthAddress } from '@aztec/foundation/eth-address';
7
6
  import { Signature } from '@aztec/foundation/eth-signature';
@@ -13,14 +12,10 @@ import type { ZodFor } from '../schemas/index.js';
13
12
  import { CheckpointProposal } from './checkpoint_proposal.js';
14
13
  import { ConsensusPayload } from './consensus_payload.js';
15
14
  import { Gossipable } from './gossipable.js';
16
- import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
15
+ import { type CoordinationSignatureContext, recoverCoordinationSigner } from './signature_utils.js';
17
16
  import { TopicType } from './topic_type.js';
18
17
 
19
- export class CheckpointAttestationHash extends Buffer32 {
20
- constructor(hash: Buffer) {
21
- super(hash);
22
- }
23
- }
18
+ export type { CheckpointAttestationHash } from '@aztec/foundation/branded-types';
24
19
 
25
20
  /**
26
21
  * CheckpointAttestation
@@ -31,8 +26,8 @@ export class CheckpointAttestationHash extends Buffer32 {
31
26
  export class CheckpointAttestation extends Gossipable {
32
27
  static override p2pTopic = TopicType.checkpoint_attestation;
33
28
 
34
- private sender: EthAddress | undefined;
35
- private proposer: EthAddress | undefined;
29
+ private cachedSender: EthAddress | undefined | null = undefined;
30
+ private cachedProposer: EthAddress | undefined | null = undefined;
36
31
 
37
32
  constructor(
38
33
  /** The payload of the message, and what the signature is over */
@@ -57,8 +52,8 @@ export class CheckpointAttestation extends Gossipable {
57
52
  .transform(obj => new CheckpointAttestation(obj.payload, obj.signature, obj.proposerSignature));
58
53
  }
59
54
 
60
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
61
- return Promise.resolve(new CheckpointAttestationHash(keccak256(this.signature.toBuffer())));
55
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
56
+ return Promise.resolve(CheckpointAttestationHash.fromBuffer(keccak256(this.signature.toBuffer())));
62
57
  }
63
58
 
64
59
  get archive(): Fr {
@@ -69,22 +64,19 @@ export class CheckpointAttestation extends Gossipable {
69
64
  return this.payload.header.slotNumber;
70
65
  }
71
66
 
67
+ get signatureContext(): CoordinationSignatureContext {
68
+ return this.payload.signatureContext;
69
+ }
70
+
72
71
  /**
73
72
  * Lazily evaluate and cache the signer of the attestation
74
73
  * @returns The signer of the attestation, or undefined if signature recovery fails
75
74
  */
76
75
  getSender(): EthAddress | undefined {
77
- if (!this.sender) {
78
- // Recover the sender from the attestation
79
- const hashed = getHashedSignaturePayloadEthSignedMessage(
80
- this.payload,
81
- SignatureDomainSeparator.checkpointAttestation,
82
- );
83
- // Cache the sender for later use
84
- this.sender = tryRecoverAddress(hashed, this.signature);
76
+ if (this.cachedSender === undefined) {
77
+ this.cachedSender = recoverCoordinationSigner(this.payload, this.signature) ?? null;
85
78
  }
86
-
87
- return this.sender;
79
+ return this.cachedSender ?? undefined;
88
80
  }
89
81
 
90
82
  /**
@@ -92,7 +84,7 @@ export class CheckpointAttestation extends Gossipable {
92
84
  * @returns The proposer of the checkpoint
93
85
  */
94
86
  getProposer(): EthAddress | undefined {
95
- if (!this.proposer) {
87
+ if (this.cachedProposer === undefined) {
96
88
  // Create a temporary CheckpointProposal to recover the proposer address.
97
89
  // We need to use CheckpointProposal because it has a different getPayloadToSign()
98
90
  // implementation than ConsensusPayload (uses serializeToBuffer vs ABI encoding).
@@ -101,16 +93,15 @@ export class CheckpointAttestation extends Gossipable {
101
93
  this.payload.archive,
102
94
  this.payload.feeAssetPriceModifier,
103
95
  this.proposerSignature,
96
+ this.payload.signatureContext,
104
97
  );
105
- // Cache the proposer for later use
106
- this.proposer = proposal.getSender();
98
+ this.cachedProposer = proposal.getSender() ?? null;
107
99
  }
108
-
109
- return this.proposer;
100
+ return this.cachedProposer ?? undefined;
110
101
  }
111
102
 
112
103
  getPayload(): Buffer {
113
- return this.payload.getPayloadToSign(SignatureDomainSeparator.checkpointAttestation);
104
+ return this.payload.getPayloadToSign();
114
105
  }
115
106
 
116
107
  toBuffer(): Buffer {
@@ -1,12 +1,18 @@
1
- import { BlockNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
2
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import {
2
+ type CheckpointNumber,
3
+ CheckpointProposalHash,
4
+ IndexWithinCheckpoint,
5
+ SlotNumber,
6
+ } from '@aztec/foundation/branded-types';
7
+ import type { BaseBuffer32 } from '@aztec/foundation/buffer';
3
8
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
4
- import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
5
9
  import { Fr } from '@aztec/foundation/curves/bn254';
6
10
  import type { EthAddress } from '@aztec/foundation/eth-address';
7
11
  import { Signature } from '@aztec/foundation/eth-signature';
8
12
  import { BufferReader, serializeSignedBigInt, serializeToBuffer } from '@aztec/foundation/serialize';
9
13
 
14
+ import type { TypedDataDefinition } from 'viem';
15
+
10
16
  import type { L2BlockInfo } from '../block/l2_block_info.js';
11
17
  import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
12
18
  import { DutyType, type SigningContext } from '../ha-signing/index.js';
@@ -17,19 +23,19 @@ import type { Tx } from '../tx/tx.js';
17
23
  import { BlockProposal } from './block_proposal.js';
18
24
  import { Gossipable } from './gossipable.js';
19
25
  import {
20
- SignatureDomainSeparator,
21
- getHashedSignaturePayload,
22
- getHashedSignaturePayloadEthSignedMessage,
26
+ type CoordinationSignatureContext,
27
+ type CoordinationSignatureType,
28
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
29
+ type Signable,
30
+ getCoordinationSignatureTypedData,
31
+ readCoordinationSignatureContext,
32
+ recoverCoordinationSigner,
33
+ serializeCoordinationSignatureContext,
23
34
  } from './signature_utils.js';
24
35
  import { SignedTxs } from './signed_txs.js';
25
36
  import { TopicType } from './topic_type.js';
26
37
 
27
- // REFACTOR(palla): Use a branded type instead of a subclass of Buffer32
28
- export class CheckpointProposalHash extends Buffer32 {
29
- constructor(hash: Buffer) {
30
- super(hash);
31
- }
32
- }
38
+ export type { CheckpointProposalHash } from '@aztec/foundation/branded-types';
33
39
 
34
40
  export type CheckpointProposalOptions = {
35
41
  /**
@@ -69,10 +75,12 @@ export type CheckpointLastBlock = Omit<CheckpointLastBlockData, 'txs'> & {
69
75
  * It includes the aggregated checkpoint header that validators will attest to, plus optionally
70
76
  * the last block's info for nodes to re-execute. This marks the completion of a slot's worth of blocks.
71
77
  */
72
- export class CheckpointProposal extends Gossipable {
78
+ export class CheckpointProposal extends Gossipable implements Signable {
73
79
  static override p2pTopic = TopicType.checkpoint_proposal;
74
80
 
75
- private sender: EthAddress | undefined;
81
+ readonly primaryType: CoordinationSignatureType = 'CheckpointProposal';
82
+
83
+ private cachedSender: EthAddress | undefined | null = undefined;
76
84
 
77
85
  constructor(
78
86
  /** The aggregated checkpoint header for consensus */
@@ -87,14 +95,17 @@ export class CheckpointProposal extends Gossipable {
87
95
  /** The proposer's signature over the checkpoint payload (checkpointHeader + archive + feeAssetPriceModifier) */
88
96
  public readonly signature: Signature,
89
97
 
98
+ /** The signing domain (chainId + rollupAddress) the signature is bound to */
99
+ public readonly signatureContext: CoordinationSignatureContext,
100
+
90
101
  /** Optional last block info, including its own signature for BlockProposal extraction */
91
102
  public readonly lastBlock?: CheckpointLastBlock,
92
103
  ) {
93
104
  super();
94
105
  }
95
106
 
96
- override generateP2PMessageIdentifier(): Promise<Buffer32> {
97
- return Promise.resolve(new CheckpointProposalHash(keccak256(this.signature.toBuffer())));
107
+ override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
108
+ return Promise.resolve(CheckpointProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
98
109
  }
99
110
 
100
111
  get slotNumber(): SlotNumber {
@@ -117,6 +128,7 @@ export class CheckpointProposal extends Gossipable {
117
128
  this.archive,
118
129
  this.lastBlock.txHashes,
119
130
  this.lastBlock.signature,
131
+ this.signatureContext,
120
132
  this.lastBlock.signedTxs,
121
133
  );
122
134
  }
@@ -148,21 +160,18 @@ export class CheckpointProposal extends Gossipable {
148
160
  * Get the payload to sign for this checkpoint proposal.
149
161
  * The signature is over the checkpoint header + archive root + feeAssetPriceModifier (for consensus).
150
162
  */
151
- getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
152
- return serializeToBuffer([
153
- domainSeparator,
154
- this.checkpointHeader,
155
- this.archive,
156
- serializeSignedBigInt(this.feeAssetPriceModifier),
157
- ]);
163
+ getPayloadToSign(): Buffer {
164
+ return serializeToBuffer([this.checkpointHeader, this.archive, serializeSignedBigInt(this.feeAssetPriceModifier)]);
158
165
  }
159
166
 
160
167
  static async createProposalFromSigner(
161
168
  checkpointHeader: CheckpointHeader,
162
169
  archiveRoot: Fr,
170
+ checkpointNumber: CheckpointNumber,
163
171
  feeAssetPriceModifier: bigint,
164
- lastBlockInfo: CheckpointLastBlockData | undefined,
165
- payloadSigner: (payload: Buffer32, context: SigningContext) => Promise<Signature>,
172
+ lastBlockProposal: BlockProposal | undefined,
173
+ signatureContext: CoordinationSignatureContext,
174
+ payloadSigner: (typedData: TypedDataDefinition, context: SigningContext) => Promise<Signature>,
166
175
  ): Promise<CheckpointProposal> {
167
176
  // Sign the checkpoint payload with CHECKPOINT_PROPOSAL duty type
168
177
  const tempProposal = new CheckpointProposal(
@@ -170,40 +179,25 @@ export class CheckpointProposal extends Gossipable {
170
179
  archiveRoot,
171
180
  feeAssetPriceModifier,
172
181
  Signature.empty(),
182
+ signatureContext,
173
183
  );
174
- const checkpointHash = getHashedSignaturePayload(tempProposal, SignatureDomainSeparator.checkpointProposal);
175
-
176
184
  const checkpointContext: SigningContext = {
177
185
  slot: checkpointHeader.slotNumber,
178
- blockNumber: lastBlockInfo?.blockHeader?.globalVariables.blockNumber ?? BlockNumber(0),
186
+ checkpointNumber,
179
187
  dutyType: DutyType.CHECKPOINT_PROPOSAL,
180
188
  };
181
189
 
182
- if (lastBlockInfo) {
183
- // Sign block proposal before signing checkpoint proposal to ensure HA protection
184
- const lastBlockProposal = await BlockProposal.createProposalFromSigner(
185
- lastBlockInfo.blockHeader,
186
- lastBlockInfo.indexWithinCheckpoint,
187
- checkpointHeader.inHash,
188
- archiveRoot,
189
- lastBlockInfo.txHashes,
190
- lastBlockInfo.txs,
191
- payloadSigner,
192
- );
193
-
194
- const checkpointSignature = await payloadSigner(checkpointHash, checkpointContext);
195
-
196
- return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature, {
197
- blockHeader: lastBlockInfo.blockHeader,
198
- indexWithinCheckpoint: lastBlockInfo.indexWithinCheckpoint,
199
- txHashes: lastBlockInfo.txHashes,
200
- signature: lastBlockProposal.signature,
201
- signedTxs: lastBlockProposal.signedTxs,
202
- });
203
- }
190
+ const typedData = getCoordinationSignatureTypedData(tempProposal);
191
+ const checkpointSignature = await payloadSigner(typedData, checkpointContext);
204
192
 
205
- const checkpointSignature = await payloadSigner(checkpointHash, checkpointContext);
206
- return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature);
193
+ return new CheckpointProposal(
194
+ checkpointHeader,
195
+ archiveRoot,
196
+ feeAssetPriceModifier,
197
+ checkpointSignature,
198
+ signatureContext,
199
+ lastBlockProposal,
200
+ );
207
201
  }
208
202
 
209
203
  /**
@@ -212,28 +206,26 @@ export class CheckpointProposal extends Gossipable {
212
206
  * @returns The sender address, or undefined if signature recovery fails or senders don't match
213
207
  */
214
208
  getSender(): EthAddress | undefined {
215
- if (!this.sender) {
216
- const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.checkpointProposal);
217
- const checkpointSender = tryRecoverAddress(hashed, this.signature);
209
+ if (this.cachedSender === undefined) {
210
+ const checkpointSender = recoverCoordinationSigner(this, this.signature);
218
211
 
219
- // If there's a lastBlock, verify the block proposal sender matches
220
212
  if (checkpointSender && this.lastBlock) {
221
213
  const blockProposal = this.getBlockProposal();
222
214
  const blockSender = blockProposal?.getSender();
223
215
  if (!blockSender || !blockSender.equals(checkpointSender)) {
224
- return undefined; // Sender mismatch - fail
216
+ this.cachedSender = null;
217
+ return undefined;
225
218
  }
226
219
  }
227
220
 
228
- // Cache the sender for later use
229
- this.sender = checkpointSender;
221
+ this.cachedSender = checkpointSender ?? null;
230
222
  }
231
223
 
232
- return this.sender;
224
+ return this.cachedSender ?? undefined;
233
225
  }
234
226
 
235
227
  getPayload() {
236
- return this.getPayloadToSign(SignatureDomainSeparator.checkpointProposal);
228
+ return this.getPayloadToSign();
237
229
  }
238
230
 
239
231
  toBuffer(): Buffer {
@@ -242,6 +234,7 @@ export class CheckpointProposal extends Gossipable {
242
234
  this.archive,
243
235
  serializeSignedBigInt(this.feeAssetPriceModifier),
244
236
  this.signature,
237
+ serializeCoordinationSignatureContext(this.signatureContext),
245
238
  ];
246
239
 
247
240
  if (this.lastBlock) {
@@ -271,6 +264,7 @@ export class CheckpointProposal extends Gossipable {
271
264
  const archive = reader.readObject(Fr);
272
265
  const feeAssetPriceModifier = reader.readInt256();
273
266
  const signature = reader.readObject(Signature);
267
+ const signatureContext = readCoordinationSignatureContext(reader);
274
268
 
275
269
  const hasLastBlock = reader.readNumber();
276
270
 
@@ -292,7 +286,7 @@ export class CheckpointProposal extends Gossipable {
292
286
  }
293
287
  }
294
288
 
295
- return new CheckpointProposal(checkpointHeader, archive, feeAssetPriceModifier, signature, {
289
+ return new CheckpointProposal(checkpointHeader, archive, feeAssetPriceModifier, signature, signatureContext, {
296
290
  blockHeader,
297
291
  indexWithinCheckpoint,
298
292
  txHashes,
@@ -301,7 +295,7 @@ export class CheckpointProposal extends Gossipable {
301
295
  });
302
296
  }
303
297
 
304
- return new CheckpointProposal(checkpointHeader, archive, feeAssetPriceModifier, signature);
298
+ return new CheckpointProposal(checkpointHeader, archive, feeAssetPriceModifier, signature, signatureContext);
305
299
  }
306
300
 
307
301
  getSize(): number {
@@ -310,6 +304,8 @@ export class CheckpointProposal extends Gossipable {
310
304
  this.archive.size +
311
305
  this.signature.getSize() +
312
306
  8 /* feeAssetPriceModifier */ +
307
+ 4 /* chainId */ +
308
+ 20 /* rollupAddress */ +
313
309
  4; /* hasLastBlock flag */
314
310
 
315
311
  if (this.lastBlock) {
@@ -327,16 +323,29 @@ export class CheckpointProposal extends Gossipable {
327
323
  }
328
324
 
329
325
  static empty(): CheckpointProposal {
330
- return new CheckpointProposal(CheckpointHeader.empty(), Fr.ZERO, 0n, Signature.empty());
326
+ return new CheckpointProposal(
327
+ CheckpointHeader.empty(),
328
+ Fr.ZERO,
329
+ 0n,
330
+ Signature.empty(),
331
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
332
+ );
331
333
  }
332
334
 
333
335
  static random(): CheckpointProposal {
334
- return new CheckpointProposal(CheckpointHeader.random(), Fr.random(), 0n, Signature.random(), {
335
- blockHeader: BlockHeader.random(),
336
- indexWithinCheckpoint: IndexWithinCheckpoint(Math.floor(Math.random() * 5)),
337
- txHashes: [TxHash.random(), TxHash.random()],
338
- signature: Signature.random(),
339
- });
336
+ return new CheckpointProposal(
337
+ CheckpointHeader.random(),
338
+ Fr.random(),
339
+ 0n,
340
+ Signature.random(),
341
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
342
+ {
343
+ blockHeader: BlockHeader.random(),
344
+ indexWithinCheckpoint: IndexWithinCheckpoint(Math.floor(Math.random() * 5)),
345
+ txHashes: [TxHash.random(), TxHash.random()],
346
+ signature: Signature.random(),
347
+ },
348
+ );
340
349
  }
341
350
 
342
351
  toInspect() {
@@ -345,6 +354,8 @@ export class CheckpointProposal extends Gossipable {
345
354
  archive: this.archive.toString(),
346
355
  signature: this.signature.toString(),
347
356
  feeAssetPriceModifier: this.feeAssetPriceModifier.toString(),
357
+ chainId: this.signatureContext.chainId,
358
+ rollupAddress: this.signatureContext.rollupAddress.toString(),
348
359
  lastBlock: this.lastBlock
349
360
  ? {
350
361
  blockHeader: this.lastBlock.blockHeader.toInspect(),
@@ -361,7 +372,13 @@ export class CheckpointProposal extends Gossipable {
361
372
  * Used when the lastBlock has been extracted and stored separately.
362
373
  */
363
374
  toCore(): CheckpointProposalCore {
364
- return new CheckpointProposal(this.checkpointHeader, this.archive, this.feeAssetPriceModifier, this.signature);
375
+ return new CheckpointProposal(
376
+ this.checkpointHeader,
377
+ this.archive,
378
+ this.feeAssetPriceModifier,
379
+ this.signature,
380
+ this.signatureContext,
381
+ );
365
382
  }
366
383
  }
367
384
 
@@ -10,10 +10,21 @@ import { z } from 'zod';
10
10
  import type { Checkpoint } from '../checkpoint/checkpoint.js';
11
11
  import { CheckpointHeader } from '../rollup/checkpoint_header.js';
12
12
  import type { CheckpointProposal, CheckpointProposalCore } from './checkpoint_proposal.js';
13
- import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
13
+ import {
14
+ type CoordinationSignatureContext,
15
+ type CoordinationSignatureType,
16
+ EMPTY_COORDINATION_SIGNATURE_CONTEXT,
17
+ type Signable,
18
+ coordinationSignatureContextEquals,
19
+ coordinationSignatureContextSchema,
20
+ readCoordinationSignatureContext,
21
+ serializeCoordinationSignatureContext,
22
+ } from './signature_utils.js';
14
23
 
15
24
  /** Checkpoint consensus payload as signed by validators and verified on L1. */
16
25
  export class ConsensusPayload implements Signable {
26
+ readonly primaryType: CoordinationSignatureType = 'CheckpointAttestation';
27
+
17
28
  private size: number | undefined;
18
29
 
19
30
  constructor(
@@ -22,7 +33,9 @@ export class ConsensusPayload implements Signable {
22
33
  /** The archive root after the block is added */
23
34
  public readonly archive: Fr,
24
35
  /** The fee asset price modifier in basis points (from oracle) */
25
- public readonly feeAssetPriceModifier: bigint = 0n,
36
+ public readonly feeAssetPriceModifier: bigint,
37
+ /** The signing domain (chainId + rollupAddress) the signature is bound to */
38
+ public readonly signatureContext: CoordinationSignatureContext,
26
39
  ) {}
27
40
 
28
41
  static get schema() {
@@ -31,36 +44,38 @@ export class ConsensusPayload implements Signable {
31
44
  header: CheckpointHeader.schema,
32
45
  archive: schemas.Fr,
33
46
  feeAssetPriceModifier: schemas.BigInt,
47
+ signatureContext: coordinationSignatureContextSchema,
34
48
  })
35
- .transform(obj => new ConsensusPayload(obj.header, obj.archive, obj.feeAssetPriceModifier));
49
+ .transform(obj => new ConsensusPayload(obj.header, obj.archive, obj.feeAssetPriceModifier, obj.signatureContext));
36
50
  }
37
51
 
38
- static getFields(fields: FieldsOf<ConsensusPayload>) {
39
- return [fields.header, fields.archive, fields.feeAssetPriceModifier] as const;
52
+ static getFields(fields: Omit<FieldsOf<ConsensusPayload>, 'primaryType'>) {
53
+ return [fields.header, fields.archive, fields.feeAssetPriceModifier, fields.signatureContext] as const;
40
54
  }
41
55
 
42
- getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
56
+ getPayloadToSign(): Buffer {
57
+ // Matches the L1 ProposePayload struct in ProposeLib.sol.
43
58
  const abi = parseAbiParameters(
44
- 'uint8, ' + //domainSeperator
45
- '(' +
59
+ '(' +
46
60
  'bytes32, ' + // archive
47
61
  '(int256), ' + // oracleInput
48
62
  'bytes32' + // headerHash
49
63
  ')',
50
64
  );
51
65
  const archiveRoot = this.archive.toString();
52
-
53
66
  const headerHash = this.header.hash().toString();
54
- const encodedData = encodeAbiParameters(abi, [
55
- domainSeparator,
56
- [archiveRoot, [this.feeAssetPriceModifier], headerHash],
57
- ] as const);
67
+ const encodedData = encodeAbiParameters(abi, [[archiveRoot, [this.feeAssetPriceModifier], headerHash]] as const);
58
68
 
59
69
  return hexToBuffer(encodedData);
60
70
  }
61
71
 
62
72
  toBuffer(): Buffer {
63
- return serializeToBuffer([this.header, this.archive, serializeSignedBigInt(this.feeAssetPriceModifier)]);
73
+ return serializeToBuffer([
74
+ this.header,
75
+ this.archive,
76
+ serializeSignedBigInt(this.feeAssetPriceModifier),
77
+ serializeCoordinationSignatureContext(this.signatureContext),
78
+ ]);
64
79
  }
65
80
 
66
81
  public equals(other: ConsensusPayload | CheckpointProposal | CheckpointProposalCore): boolean {
@@ -69,34 +84,39 @@ export class ConsensusPayload implements Signable {
69
84
  return (
70
85
  this.header.equals(otherHeader) &&
71
86
  this.archive.equals(other.archive) &&
72
- this.feeAssetPriceModifier === otherModifier
87
+ this.feeAssetPriceModifier === otherModifier &&
88
+ coordinationSignatureContextEquals(this.signatureContext, other.signatureContext)
73
89
  );
74
90
  }
75
91
 
76
92
  static fromBuffer(buf: Buffer | BufferReader): ConsensusPayload {
77
93
  const reader = BufferReader.asReader(buf);
78
- const payload = new ConsensusPayload(
79
- reader.readObject(CheckpointHeader),
80
- reader.readObject(Fr),
81
- reader.readInt256(),
82
- );
83
- return payload;
94
+ const header = reader.readObject(CheckpointHeader);
95
+ const archive = reader.readObject(Fr);
96
+ const feeAssetPriceModifier = reader.readInt256();
97
+ const signatureContext = readCoordinationSignatureContext(reader);
98
+ return new ConsensusPayload(header, archive, feeAssetPriceModifier, signatureContext);
84
99
  }
85
100
 
86
- static fromFields(fields: FieldsOf<ConsensusPayload>): ConsensusPayload {
87
- return new ConsensusPayload(fields.header, fields.archive, fields.feeAssetPriceModifier);
101
+ static fromFields(fields: Omit<FieldsOf<ConsensusPayload>, 'primaryType'>): ConsensusPayload {
102
+ return new ConsensusPayload(fields.header, fields.archive, fields.feeAssetPriceModifier, fields.signatureContext);
88
103
  }
89
104
 
90
- static fromCheckpoint(checkpoint: Checkpoint): ConsensusPayload {
91
- return new ConsensusPayload(checkpoint.header, checkpoint.archive.root, checkpoint.feeAssetPriceModifier);
105
+ static fromCheckpoint(checkpoint: Checkpoint, signatureContext: CoordinationSignatureContext): ConsensusPayload {
106
+ return new ConsensusPayload(
107
+ checkpoint.header,
108
+ checkpoint.archive.root,
109
+ checkpoint.feeAssetPriceModifier,
110
+ signatureContext,
111
+ );
92
112
  }
93
113
 
94
114
  static empty(): ConsensusPayload {
95
- return new ConsensusPayload(CheckpointHeader.empty(), Fr.ZERO, 0n);
115
+ return new ConsensusPayload(CheckpointHeader.empty(), Fr.ZERO, 0n, EMPTY_COORDINATION_SIGNATURE_CONTEXT);
96
116
  }
97
117
 
98
118
  static random(): ConsensusPayload {
99
- return new ConsensusPayload(CheckpointHeader.random(), Fr.random(), 0n);
119
+ return new ConsensusPayload(CheckpointHeader.random(), Fr.random(), 0n, EMPTY_COORDINATION_SIGNATURE_CONTEXT);
100
120
  }
101
121
 
102
122
  /**
@@ -117,10 +137,12 @@ export class ConsensusPayload implements Signable {
117
137
  header: this.header.toInspect(),
118
138
  archive: this.archive.toString(),
119
139
  feeAssetPriceModifier: this.feeAssetPriceModifier.toString(),
140
+ chainId: this.signatureContext.chainId,
141
+ rollupAddress: this.signatureContext.rollupAddress.toString(),
120
142
  };
121
143
  }
122
144
 
123
145
  toString() {
124
- return `header: ${this.header.toString()}, archive: ${this.archive.toString()}, feeAssetPriceModifier: ${this.feeAssetPriceModifier}}`;
146
+ return `header: ${this.header.toString()}, archive: ${this.archive.toString()}, feeAssetPriceModifier: ${this.feeAssetPriceModifier}, chainId: ${this.signatureContext.chainId}, rollupAddress: ${this.signatureContext.rollupAddress.toString()}`;
125
147
  }
126
148
  }
@@ -1,4 +1,4 @@
1
- import { Buffer32 } from '@aztec/foundation/buffer';
1
+ import { BaseBuffer32 } from '@aztec/foundation/buffer';
2
2
  import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
3
3
 
4
4
  import type { TopicType } from './topic_type.js';
@@ -46,7 +46,7 @@ export class P2PMessage {
46
46
  * Any class which extends gossipable will be able to be Gossiped over the p2p network
47
47
  */
48
48
  export abstract class Gossipable {
49
- private cachedId: Buffer32 | undefined;
49
+ private cachedId: BaseBuffer32 | undefined;
50
50
  /** The p2p topic identifier, this determines how the message is handled */
51
51
  static p2pTopic: TopicType;
52
52
 
@@ -54,7 +54,7 @@ export abstract class Gossipable {
54
54
  * A digest of the message information **used for logging only**.
55
55
  * The identifier used for deduplication is `getMsgIdFn` as defined in `encoding.ts` which is a hash over topic and data.
56
56
  */
57
- async p2pMessageLoggingIdentifier(): Promise<Buffer32> {
57
+ async p2pMessageLoggingIdentifier(): Promise<BaseBuffer32> {
58
58
  if (this.cachedId) {
59
59
  return this.cachedId;
60
60
  }
@@ -62,7 +62,7 @@ export abstract class Gossipable {
62
62
  return this.cachedId;
63
63
  }
64
64
 
65
- abstract generateP2PMessageIdentifier(): Promise<Buffer32>;
65
+ abstract generateP2PMessageIdentifier(): Promise<BaseBuffer32>;
66
66
 
67
67
  abstract toBuffer(): Buffer;
68
68