Skip to content

Conversation

@jonatack
Copy link
Member

@jonatack jonatack commented Apr 14, 2023

In #27374 the role of the setConnected data structure in CConnman::ThreadOpenConnections changed from the set of outbound peer netgroups to those of outbound IPv4/6 peers only.

In accordance with the changed semantics, this pull fixes a code comment regarding feeler connections and updates the naming of setConnected to outbound_ipv46_peer_netgroups.

Addresses #27374 (comment).

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 14, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK vasild, mzumsande, ryanofsky
Concept ACK Ayush170-Future

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27509 (Relay own transactions only via short-lived Tor or I2P connections by vasild)

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.

@DrahtBot DrahtBot added the P2P label Apr 14, 2023
@jonatack jonatack force-pushed the 2023-04-outbound-peer-netgroup-diversity-followups branch from 6a70b69 to 51bc090 Compare April 14, 2023 19:26
Copy link
Contributor

@Ayush170-Future Ayush170-Future left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK on the concept.

The code also looks good to me.

Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 51bc09089b18afaa3ba5a1bea638c158df20bdfa

…ollow-up

In PR 27374, the semantics of the `setConnected` data structure in
CConnman::ThreadOpenConnections changed from the set of outbound peer
netgroups to those of outbound IPv4/6 peers only.

This commit updates a code comment in this regard about feeler connections and
updates the naming of `setConnected` to `outbound_ipv46_peer_netgroups` to
reflect its new role.
@jonatack jonatack force-pushed the 2023-04-outbound-peer-netgroup-diversity-followups branch from 51bc090 to 11bb31c Compare April 17, 2023 13:28
Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 11bb31c

@achow101
Copy link
Member

achow101 commented Apr 25, 2023

While renaming this variable is technically correct, I don't think it's useful to have these kind of PRs. Although it is small and trivial, it does take away time from review of the hundreds of other PRs we have, has an effect on git blaming, and possibly conflicts with other PRs in this area that do introduce meaningful changes.

@jonatack
Copy link
Member Author

@achow101 The code comment needs to be fixed as it is now incorrect, and the naming is now misleading. I think the change is clearly justified here.

@vasild
Copy link
Contributor

vasild commented May 12, 2023

I don't think it's useful to have these kind of PRs

Ok, this is your opinion. Sometimes I feel the same for some PRs. My reaction is then to ignore them - don't spend my time on them if I think it is not worth it. But I don't try to impose my opinion on others - if somebody was thinking it is worth to open a PR and somebody else was thinking it is worth to review, then let it be. Those other people have different opinion than mine and I am not going to tell them what to work on or what not to work on.

This is the true beauty of decentralized development. The opposite is centralized management - where somebody decides what is important and imposes it on others.

@ryanofsky
Copy link
Contributor

I don't think it's useful to have these kind of PRs

Ok, this is your opinion. Sometimes I feel the same for some PRs. My reaction is then to ignore them - don't spend my time on them if I think it is not worth it. But I don't try to impose my opinion on others

I agree with you that at a project / maintenance level we should be neutral about "I don't think this PR is a good use of effort but I can't point out any actual problems with it" review feedback. If a PR has sufficient review and no substantive technical objections, it should be merged regardless of these comments.

But I think these comments are really valuable for helping people decide what to spend time on, and I personally want to encourage more not less "I don't think this PR is useful" comments. Sometimes a PR is more useful than it initially appears, and more discussion could help clarify that. Other times, maybe the PR is not really very useful, and having the feedback could help the contributor decide not to put more work into the PR, and avoid having them wonder for months if the PR isn't getting review because it isn't interesting, or is too hard to understand, or just wasn't noticed.

@ryanofsky
Copy link
Contributor

The code comment needs to be fixed as it is now incorrect, and the naming is now misleading. I think the change is clearly justified here.

Could you say more about how the current code is misleading in the PR description? I'm sure the new code is better, but knowing what is incorrect or misleading in the current code could help motivate the PR a little more

@jonatack
Copy link
Member Author

Per the first line of the diff and the first line of the PR description, a well-named data structure is preferable to one with an out-of-date name that needs a comment to explain what it now does after its role changed. Our p2p code is sufficiently critical for this to be important, and for that reason we often see review comments requesting clearer naming in p2p changes.

I think the canned response in #27467 (comment), and its use, is problematic. Many commits are merged that change naming for style reasons only, or even do nothing but change indentation, clean up code, change or drop a word, etc. Here, we have a data structure that changed its role, which seems as good a reason as can be to update the naming in order to make sense and not be a footgun for developers or source of confusion. Coming down on renaming when the semantics changed out from under a data structure, but being fine with PRs containing several renaming commits for style reasons only, is a little baroque. ACKing and merging changes that would fall under that canned response, while punching down on as-valid-or-more other ones inevitably looks arbitrary, hypocritical or favoritist. A rule or canned response, like the developer notes, ought to be applied consistently or not at all. This particular one is too wide in interpretation and subjective in practice, so when it’s not misapplied, it is at best arbitrary and unhelpful, and at worst is disruptive or negative social signaling that shouldn't be done. For these reasons, my suggestion would be to bin that canned response and not use it at all.

Let's please encourage review, including post-merge review and occasional fixups that may come from that. If there's one thing that is perennially desired on this project, it's more eyes on the code and helpful, positive, complementary reviewers to move things forward. As long as a reviewer is well-intentioned and trying to help Bitcoin, let's encourage them with kindness, indulgence and wisdom. Thanks!

@vasild
Copy link
Contributor

vasild commented May 15, 2023

One more thing to consider - this PR is a followup to another one (not an out of the blue, standalone one). We use the will-do-in-a-followup practice to avoid invalidating ACKs on the original PR with non-critical changes. If such followup PRs start getting frowned upon or ignored, then that could create a backward pressure to insist to include the small/non-critical suggestions in the original PR because the followup PR will not make it.

@stratospher, @mzumsande, maybe you want to review this followup since you authored/reviewed #27374? (or feel free to ignore)

@mzumsande
Copy link
Contributor

Code Review ACK 11bb31c

This fixes an outdated doc, so it's an improvement.

The naming is now misleading.

I don't think the previous naming was too bad: #27343 added an explanatory comment after all. If anything, it was much more misleading before #27343 when there was no comment, because the name setConnected doesn't imply "netgroups of outbound peers from all networks" any more than it implies "netgroups of ipv4/ipv6 outbound peers" - after all we are "connected" to inbound peers too.

But I'm not against renaming.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 11bb31c

This change seems like an improvement to me, but I also think the early comment calling it "small and trivial" was appropriate and useful for clarifying the purpose of the change. Reviewers need to be able to express their honest opinions so limited review bandwidth goes to the right places, and so PR authors have a chance to improve and justify their PRs and not sit around wondering why a PR isn't being reviewed

@ryanofsky ryanofsky merged commit 456af7a into bitcoin:master Jun 9, 2023
@jonatack jonatack deleted the 2023-04-outbound-peer-netgroup-diversity-followups branch June 10, 2023 02:01
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 12, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants