-
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: implement Happy Eyeballs ranking #2365
Conversation
9bf1c22
to
a276a21
Compare
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.
lgtm, modulo the question regarding swapping vs shifting
p2p/net/swarm/dial_ranker.go
Outdated
if isQUICAddr(addrs[0]) && isProtocolAddr(addrs[0], ma.P_IP6) { | ||
for i := 1; i < len(addrs); i++ { | ||
if isQUICAddr(addrs[i]) && isProtocolAddr(addrs[i], ma.P_IP4) { | ||
addrs[i], addrs[1] = addrs[1], addrs[i] |
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.
Is swapping the right thing to do here, or should the address be inserted at position 1, shifting all other addresses?
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.
There's no impact because we have three tiers:
IPv6 dialed first, IPv4 dialed second, rest of the addresses.
I'll change it to shifting though because that seems more correct in case we eventually want to dial only a single address at a time.
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.
updated
a276a21
to
fcdb696
Compare
Depends on #2320
Ignores #2349 We can take that up after this.