Log info about low connectivity and unreachable validators (#3916)

* Attempt to add log stats to gossip-support.

* WIP: Keep track of connected validators.

* Clarify metric.

* WIP: Make gossip support report connectivity.

* WIP: Fixing tests.

* Fix network bridge + integrate in overseer.

* Consistent naming.

* Fix logic error

* cargo fmt

* Pretty logs.

* cargo fmt

* Use `Delay` to trigger periodic checks.

* fmt

* Fix warning for authority set size of 1.

* More correct ratio report if there are no resolved validators.

* Prettier rendering of empty set.

* Fix typo.

* Another typo.

* Don't check on every leaf update.

* Make compatible with older rustc.

* Fix tests.

* Demote warning.
This commit is contained in:
Robert Klotzner
2021-09-27 16:30:02 +02:00
committed by GitHub
parent fdebbbf4b3
commit 7c3b3c4a59
11 changed files with 635 additions and 315 deletions
+16 -2
View File
@@ -23,6 +23,7 @@
//! Subsystems' APIs are defined separately from their implementation, leading to easier mocking.
use futures::channel::oneshot;
use sc_network::Multiaddr;
use thiserror::Error;
pub use sc_network::IfDisconnected;
@@ -345,6 +346,14 @@ pub enum NetworkBridgeMessage {
/// authority discovery has failed to resolve.
failed: oneshot::Sender<usize>,
},
/// Alternative to `ConnectToValidators` in case you already know the `Multiaddrs` you want to be
/// connected to.
ConnectToResolvedValidators {
/// Each entry corresponds to the addresses of an already resolved validator.
validator_addrs: Vec<Vec<Multiaddr>>,
/// The peer set we want the connection on.
peer_set: PeerSet,
},
/// Inform the distribution subsystems about the new
/// gossip network topology formed.
NewGossipTopology {
@@ -365,6 +374,7 @@ impl NetworkBridgeMessage {
Self::SendValidationMessages(_) => None,
Self::SendCollationMessages(_) => None,
Self::ConnectToValidators { .. } => None,
Self::ConnectToResolvedValidators { .. } => None,
Self::SendRequests { .. } => None,
Self::NewGossipTopology { .. } => None,
}
@@ -850,5 +860,9 @@ pub enum ApprovalDistributionMessage {
}
/// Message to the Gossip Support subsystem.
#[derive(Debug)]
pub enum GossipSupportMessage {}
#[derive(Debug, derive_more::From)]
pub enum GossipSupportMessage {
/// Dummy constructor, so we can receive networking events.
#[from]
NetworkBridgeUpdateV1(NetworkBridgeEvent<protocol_v1::GossipSuppportNetworkMessage>),
}