@@ -329,17 +329,26 @@ impl<V: Value, VS: ValueSelector<V>> Party<V, VS> {
329
329
sleep( self . cfg. grace_period) . await ;
330
330
if let Some ( msg) = msg {
331
331
let meta = ( msg. routing. msg_type, msg. routing. sender) ;
332
- if !self . rate_limiter. contains( & meta) {
333
- debug!( "Party {} received {} from party {}" , self . id, meta. 0 , meta. 1 ) ;
334
- if let Err ( err) = self . update_state( & msg) {
335
- // Shouldn't fail the party, since invalid message
336
- // may be sent by anyone. Furthermore, since in consensus
337
- // we are relying on redundancy of parties, we actually may need
338
- // less messages than from every party to transit to next status.
339
- warn!( "Failed to update state for party {} with {}, got error: {err}" , self . id, meta. 0 )
340
- }
341
- self . rate_limiter. insert( meta) ;
332
+ debug!( "Party {} received {} from party {}" , self . id, meta. 0 , meta. 1 ) ;
333
+
334
+ if self . id == meta. 1 {
335
+ warn!( "Received own message {}, intended to be broadcasted." , meta. 0 ) ;
336
+ continue
337
+ }
338
+ if self . rate_limiter. contains( & meta) {
339
+ warn!( "Party {} hit rate limit in party {} for message {}" , meta. 1 , self . id, meta. 0 ) ;
340
+ continue
342
341
}
342
+
343
+ if let Err ( err) = self . update_state( & msg) {
344
+ // Shouldn't fail the party, since invalid message
345
+ // may be sent by anyone. Furthermore, since in consensus
346
+ // we are relying on redundancy of parties, we actually may need
347
+ // less messages than from every party to transit to next status.
348
+ warn!( "Failed to update state for party {} with {}, got error: {err}" , self . id, meta. 0 )
349
+ }
350
+ self . rate_limiter. insert( meta) ;
351
+
343
352
} else if self . msg_in_receiver. is_closed( ) {
344
353
self . status = PartyStatus :: Failed ;
345
354
return Err ( MessageChannelClosed )
0 commit comments