diff --git a/client/finality-grandpa/src/lib.rs b/client/finality-grandpa/src/lib.rs index c7f7c8517b957..c5ac1189e943e 100644 --- a/client/finality-grandpa/src/lib.rs +++ b/client/finality-grandpa/src/lib.rs @@ -676,10 +676,10 @@ pub fn grandpa_peers_set_config() -> sc_network::config::NonDefaultSetConfig { // Notifications reach ~256kiB in size at the time of writing on Kusama and Polkadot. max_notification_size: 1024 * 1024, set_config: sc_network::config::SetConfig { - in_peers: 25, - out_peers: 25, + in_peers: 0, + out_peers: 0, reserved_nodes: Vec::new(), - non_reserved_mode: sc_network::config::NonReservedPeerMode::Accept, + non_reserved_mode: sc_network::config::NonReservedPeerMode::Deny, }, } } diff --git a/client/network/src/protocol.rs b/client/network/src/protocol.rs index 60b6a02cc7bab..4997bc36e53e7 100644 --- a/client/network/src/protocol.rs +++ b/client/network/src/protocol.rs @@ -424,12 +424,11 @@ impl Protocol { // The `reserved_nodes` of this set are later kept in sync with the peers we connect // to through set 0. sets.push(sc_peerset::SetConfig { - in_peers: network_config.default_peers_set.in_peers, - out_peers: network_config.default_peers_set.out_peers, + in_peers: 0, + out_peers: 0, bootnodes: Vec::new(), - reserved_nodes: default_sets_reserved, - reserved_only: network_config.default_peers_set.non_reserved_mode - == config::NonReservedPeerMode::Deny, + reserved_nodes: HashSet::new(), + reserved_only: true, }); for set_cfg in &network_config.extra_sets { @@ -1698,7 +1697,7 @@ impl NetworkBehaviour for Protocol { if self.on_sync_peer_connected(peer_id.clone(), handshake).is_ok() { // Set 1 is kept in sync with the connected peers of set 0. - self.peerset_handle.add_to_peers_set( + self.peerset_handle.add_reserved_peer( HARDCODED_PEERSETS_TX, peer_id.clone() ); @@ -1722,7 +1721,7 @@ impl NetworkBehaviour for Protocol { Ok(handshake) => { if self.on_sync_peer_connected(peer_id.clone(), handshake).is_ok() { // Set 1 is kept in sync with the connected peers of set 0. - self.peerset_handle.add_to_peers_set( + self.peerset_handle.add_reserved_peer( HARDCODED_PEERSETS_TX, peer_id.clone() );