@@ -61,64 +61,26 @@ pub enum ErrorKind {
6161#[ derive( Debug , Clone ) ]
6262pub struct SendInfo {
6363 phase : String ,
64- current_msg : usize ,
65- remaining_msgs : usize ,
6664}
6765
6866impl SendInfo {
6967 /// The name of the protocol phase that sent the message.
7068 pub fn phase ( & self ) -> & str {
7169 & self . phase
7270 }
73-
74- /// How many chunks have already been sent, 1 for the first message, 2 for the second, etc.
75- pub fn sent ( & self ) -> usize {
76- self . current_msg + 1
77- }
78-
79- /// How many chunks have yet to be sent for the full message to be transmitted.
80- pub fn remaining ( & self ) -> usize {
81- self . remaining_msgs
82- }
83-
84- /// The total number of chunks that make up the full message.
85- pub fn total ( & self ) -> usize {
86- self . sent ( ) + self . remaining ( )
87- }
8871}
8972
9073/// Information about a received message that can be useful for logging.
9174#[ derive( Debug , Clone ) ]
9275pub struct RecvInfo {
9376 phase : String ,
94- current_msg : usize ,
95- remaining_msgs : Option < usize > ,
9677}
9778
9879impl RecvInfo {
9980 /// The name of the protocol phase that sent the message.
10081 pub fn phase ( & self ) -> & str {
10182 & self . phase
10283 }
103-
104- /// How many chunks have already been sent, 1 for the first message, 2 for the second, etc.
105- pub fn sent ( & self ) -> usize {
106- self . current_msg + 1
107- }
108-
109- /// How many chunks have yet to be sent for the full message to be transmitted.
110- ///
111- /// Will be `None` for the first message, before it is clear how many chunks need to be sent.
112- pub fn remaining ( & self ) -> Option < usize > {
113- self . remaining_msgs
114- }
115-
116- /// The total number of chunks that make up the full message.
117- ///
118- /// Will be `None` for the first message, before it is clear how many chunks need to be sent.
119- pub fn total ( & self ) -> Option < usize > {
120- self . remaining ( ) . map ( |remaining| self . sent ( ) + remaining)
121- }
12284}
12385
12486/// A communication channel used to send/receive messages to/from another party.
@@ -166,8 +128,6 @@ pub(crate) async fn send_to<S: Serialize + std::fmt::Debug>(
166128 } ) ?;
167129 let info = SendInfo {
168130 phase : phase. to_string ( ) ,
169- current_msg : 0 ,
170- remaining_msgs : 0 ,
171131 } ;
172132 channel
173133 . send_bytes_to ( party, data, info)
@@ -187,8 +147,6 @@ pub(crate) async fn recv_from<T: DeserializeOwned + std::fmt::Debug>(
187147) -> Result < Vec < T > , Error > {
188148 let info = RecvInfo {
189149 phase : phase. to_string ( ) ,
190- current_msg : 0 ,
191- remaining_msgs : Some ( 0 ) ,
192150 } ;
193151 let data = channel
194152 . recv_bytes_from ( party, info)
@@ -417,12 +375,7 @@ impl Channel for SimpleChannel {
417375 self . bytes_sent
418376 . fetch_add ( msg. len ( ) as u64 , Ordering :: Relaxed ) ;
419377 let mb = msg. len ( ) as f64 / 1024.0 / 1024.0 ;
420- let i = info. sent ( ) ;
421- if i == 1 {
422- trace ! ( size = mb, "Sending msg" ) ;
423- } else {
424- trace ! ( size = mb, " (continued sending msg)" ) ;
425- }
378+ trace ! ( size = mb, "Sending msg" ) ;
426379 self . s [ p]
427380 . as_ref ( )
428381 . unwrap_or_else ( || panic ! ( "No sender for party {p}" ) )
0 commit comments