Disable validation/collation protocols for normal full nodes (#7601)

If authority discovery is not enabled, `Overseer` is not enabled,
meaning `NetworkBridge` is not started. Validation/collation protocols
are, however, enabled even if the `NetworkBridge` is not started.

Currently this results in normal Polkadot full nodes advertising these
protocols, accepting inbound substreams and even establishing outbound
substreams for the validation protocol. Since the `NetworkBridge` is
not started and no protocol in Substrate is interested in these
protocol events, the events are relayed to all protocol handlers but
are getting discarded because no installed protocol is interested in them.

Co-authored-by: parity-processbot <>
This commit is contained in:
Aaro Altonen
2023-08-14 17:34:38 +03:00
committed by GitHub
parent 342d720573
commit 2194b95708
+2 -1
View File
@@ -828,10 +828,11 @@ pub fn new_full<OverseerGenerator: OverseerGen>(
net_config.add_request_response_protocol(beefy_req_resp_cfg);
}
// validation/collation protocols are enabled only if `Overseer` is enabled
let peerset_protocol_names =
PeerSetProtocolNames::new(genesis_hash, config.chain_spec.fork_id());
{
if auth_or_collator || overseer_enable_anyways {
use polkadot_network_bridge::{peer_sets_info, IsAuthority};
let is_authority = if role.is_authority() { IsAuthority::Yes } else { IsAuthority::No };
for config in peer_sets_info(is_authority, &peerset_protocol_names) {