-
Notifications
You must be signed in to change notification settings - Fork 446
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(libp2p): sort addresses to dial as public, then relay #2031
Conversation
Adds a new default address sorter that sorts by: 1. public addresses 2. public relay addresess 3. private addresses 4. private relay addresses Where they are equal, certified addresses take priority, otherwise the sort order is stable.
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.
Looks good, I would just like to understand the rationale for prioritizing a certified private address over a public address, wouldn't it be less likely that the private address is routable?
It doesn't - take a look at the relevant test - public addresses are prioritised over private addresses, and certified addresses are prioritised over non-certified addresses but certified private addresses are not prioritised over public addresses. |
What about this test? It seems to contradict that. |
That test only tests the |
That's true, but I suppose if a consumer is using the |
Adds a new default address sorter that sorts by:
Where they are equal, certified addresses take priority, otherwise the sort order is stable.
Refs: #2010