-
Notifications
You must be signed in to change notification settings - Fork 38.7k
p2p: set -dnsseed and -listen false if maxconnections=0
#26899
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
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
|
ACK c5c6116 Current behaviour is that a node run with With this patch the node no longer makes connections to the DNS seeds to fetch addresses. (You may want to amend the wording for the I think that the new behaviour makes sense as a user specifying an option |
Perfect, force-pushed addressing it! |
|
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
3acbb5f to
c85b634
Compare
Done. |
|
Concept ACK c85b634340727b54e4dc8c6fd02fdc2e06531e31 However, the log messages at line 678 and 680 now may be confusing. It only mentions Maybe it should be updated? |
c85b634 to
58fab41
Compare
Sure, force-pushed doing it! |
|
re-ACK 58fab41 |
stickies-v
left a comment
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
58fab41 to
4e9d06b
Compare
|
Force-pushed changing |
stickies-v
left a comment
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 think this PR warrants a (very short) release note to describe the behaviour change, and that -dnsseed=1 and -listen=1 can be specified to preserve existing behaviour?
The only use-case lost would be users who wanted to fetch addresses from DNS seeds using Bitcoin Core,
Users can still manually set -dnsseed=1 to preserve existing behaviour I think?
Yes, they can. I just force-pushed adding a release note to specify this behavior when using |
|
are there situations where you'd recommend a node operator to use I can't think of cases where I'd recommend an operator to set an alternative to consider would be recommend to users trying to set another option would be to enforce a minimum number of connections to be 8 or 10. this is a stronger stance so I'm not sure how it'd be received, but it would make sense to me to prevent users from configuring insecure settings. just some thoughts to consider, I would probably opt for a user facing recommendation to use |
stratospher
left a comment
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. DNS seeding not happening when maxconnections=0 makes sense.
- Tested
maxconnections=0meant dns seeding didn't happen. Overriding it withdnsseed=1preserved the existing behaviour and people might possibly want it for the lost usecase mentioned in #26899(comment)? - Overriding with
listen=1doesn't really make sense though whenmaxconnections=0and i did find it confusing to see both options together in the help text.
are there situations where you'd recommend a node operator to use -maxconnections=0 over -connect=0 or -noconnect? I find the current behavior with -maxconnections=0 to be odd how the node just stalls with very little guidance for the user.
maxconnections=0 must have been widely used in earlier clients since -connect=0 didn't disable automatic outbound connections. so those node operators would still use maxconnections=0. also possible we'd indirectly hit the variable storing maxconnections=0 if there's system space limitation too (not something a user would input though).
i assume most people use -noconnect nowadays to achieve the same functionality. (don't really know though)
I would probably opt for a user facing recommendation to use -noconnect instead. this offers a balance between minimizing codebase complexity and taking a conservative approach of what functionality we disable.
I like this!
ghost
left a comment
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.
utACK 4e9d06b
vasild
left a comment
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 928ff360ebc4b76db65b8ad5bc688f4404b32dec
This change, by itself is an improvement and I am ok to get it merged and move on.
However, can we do better? This PR does not change the behavior of -maxconnections=0 -listen=1, but lets change that too! :) It does not make sense and probably means that the user does not know what they are doing.
What about either giving an error on -maxconnections=0 -listen=1 or disallowing low values for maxconnections?
My request is kind of feature creep or scope creep for this PR. Again, I am ok to merge it as it is.
|
Concept ACK |
…ue of -listen 5c938e7 Use string interpolation for default value of -listen (ekzyis) Pull request description: This is a refactoring change. So I have read the following and will try to answer why this change should be accepted > * Refactoring changes are only accepted if they are required for a feature or bug fix or **_otherwise improve developer experience significantly_**. For example, most "code style" refactoring changes require a thorough explanation why they are useful, what downsides they have and why they *significantly* improve developer experience or avoid serious programming bugs. Note that code style is often a subjective matter. Unless they are explicitly mentioned to be preferred in the [developer notes](/doc/developer-notes.md), stylistic code changes are usually rejected. I have noticed in bitcoin/bitcoin#26899 (comment) that the helper message for `-listen` does not use string interpolation. That confused me and I wasn't sure what the reasons for that are. So it could be argued this confusion (by possibly many people in the past and in the future) may already be enough to accept this change. However, not accepting this means that if `DEFAULT_LISTEN` is ever changed, this helper message will still use the old value (however unlikely that may be). Therefore, this PR makes the helper message consistent with how other helper messages are implemented (using string interpolation) which leads to less confusion and prevents possibly wrong documentation in the future. ACKs for top commit: stratospher: ACK 5c938e7. vasild: ACK 5c938e7 kristapsk: cr utACK 5c938e7 Tree-SHA512: 8905f548ff399967966e67b29962821c28fd2620ff788c2b2bdfd088bbca75457dc63e933ad1985f93580508a65b91930fe4b2d97a2e0a7d83a3748b9ea2c26f
…isten 5c938e7 Use string interpolation for default value of -listen (ekzyis) Pull request description: This is a refactoring change. So I have read the following and will try to answer why this change should be accepted > * Refactoring changes are only accepted if they are required for a feature or bug fix or **_otherwise improve developer experience significantly_**. For example, most "code style" refactoring changes require a thorough explanation why they are useful, what downsides they have and why they *significantly* improve developer experience or avoid serious programming bugs. Note that code style is often a subjective matter. Unless they are explicitly mentioned to be preferred in the [developer notes](/doc/developer-notes.md), stylistic code changes are usually rejected. I have noticed in bitcoin#26899 (comment) that the helper message for `-listen` does not use string interpolation. That confused me and I wasn't sure what the reasons for that are. So it could be argued this confusion (by possibly many people in the past and in the future) may already be enough to accept this change. However, not accepting this means that if `DEFAULT_LISTEN` is ever changed, this helper message will still use the old value (however unlikely that may be). Therefore, this PR makes the helper message consistent with how other helper messages are implemented (using string interpolation) which leads to less confusion and prevents possibly wrong documentation in the future. ACKs for top commit: stratospher: ACK 5c938e7. vasild: ACK 5c938e7 kristapsk: cr utACK 5c938e7 Tree-SHA512: 8905f548ff399967966e67b29962821c28fd2620ff788c2b2bdfd088bbca75457dc63e933ad1985f93580508a65b91930fe4b2d97a2e0a7d83a3748b9ea2c26f
If `maxconnections=0`, it means our possible connections are going to be manual (e.g via `addnode`). For this reason, we can skip DNS seeds and set `listen` false.
928ff36 to
fabb95e
Compare
|
Rebased |
ghost
left a comment
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.
reACK fabb95e
|
ACK fabb95e |
1 similar comment
|
ACK fabb95e |
If
maxconnections=0, it means our possible connections are going to be manual (e.g viaaddnode). For this reason, we can skip DNS seeds and setlistenfalse.