@@ -127,8 +127,6 @@ pub struct Network<AppReqId: ReqId, TSpec: EthSpec> {
127
127
gossip_cache : GossipCache ,
128
128
/// This node's PeerId.
129
129
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 ,
132
130
/// Logger for behaviour actions.
133
131
log : slog:: Logger ,
134
132
}
@@ -427,7 +425,6 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
427
425
update_gossipsub_scores,
428
426
gossip_cache,
429
427
local_peer_id,
430
- disable_duplicate_warn_logs : config. disable_duplicate_warn_logs ,
431
428
log,
432
429
} ;
433
430
@@ -746,21 +743,23 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
746
743
. gossipsub_mut ( )
747
744
. publish ( Topic :: from ( topic. clone ( ) ) , message_data. clone ( ) )
748
745
{
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
+ }
764
763
765
764
// add to metrics
766
765
match topic. kind ( ) {
0 commit comments