mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
gossip: choose a random subset on send instead of limiting connections (#2776)
* gossip: choose random subset on send * naming bikeshed
This commit is contained in:
@@ -40,6 +40,9 @@ pub mod request_response;
|
||||
|
||||
/// A version of the protocol.
|
||||
pub type ProtocolVersion = u32;
|
||||
/// The minimum amount of peers to send gossip messages to.
|
||||
pub const MIN_GOSSIP_PEERS: usize = 25;
|
||||
|
||||
|
||||
/// An error indicating that this the over-arching message type had the wrong variant
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
|
||||
@@ -57,7 +57,8 @@ impl PeerSet {
|
||||
notifications_protocol: protocol,
|
||||
max_notification_size,
|
||||
set_config: sc_network::config::SetConfig {
|
||||
in_peers: 25,
|
||||
// we want our gossip subset to always include reserved peers
|
||||
in_peers: super::MIN_GOSSIP_PEERS as u32 / 2,
|
||||
out_peers: 0,
|
||||
reserved_nodes: Vec::new(),
|
||||
non_reserved_mode: sc_network::config::NonReservedPeerMode::Accept,
|
||||
|
||||
Reference in New Issue
Block a user