mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
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:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user