Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence NoPeers discovery errors #2476

Merged
merged 5 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions bin/light-base/src/network_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,31 @@ async fn update_round<TPlat: Platform>(
guarded.network.discover(&TPlat::now(), chain_index, nodes);
}
Err(error) => {
log::warn!(
log::debug!(
target: "connections",
"Problem during discovery on {}: {}",
&shared.log_chain_names[chain_index],
"Discovery => {:?}",
error
);

// No error is printed if the error is about the fact that we have
// 0 peers, as this tends to happen quite frequently at initialization
// and there is nothing that can be done against this error anyway.
// No error is printed either if the request fails due to a benign
// networking error such as an unresponsive peer.
match error {
service::DiscoveryError::NoPeer => {}
service::DiscoveryError::FindNode(
service::KademliaFindNodeError::RequestFailed(err),
) if !err.is_protocol_error() => {}
_ => {
log::warn!(
target: "connections",
"Problem during discovery on {}: {}",
&shared.log_chain_names[chain_index],
error
);
}
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## Changed

- No warning is generated anymore if the discovery process doesn't work due to having 0 peers, or failed due to a benign networking issue. ([#2476](https://github.com/paritytech/smoldot/pull/2476))

### Fixed

- Changes in the current best block of a parachain are now taken into account if the new best block had already been reported in the past. ([#2457](https://github.com/paritytech/smoldot/pull/2457))
Expand Down