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
refactor: Remove nMyStartingHeight from CNode/Connman #20649
Conversation
Concept ACK. I have a branch that does almost exactly the same as this. I don't think we even need to store |
I was thinking that it would be nice (in the future) if most message handling could be done without |
This would definitely be nice! At the moment, both places we send a I have a preference for not caching the block height in PeerManager since I think it makes isolating and testing behaviour more difficult, but either way, this is clearly a big improvement over the current code. |
🕵️ @sipa has been requested to review this pull request as specified in the REVIEWERS file. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
Code review ACK fa7afc0 |
fa7afc0
to
faf54d4
Compare
rebased |
code review ACK faf54d4 |
faf54d4
to
fa8a96a
Compare
Concept ACK |
Code review ACK fa8a96a |
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.
Nice cleanup!
Code review ACK fa8a96a ☃️
fa8a96a
to
faaa4f2
Compare
Rebased due to trivial conflict in adjacent line |
utACK faaa4f2 |
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 faaa4f2 ⚓
Checked that the changes since my previous cr ACK were only rebase-related via $ git range-diff fa8a96a9146...faaa4f2b6af
, also compiled and ran the tests.
Summary: ``` CNode and CConnman keep track of the active chain height when CNodes have been created, but apart from serializing the int once (when sending a version message), it is unused. So it can simply be removed in favor of a single int in PeerMan that can do the same. ``` Backport of [[bitcoin/bitcoin#20649 | core#20649]]. Depends on D10884. Ref T1696. Test Plan: ninja all check-all ninja bitcoin-fuzzers Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Subscribers: PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10885
CNode and CConnman keep track of the active chain height when CNodes have been created, but apart from serializing the int once (when sending a version message), it is unused. So it can simply be removed in favor of a single int in PeerMan that can do the same.