-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
swarm: add loopback to low timeout filter #2595
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.
I've changed my mind here considering this:
There are a few more ranges from http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml that aren't in that list. I'm not sure if there's a reason or if it was just forgotten. I'm happy to extend this PR to add the missing ones as well.
Let's remove this lowTimeoutFilters construct and use manet.IsPublicAddr
or manet.IsPrivateAddr
. That will keep this definition in one place.
https://pkg.go.dev/github.com/multiformats/go-multiaddr/net#IsPrivateAddr
464e330
to
e3d6cbc
Compare
Changed to use |
Context: - libp2p/go-libp2p#2595 - #48
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.
This PR is fine. The flakiness is because of issues with webrtc-direct implementation. That will be handled in #2586
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.
Nice job deleting addrs.go!
@sukunrt suggested lowering
swarm.WithDialTimeoutLocal
to prevent our tests from timing out because of blocking dials. In our tests, we connect via loopback addresses, and I noticed that theswarm.WithDialTimeoutLocal
wasn't applied.In this PR, I added the loopback CIDR to the list of CIDRs to which the local timeout applies.
There are a few more ranges from http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml that aren't in that list. I'm not sure if there's a reason or if it was just forgotten. I'm happy to extend this PR to add the missing ones as well.
These are missing: