@@ -127,8 +127,6 @@ pub struct Network<AppReqId: ReqId, TSpec: EthSpec> {
127127 gossip_cache : GossipCache ,
128128 /// This node's PeerId.
129129 pub local_peer_id : PeerId ,
130- /// Flag to disable warning logs for duplicate gossip messages and log at DEBUG level instead.
131- pub disable_duplicate_warn_logs : bool ,
132130 /// Logger for behaviour actions.
133131 log : slog:: Logger ,
134132}
@@ -427,7 +425,6 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
427425 update_gossipsub_scores,
428426 gossip_cache,
429427 local_peer_id,
430- disable_duplicate_warn_logs : config. disable_duplicate_warn_logs ,
431428 log,
432429 } ;
433430
@@ -746,21 +743,23 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
746743 . gossipsub_mut ( )
747744 . publish ( Topic :: from ( topic. clone ( ) ) , message_data. clone ( ) )
748745 {
749- if self . disable_duplicate_warn_logs && matches ! ( e, PublishError :: Duplicate ) {
750- debug ! (
751- self . log,
752- "Could not publish message" ;
753- "error" => ?e,
754- "kind" => %topic. kind( ) ,
755- ) ;
756- } else {
757- warn ! (
758- self . log,
759- "Could not publish message" ;
760- "error" => ?e,
761- "kind" => %topic. kind( ) ,
762- ) ;
763- } ;
746+ match e {
747+ PublishError :: Duplicate => {
748+ debug ! (
749+ self . log,
750+ "Attempted to publish duplicate message" ;
751+ "kind" => %topic. kind( ) ,
752+ ) ;
753+ }
754+ ref e => {
755+ warn ! (
756+ self . log,
757+ "Could not publish message" ;
758+ "error" => ?e,
759+ "kind" => %topic. kind( ) ,
760+ ) ;
761+ }
762+ }
764763
765764 // add to metrics
766765 match topic. kind ( ) {
0 commit comments