-
Notifications
You must be signed in to change notification settings - Fork 38.2k
net_processing: reorder the code that handles the VERSION message #33792
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
base: master
Are you sure you want to change the base?
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33792. 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. |
|
This is just moving code around. Easier reviewed with [diff]
colorMoved = dimmed-zebra
colorMovedWS = allow-indentation-change |
|
cc @ajtowns |
w0xlt
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.
The reordering of WTXIDRELAY and SENDADDRV2 looks safe to me and keeps them before the tx‑reconciliation announcement.
What’s the rationale for moving m_addrman.Good(pfrom.addr) earlier ?
|
Good question, I guess it is a bit obscure. Let me elaborate. So, when we receive the For private broadcast we don't want to push any extra messages. To do that I took the approach to reorder the code like: another option would be to add "is private broadcast" check on every of the or something else? I guess this can be achieved in more than one way. No strong opinion, the aim is to avoid calling some of the code. Btw, |
Hmm, wait! |
Change the order in which code snippets are executed as a result of receiving the `VERSION` message. Move the snippets that do `MakeAndPushMessage()` near the end. This makes it easier to interrupt the execution when no messages should be sent as a response to the `VERSION` messages, in private broadcast connections. This is a non-functional change.
431dd57 to
52149b0
Compare
|
|
w0xlt
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.
Thank you for the detailed explanation.
ACK 52149b0
andrewtoth
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 52149b0
Moving the WTXIDRELAY and SENDADDRV2 MakeAndPushMessages doesn't change the order of messages pushed. Nothing between below where they are moved from and above where they are moved to has an effect on any of the members of pfrom accessed in MakeAndPushMessage.
Moving mapped_as and the subsequent log above does not change anything with mapped_as either, since the pfrom.addr is not modified in any of the lines between where it is moved. None of the log parameters miss any changes being moved up either.
mzumsande
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.
Code Review ACK 52149b0
Change the order in which code snippets are executed as a result of receiving the
VERSIONmessage. Move the snippets that doMakeAndPushMessage()near the end. This makes it easier to interrupt the execution when no messages should be sent as a response to theVERSIONmessages, in private broadcast connections.This is a non-functional change.
This is part of #29415 Broadcast own transactions only via short-lived Tor or I2P connections. Putting it in its own PR to reduce the size of #29415 and because it does not depend on the other commits from there.