-
Notifications
You must be signed in to change notification settings - Fork 37.7k
net processing: Move remaining globals into PeerManagerImpl #24543
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
406704a
to
4e57b8a
Compare
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. |
4e57b8a
to
7cba3e8
Compare
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.
Concept and approach ACK. A few minor suggestions inline.
7cba3e8
to
8c08e33
Compare
Thanks @jnewbery for the review! I took all your suggestions. |
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 8c08e33.
A couple of small suggestions inline.
8c08e33
to
822152c
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.
Code review ACK 822152c
822152c
to
41b08b1
Compare
Code review ACK 41b08b1 Thank you for such quick responses to my review comments! |
41b08b1
to
45f3b1d
Compare
Rebased |
ACK 45f3b1d Verified rebase by doing it myself and comparing. |
45f3b1d
to
79f6a55
Compare
Rebased |
Code review ACK 79f6a55 I noticed the following line in
It's perhaps out of scope for this PR, but perhaps that should be made a member variable of |
We inline `UpdatePreferredDownload` because it is only used in one location during the version handshake. We simplify it by removing the initial subtraction of `state->fPreferredDownload` from `nPreferredDownload`. This is ok since the version handshake is only called once per peer and `state->fPreferredDownload` will always be false before the newly inlined code is called, making the subtraction a noop.
79f6a55
to
8fa7fa0
Compare
Rebased and added a commit (da9e51a) to move |
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 8fa7fa0
-BEGIN VERIFY SCRIPT- ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); } ren mapNodeState m_node_states ren cs_most_recent_block m_most_recent_block_mutex ren most_recent_block m_most_recent_block ren most_recent_compact_block m_most_recent_compact_block ren most_recent_block_hash m_most_recent_block_hash ren fWitnessesPresentInMostRecentCompactBlock m_most_recent_compact_block_has_witnesses ren nPreferredDownload m_num_preferred_download_peers ren nHighestFastAnnounce m_highest_fast_announce -END VERIFY SCRIPT-
8fa7fa0
to
778343a
Compare
Code review ACK 778343a |
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 778343a 🗒
Show signature
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
ACK 778343a379026ef233dffea67f5226565f6d5720 🗒
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjBIwv+MjgYz0poUymP0rv825e0CNNMrgOXg5hJmGXAF7dDpzn6Kqje2icEX1Iy
vNbpPsRDachm/67cOdTJinNgw8TStVI+KxURKCSCl1A30Xz01groLbTyXjVn2gwy
Bk9HoIRpa0CLbvGenk2OW6jjxYFgbK81TKDTHqHEM6laayMlKHFaloO/AlB+SfYL
TRNCBjxGnzoBzPfG3d5JMI5Rt15lBSvKRm6dCe5pnUdDLJyfJLVT5CIb606Tkxoz
0ASF4H0nvsdPCR5t3T+spy8fFDgmsUwtUNbpOAKKkm3Vmr1EGxHxyGCW3Uyq3eLQ
YKefQrFjp21dcxeCeCcsZp30Ropssp1Dc1bOBgPIworvUzTlb8H/WU1aDr16Eis+
/GITCLQ75eifYYaPPEPnJxLwW8QLE4k38zhmYKtR8EafRpB8Zh1NAt+TSWB8iSOl
yjRfMQGD7TeIDVnXzOz+fEwzI7JVsexqhu1BD14Xfx3pUsXfclbnFWHH2/0XaTwp
59A5jsEa
=56fQ
-----END PGP SIGNATURE-----
This PR moves the remaining net processing globals into
PeerManagerImpl
. This will make testing the peer manager in isolation easier and also acts as a code clean up.