@@ -38,7 +38,7 @@ type DecSharesCache = BTreeMap<RoundNumber, HashMap<Round, Vec<Vec<Option<DecSha
38
38
#[ derive( Debug , Serialize , Deserialize ) ]
39
39
enum Protocol {
40
40
/// A request to retrieve a subset identified by the committee id.
41
- GetRequest ( Round ) ,
41
+ GetRequest ( CommitteeId ) ,
42
42
43
43
/// The direct reply to a get request.
44
44
GetResponse ( SubsetResponse ) ,
@@ -576,9 +576,8 @@ impl Worker {
576
576
}
577
577
578
578
/// A get request for DKG subset has been received.
579
- async fn on_get_request ( & mut self , src : PublicKey , round : Round ) -> Result < ( ) > {
580
- let ( round_num, committee_id) = round. into_parts ( ) ;
581
- trace ! ( node = %self . label, from=%src, %committee_id, round=%round_num, "received get_request" ) ;
579
+ async fn on_get_request ( & mut self , src : PublicKey , committee_id : CommitteeId ) -> Result < ( ) > {
580
+ trace ! ( node = %self . label, from=%src, %committee_id, "received get_request" ) ;
582
581
583
582
if !matches ! ( self . dkg_state, DkgState :: Completed ( _) ) {
584
583
return Err ( DecrypterError :: Dkg (
@@ -604,13 +603,13 @@ impl Worker {
604
603
} ;
605
604
606
605
let response = SubsetResponse {
607
- round ,
606
+ committee_id ,
608
607
subset : Subset :: new ( committee_id, subset. to_vec ( ) ) ,
609
608
} ;
610
609
self . net
611
610
. unicast (
612
611
src,
613
- * round_num ,
612
+ 0 , // Minimal round number since API requires it
614
613
serialize ( & Protocol :: GetResponse ( response) ) ?,
615
614
)
616
615
. await
@@ -621,9 +620,11 @@ impl Worker {
621
620
622
621
/// A get response for DKG subset has been received.
623
622
async fn on_get_response ( & mut self , src : PublicKey , res : SubsetResponse ) -> Result < ( ) > {
624
- let SubsetResponse { round, subset } = res;
625
- let ( round_num, committee_id) = round. into_parts ( ) ;
626
- trace ! ( node = %self . label, from=%src, %committee_id, round=%round_num, "received get_response" ) ;
623
+ let SubsetResponse {
624
+ committee_id,
625
+ subset,
626
+ } = res;
627
+ trace ! ( node = %self . label, from=%src, %committee_id, "received get_response" ) ;
627
628
628
629
let DkgState :: Pending ( ref mut subsets) = self . dkg_state else {
629
630
trace ! ( "received get_response but not in a recovering state" ) ;
@@ -833,10 +834,9 @@ impl Worker {
833
834
834
835
/// The node will always try to catchup with the help of remote nodes first.
835
836
async fn dkg_catchup ( & mut self ) -> Result < ( ) > {
836
- let round = self . first_requested_round . unwrap_or_default ( ) ;
837
- let req = Protocol :: GetRequest ( Round :: new ( round, self . current ) ) ;
837
+ let req = Protocol :: GetRequest ( self . current ) ;
838
838
self . net
839
- . broadcast ( round . u64 ( ) , serialize ( & req) ?)
839
+ . broadcast ( 0 , serialize ( & req) ?) // placeholder round value, ignored by receiver
840
840
. await
841
841
. map_err ( |e| DecrypterError :: End ( e. into ( ) ) ) ?;
842
842
Ok ( ( ) )
@@ -1180,7 +1180,7 @@ impl DecShareBatch {
1180
1180
/// A response with the agreed-upon subset of dealings.
1181
1181
#[ derive( Clone , Debug , Serialize , Deserialize ) ]
1182
1182
struct SubsetResponse {
1183
- round : Round ,
1183
+ committee_id : CommitteeId ,
1184
1184
subset : Subset ,
1185
1185
}
1186
1186
0 commit comments