Skip to content

Commit 6bc70f5

Browse files
committed
Downgrade duplicate publish logs
1 parent a257a12 commit 6bc70f5

File tree

7 files changed

+17
-64
lines changed

7 files changed

+17
-64
lines changed

beacon_node/lighthouse_network/src/config.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ pub struct Config {
157157

158158
/// Configuration for the inbound rate limiter (requests received by this node).
159159
pub inbound_rate_limiter_config: Option<InboundRateLimiterConfig>,
160-
161-
/// Whether to disable logging duplicate gossip messages as WARN. If set to true, duplicate
162-
/// errors will be logged at DEBUG level.
163-
pub disable_duplicate_warn_logs: bool,
164160
}
165161

166162
impl Config {
@@ -378,7 +374,6 @@ impl Default for Config {
378374
outbound_rate_limiter_config: None,
379375
invalid_block_storage: None,
380376
inbound_rate_limiter_config: None,
381-
disable_duplicate_warn_logs: false,
382377
}
383378
}
384379
}

beacon_node/lighthouse_network/src/service/mod.rs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}
@@ -426,7 +424,6 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
426424
update_gossipsub_scores,
427425
gossip_cache,
428426
local_peer_id,
429-
disable_duplicate_warn_logs: config.disable_duplicate_warn_logs,
430427
log,
431428
};
432429

@@ -745,21 +742,23 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
745742
.gossipsub_mut()
746743
.publish(Topic::from(topic.clone()), message_data.clone())
747744
{
748-
if self.disable_duplicate_warn_logs && matches!(e, PublishError::Duplicate) {
749-
debug!(
750-
self.log,
751-
"Could not publish message";
752-
"error" => ?e,
753-
"kind" => %topic.kind(),
754-
);
755-
} else {
756-
warn!(
757-
self.log,
758-
"Could not publish message";
759-
"error" => ?e,
760-
"kind" => %topic.kind(),
761-
);
762-
};
745+
match e {
746+
PublishError::Duplicate => {
747+
debug!(
748+
self.log,
749+
"Attempted to publish duplicate message";
750+
"kind" => %topic.kind(),
751+
);
752+
}
753+
ref e => {
754+
warn!(
755+
self.log,
756+
"Could not publish message";
757+
"error" => ?e,
758+
"kind" => %topic.kind(),
759+
);
760+
}
761+
}
763762

764763
// add to metrics
765764
match topic.kind() {

beacon_node/src/cli.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,15 +1268,5 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
12681268
.default_value("64")
12691269
.takes_value(true)
12701270
)
1271-
.arg(
1272-
Arg::with_name("disable-duplicate-warn-logs")
1273-
.long("disable-duplicate-warn-logs")
1274-
.help("Disable warning logs for duplicate gossip messages. The WARN level log is \
1275-
useful for detecting a duplicate validator key running elsewhere. However, this may \
1276-
result in excessive warning logs if the validator is broadcasting messages to \
1277-
multiple beacon nodes via the validator client --broadcast flag. In this case, \
1278-
disabling these warn logs may be useful.")
1279-
.takes_value(false)
1280-
)
12811271
.group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"]).multiple(true))
12821272
}

beacon_node/src/config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,6 @@ pub fn set_network_config(
14251425
Some(config_str.parse()?)
14261426
}
14271427
};
1428-
1429-
config.disable_duplicate_warn_logs = cli_args.is_present("disable-duplicate-warn-logs");
1430-
14311428
Ok(())
14321429
}
14331430

book/src/help_bn.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ FLAGS:
3232
--disable-deposit-contract-sync Explicitly disables syncing of deposit logs from the execution node. This
3333
overrides any previous option that depends on it. Useful if you intend to
3434
run a non-validating beacon node.
35-
--disable-duplicate-warn-logs Disable warning logs for duplicate gossip messages. The WARN level log is
36-
useful for detecting a duplicate validator key running elsewhere.
37-
However, this may result in excessive warning logs if the validator is
38-
broadcasting messages to multiple beacon nodes via the validator client
39-
--broadcast flag. In this case, disabling these warn logs may be useful.
4035
-x, --disable-enr-auto-update Discovery automatically updates the nodes local ENR with an external IP
4136
address and port as seen by other peers on the network. This disables
4237
this feature, fixing the ENR's IP/PORT to those specified on boot.

book/src/redundancy.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ from this list:
101101
- `none`: Disable all broadcasting. This option only has an effect when provided alone, otherwise
102102
it is ignored. Not recommended except for expert tweakers.
103103

104-
Broadcasting attestation, blocks and sync committee messages may result in excessive warning logs in the beacon node
105-
due to duplicate gossip messages. In this case, it may be desirable to disable warning logs for duplicates using the
106-
beacon node `--disable-duplicate-warn-logs` flag.
107-
108104
The default is `--broadcast subscriptions`. To also broadcast blocks for example, use
109105
`--broadcast subscriptions,blocks`.
110106

lighthouse/tests/beacon_node.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,22 +2584,3 @@ fn genesis_state_url_value() {
25842584
assert_eq!(config.genesis_state_url_timeout, Duration::from_secs(42));
25852585
});
25862586
}
2587-
2588-
#[test]
2589-
fn disable_duplicate_warn_logs_default() {
2590-
CommandLineTest::new()
2591-
.run_with_zero_port()
2592-
.with_config(|config| {
2593-
assert_eq!(config.network.disable_duplicate_warn_logs, false);
2594-
});
2595-
}
2596-
2597-
#[test]
2598-
fn disable_duplicate_warn_logs() {
2599-
CommandLineTest::new()
2600-
.flag("disable-duplicate-warn-logs", None)
2601-
.run_with_zero_port()
2602-
.with_config(|config| {
2603-
assert_eq!(config.network.disable_duplicate_warn_logs, true);
2604-
});
2605-
}

0 commit comments

Comments
 (0)