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
net: attempts to connect to all resolved addresses when connecting to a node #28834
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
CI failed |
6f0affc
to
3bb2cd9
Compare
There was an issue with the interaction of the change and using a proxy. It should be fixed now |
7029960
to
8efc4c3
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.
Concept ACK, will review soon.
8efc4c3
to
9c1ab79
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.
Would be good to adjust the title / commit message to be more general:
The solution doesn't specifically address addnode
but changes OpenNetworkConnection
/ ConnectNode
and therefore all callers that use it with pszDest
set (-connect
, -seednode
, test-only -addconnection
) are affected by the change.
9c1ab79
to
dc786b5
Compare
addnode
Updated both commit message/title and PR title/desciption |
Rebased to fix CI |
Concept ACK |
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.
Approach ACK 494c732, just a naming nit below.
494c732
to
ba02108
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.
ACK ba02108
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.
ACK a75975e
518019b
to
216efd6
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
Rebased to address merge conflicts |
@vasild @mzumsande @naumenkogs would you mind re-checking this? It feels like it's been ready for a while but it keeps being 1 ack short |
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 like something went wrong with the rebase, there are two commits with rust code that don't seem related.
Not really sure what happened here 🤔 but should be fixed now |
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.
re-ACK ae7afa5
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.
ACK ae7afa5
… a node Prior to this, when establishing a network connection via CConnman::ConnectNode, if the connection needed address resolution, a single address would be picked at random from the resolved addresses and our node will try to connect to it. However, this would lead to the behavior of ConnectNode being unpredictable when the address was resolved to various ips (e.g. the address resolving to IPv4 and IPv6, but we only support one of them). This patches the aforementioned behavior by going over all resolved IPs until we find one we can connect to or until we exhaust them.
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.
ACK fd81a37
re-ACK fd81a37 (just looked at diff, only small logging change) |
ACK fd81a37 |
This is a follow-up of #28155 motivated by #28155 (comment)
Rationale
Prior to this, when establishing a network connection via
CConnman::ConnectNode
, if the connection needed address resolution, a single address would be picked at random from the resolved addresses and our node would try to connect to it. However, this would lead to the behavior ofConnectNode
being unpredictable when the address was resolved to various ips (e.g. the address resolving to IPv4 and IPv6, but we only support one of them).This patches the aforementioned behavior by going over all resolved IPs until a valid one is found or until we
exhaust them.