Unverified Commit 4a1b35aa authored by Andronik Ordian's avatar Andronik Ordian Committed by GitHub
Browse files

validator-discovery: some extra logs (#3157)

* remove duplicate logging

* validator-discovery: add extra logging
parent 093af455
Pipeline #140562 passed with stages
in 38 minutes and 48 seconds
......@@ -436,6 +436,8 @@ where
if !rep.is_benefit() {
tracing::debug!(
target: LOG_TARGET,
?peer,
?rep,
action = "ReportPeer"
);
}
......
......@@ -211,12 +211,6 @@ impl Network for Arc<NetworkService<Block, Hash>> {
fn start_send(self: Pin<&mut Self>, action: NetworkAction) -> SubsystemResult<()> {
match action {
NetworkAction::ReputationChange(peer, cost_benefit) => {
tracing::debug!(
target: LOG_TARGET,
"Changing reputation: {:?} for {}",
cost_benefit,
peer
);
self.0.report_peer(peer, cost_benefit.into_base_rep())
}
NetworkAction::DisconnectPeer(peer, peer_set) => self
......
......@@ -89,6 +89,7 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
// collect multiaddress of validators
let mut failed_to_resolve: usize = 0;
let mut newly_requested = HashSet::new();
let requested = validator_ids.len();
for authority in validator_ids.into_iter() {
let result = authority_discovery_service.get_addresses_by_authority_id(authority.clone()).await;
if let Some(addresses) = result {
......@@ -101,15 +102,24 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
let state = &mut self.state[peer_set];
// clean up revoked requests
let multiaddr_to_remove = state.previously_requested
let multiaddr_to_remove: HashSet<_> = state.previously_requested
.difference(&newly_requested)
.cloned()
.collect();
let multiaddr_to_add = newly_requested.difference(&state.previously_requested)
let multiaddr_to_add: HashSet<_> = newly_requested.difference(&state.previously_requested)
.cloned()
.collect();
state.previously_requested = newly_requested;
tracing::debug!(
target: LOG_TARGET,
?peer_set,
?requested,
added = multiaddr_to_add.len(),
removed = multiaddr_to_remove.len(),
?failed_to_resolve,
"New ConnectToValidators request",
);
// ask the network to connect to these nodes and not disconnect
// from them until removed from the set
if let Err(e) = network_service.add_to_peers_set(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment