@@ -20,9 +20,11 @@ pub struct LsuCidGossip {
2020 ///
2121 /// NOTE: `impl_catalyst_serialize!` doesn't support `Option<T>`, so we encode "none" as "".
2222 pub proof_cid : String ,
23+ /// CID of `LsuFinalityCertificateV1` (bincode). Empty if not yet assembled (coordinated network upgrade).
24+ pub finality_cid : String ,
2325}
2426
25- impl_catalyst_serialize ! ( LsuCidGossip , cycle, lsu_hash, cid, prev_state_root, state_root, proof_cid) ;
27+ impl_catalyst_serialize ! ( LsuCidGossip , cycle, lsu_hash, cid, prev_state_root, state_root, proof_cid, finality_cid ) ;
2628
2729impl NetworkMessage for LsuCidGossip {
2830 fn serialize ( & self ) -> CatalystResult < Vec < u8 > > {
@@ -241,3 +243,82 @@ impl LsuGossip {
241243 }
242244}
243245
246+ /// One validator attestation: Ed25519/Ristretto Schnorr signature over `H_cert` (ADR 0001).
247+ #[ derive( Debug , Clone , PartialEq , serde:: Serialize , serde:: Deserialize ) ]
248+ pub struct LsuFinalityAttestationMsg {
249+ pub chain_id : u64 ,
250+ pub genesis_hash : [ u8 ; 32 ] ,
251+ pub cycle : u64 ,
252+ pub lsu_hash : [ u8 ; 32 ] ,
253+ pub committee_hash : [ u8 ; 32 ] ,
254+ pub vote_list_hash : [ u8 ; 32 ] ,
255+ pub producer_id : String ,
256+ pub signature : Vec < u8 > ,
257+ }
258+
259+ impl_catalyst_serialize ! (
260+ LsuFinalityAttestationMsg ,
261+ chain_id,
262+ genesis_hash,
263+ cycle,
264+ lsu_hash,
265+ committee_hash,
266+ vote_list_hash,
267+ producer_id,
268+ signature
269+ ) ;
270+
271+ impl NetworkMessage for LsuFinalityAttestationMsg {
272+ fn serialize ( & self ) -> CatalystResult < Vec < u8 > > {
273+ CatalystSerialize :: serialize ( self )
274+ }
275+
276+ fn deserialize ( data : & [ u8 ] ) -> CatalystResult < Self > {
277+ CatalystDeserialize :: deserialize ( data)
278+ }
279+
280+ fn message_type ( & self ) -> MessageType {
281+ MessageType :: LsuFinalityAttestation
282+ }
283+
284+ fn priority ( & self ) -> u8 {
285+ MessagePriority :: High as u8
286+ }
287+
288+ fn ttl ( & self ) -> u32 {
289+ 300
290+ }
291+ }
292+
293+ /// Announces where to fetch the assembled quorum certificate for a cycle.
294+ #[ derive( Debug , Clone , PartialEq , serde:: Serialize , serde:: Deserialize ) ]
295+ pub struct LsuFinalityCidMsg {
296+ pub cycle : u64 ,
297+ pub lsu_hash : [ u8 ; 32 ] ,
298+ pub finality_cid : String ,
299+ }
300+
301+ impl_catalyst_serialize ! ( LsuFinalityCidMsg , cycle, lsu_hash, finality_cid) ;
302+
303+ impl NetworkMessage for LsuFinalityCidMsg {
304+ fn serialize ( & self ) -> CatalystResult < Vec < u8 > > {
305+ CatalystSerialize :: serialize ( self )
306+ }
307+
308+ fn deserialize ( data : & [ u8 ] ) -> CatalystResult < Self > {
309+ CatalystDeserialize :: deserialize ( data)
310+ }
311+
312+ fn message_type ( & self ) -> MessageType {
313+ MessageType :: LsuFinalityCid
314+ }
315+
316+ fn priority ( & self ) -> u8 {
317+ MessagePriority :: High as u8
318+ }
319+
320+ fn ttl ( & self ) -> u32 {
321+ 300
322+ }
323+ }
324+
0 commit comments