-
Notifications
You must be signed in to change notification settings - Fork 38.7k
net: Add addresses to local addr map even if their network is unreachable #25690
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference, #24835 (which recently got closed) attempted the same, although for another reason. There is some more relevant discussion there.
I think that this this from my comment still applies
If removing the IsReachable call from AddLocal(), I think that IsPeerAddrLocalGood() should be adjusted too
Thanks! I missed this but the discussion there seems to be in line with what I found. Since there was no clear support for this approach I will close this here and maybe think about suggesting another solution. |
|
I think it's not ideal that the |
Yeah, I had been thinking about fixing this with a new config option as well, although I went into a different direction than you had in mind. I would be happy if you could give your thoughts on my draft in #25718. |
There is a way to restrict incoming connections by network type - use Or |
Closes #25669 and possibly also addresses #25336
Local addresses specified with
externalipare currently not added tomapLocalHostif their network is set unreachable. This does not seem to be necessary because typically the network is set unreachable if outbound connections via the network are disabled viaonion=0,onlynetetc. On the inbound side this does not necessarily mean there are any restrictions in place. For the use cases that Matt and kroese seem to have there rather seems to be a deliberate choice that a net is not reachable outbound although it is available inbound.From my understanding
mapLocalHostis used to prevent the node from connecting to itself and getting a local address to announce to a peer. For the first use case this change may mean that there are some addresses in the map that are never checked because there are no outbound connections on that net. But that doesn't seem to be an issue. For the second use case the upside is that the address actually gets announced to peers. In the case of the open issues mentioned above this does seem to be the intention of the users. On the downside this may also mean that the address is announced even when this particular network is blocked in some way. This seems to have been the original intention by sipa when adding this check but also this was in 2012 and I am sure some of the context was different. In this case it makes more sense to me to assume that the users know what they are doing rather than assuming there is some network issue the user not aware of.Additionally the change means that these addresses now appear in
getnetworkinfo.I have considered and drafted other ways of addressing this issue but this seems to be the most straight forward approach unless I am overlooking something and the downside outlined above is too big of an issue.