Skip to content

Commit f776485

Browse files
authored
Merge of #5163
2 parents b750c8d + 7c35e2a commit f776485

File tree

7 files changed

+18
-59
lines changed

7 files changed

+18
-59
lines changed

beacon_node/lighthouse_network/src/config.rs

-5
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

+17-18
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
}
@@ -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() {

beacon_node/src/cli.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1271,11 +1271,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
12711271
.arg(
12721272
Arg::with_name("disable-duplicate-warn-logs")
12731273
.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.")
1274+
.help("This flag is deprecated and has no effect.")
12791275
.takes_value(false)
12801276
)
12811277
.group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"]).multiple(true))

beacon_node/src/config.rs

-3
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

-5
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

-4
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

-19
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)