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

fix(network): consider MultiAddrNotSupported as a serioud issu.. #2628

Merged
Merged
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
22 changes: 16 additions & 6 deletions ant-networking/src/event/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,21 +434,27 @@ impl SwarmDriver {
// unless there are _specific_ errors (connection refused eg)
error!("Dial errors len : {:?}", errors.len());
let mut there_is_a_serious_issue = false;
// Libp2p throws errors for all the listen addr (including private) of the remote peer even
// though we try to dial just the global/public addr. This would mean that we get
// MultiaddrNotSupported error for the private addr of the peer.
//
// Just a single MultiaddrNotSupported error is not a critical issue, but if all the listen
// addrs of the peer are private, then it is a critical issue.
let mut all_multiaddr_not_supported = true;
for (_addr, err) in errors {
error!("OutgoingTransport error : {err:?}");

match err {
TransportError::MultiaddrNotSupported(addr) => {
warn!("Multiaddr not supported : {addr:?}");
warn!("OutgoingConnectionError: Transport::MultiaddrNotSupported {addr:?}. This can be ignored if the peer has atleast one global address.");
#[cfg(feature = "loud")]
{
println!("Multiaddr not supported : {addr:?}");
warn!("OutgoingConnectionError: Transport::MultiaddrNotSupported {addr:?}. This can be ignored if the peer has atleast one global address.");
println!("If this was your bootstrap peer, restart your node with a supported multiaddr");
}
// if we can't dial a peer on a given address, we should remove it from the routing table
there_is_a_serious_issue = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the default value of all_multiaddr_not_supported is to be true, here actually doing the same? then what's the point to change ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set it to all_multiaddr_not_supported = false below.
Only if the entire Vec<Error> is MultiaddrNotSupported, we really go after this error, else this error is harmless.

}
TransportError::Other(err) => {
error!("OutgoingConnectionError: Transport::Other {err:?}");

all_multiaddr_not_supported = false;
let problematic_errors = [
"ConnectionRefused",
"HostUnreachable",
Expand Down Expand Up @@ -481,6 +487,10 @@ impl SwarmDriver {
}
}
}
if all_multiaddr_not_supported {
warn!("All multiaddrs had MultiaddrNotSupported error for {failed_peer_id:?}. Marking it as a serious issue.");
there_is_a_serious_issue = true;
}
there_is_a_serious_issue
}
DialError::NoAddresses => {
Expand Down
Loading