Downgrade gossipsub duplicate logs (#5163)

* Downgrade duplicate publish logs

* Maintain backwards compatiblity, deprecate flag

* The tests had to go, because there's no config to test against

* Update help_bn.md
This commit is contained in:
Age Manning
2024-02-06 07:24:01 +00:00
committed by GitHub
parent 5cc29e47c5
commit 853042746b
7 changed files with 19 additions and 59 deletions

View File

@@ -157,10 +157,6 @@ pub struct Config {
/// Configuration for the inbound rate limiter (requests received by this node).
pub inbound_rate_limiter_config: Option<InboundRateLimiterConfig>,
/// Whether to disable logging duplicate gossip messages as WARN. If set to true, duplicate
/// errors will be logged at DEBUG level.
pub disable_duplicate_warn_logs: bool,
}
impl Config {
@@ -378,7 +374,6 @@ impl Default for Config {
outbound_rate_limiter_config: None,
invalid_block_storage: None,
inbound_rate_limiter_config: None,
disable_duplicate_warn_logs: false,
}
}
}

View File

@@ -127,8 +127,6 @@ pub struct Network<AppReqId: ReqId, TSpec: EthSpec> {
gossip_cache: GossipCache,
/// This node's PeerId.
pub local_peer_id: PeerId,
/// Flag to disable warning logs for duplicate gossip messages and log at DEBUG level instead.
pub disable_duplicate_warn_logs: bool,
/// Logger for behaviour actions.
log: slog::Logger,
}
@@ -427,7 +425,6 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
update_gossipsub_scores,
gossip_cache,
local_peer_id,
disable_duplicate_warn_logs: config.disable_duplicate_warn_logs,
log,
};
@@ -746,21 +743,23 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
.gossipsub_mut()
.publish(Topic::from(topic.clone()), message_data.clone())
{
if self.disable_duplicate_warn_logs && matches!(e, PublishError::Duplicate) {
debug!(
self.log,
"Could not publish message";
"error" => ?e,
"kind" => %topic.kind(),
);
} else {
warn!(
self.log,
"Could not publish message";
"error" => ?e,
"kind" => %topic.kind(),
);
};
match e {
PublishError::Duplicate => {
debug!(
self.log,
"Attempted to publish duplicate message";
"kind" => %topic.kind(),
);
}
ref e => {
warn!(
self.log,
"Could not publish message";
"error" => ?e,
"kind" => %topic.kind(),
);
}
}
// add to metrics
match topic.kind() {