You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For simplicity, I like to have my nodes listen on all network interfaces. Also, I'm building a local file sharing app that relies on mDNS and request_response.
request_response automatically initiates dialling, without any intervention from the user's side (possible, afaik)
Since mDNS wildly publishes all listening addresses on all interfaces as already mentioned here, there are loopback addresses among the dialing candidates that request_response ends up using.
This means that the node ends up dialing itself.
It does not ignore contacting itself silently, instead, the entire dial fails with a libp2p::swarm::DialError::WrongPeerId
In order to make my node work nonetheless I had to fork the repository and add this hotfix
I see it as non-negotiable that mDNS should, on each interface, only broadcast its listening address on that interface to avoid bugs like this.
As a side note, finding the cause of this has been an ordeal. I'm trying to make this work on Android (and weirdly I encounter this issue only there), and changing the log level and inspecting the logs is not very straightforward there. I added up modifying the libp2p code to add print statements and had to discover that the very very useless request_response::OutboundFailure::DialFailure could easily be enhanced by wrapping the aforementioned libp2p::swarm::DialErrorhere.
Error handling via trace-logging should not be a thing, particularly in Rust
Expected behavior
mDNS should only publish addresses that make sense
Actual behavior
it publishes all addresses on all interfaces
Relevant log output
Possible Solution
No response
Version
0.55.1
Would you like to work on fixing this bug?
No
The text was updated successfully, but these errors were encountered:
Summary
For simplicity, I like to have my nodes listen on all network interfaces. Also, I'm building a local file sharing app that relies on mDNS and request_response.
request_response automatically initiates dialling, without any intervention from the user's side (possible, afaik)
Since mDNS wildly publishes all listening addresses on all interfaces as already mentioned here, there are loopback addresses among the dialing candidates that request_response ends up using.
This means that the node ends up dialing itself.
It does not ignore contacting itself silently, instead, the entire dial fails with a
libp2p::swarm::DialError::WrongPeerId
In order to make my node work nonetheless I had to fork the repository and add this hotfix
I see it as non-negotiable that mDNS should, on each interface, only broadcast its listening address on that interface to avoid bugs like this.
As a side note, finding the cause of this has been an ordeal. I'm trying to make this work on Android (and weirdly I encounter this issue only there), and changing the log level and inspecting the logs is not very straightforward there. I added up modifying the libp2p code to add print statements and had to discover that the very very useless
request_response::OutboundFailure::DialFailure
could easily be enhanced by wrapping the aforementionedlibp2p::swarm::DialError
here.Error handling via trace-logging should not be a thing, particularly in Rust
Expected behavior
mDNS should only publish addresses that make sense
Actual behavior
it publishes all addresses on all interfaces
Relevant log output
Possible Solution
No response
Version
0.55.1
Would you like to work on fixing this bug?
No
The text was updated successfully, but these errors were encountered: