-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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
net: Remove g_relay_txes #20217
net: Remove g_relay_txes #20217
Conversation
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.
Left some style questions. Feel free to ignore, obviously.
Concept ACK on the change.
45e81e1
to
a5c8535
Compare
Thanks for the review @MarcoFalke. I've taken your suggested name change. |
Concept ACK: globals going down is good! |
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. |
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.
.
Rebased |
a5c8535
to
179616f
Compare
utACK 179616f |
code review ACK. I was confused about the relationship between g_relay_txes (now m_ignore_incoming_txs) and m_tx_relay. I think it's if m_tx_relay is null, this is a blocks-only peer, and if m_ignore_incoming_txs is true, I am a blocks-only peer. Is that right? I think unifying everything under names with "blocks-only" would be clearer but is out of scope for this change. |
Yes, this has been confusing for people, which is why I think it's important to be precise with terminology:
I think that's probably less clear since it would confuse those two concepts. |
Hmm, these still seem like the same concept to me but I'm probably missing something; let me ask the question in a different way: What is the difference between me being a |
Some differences:
There may be others. |
Thank you, that's very helpful! Just to wrap up, it sounds like in my thought experiment (a hypothetical node with all block-relay-only connections vs. a node with This makes sense because in We wouldn't want to persist all connections across a restart (#17326 (comment)), but because block-relay-only connections are more privacy-preserving and they are extra connections (we can rely on the other connections cycling) it's fine for them to be persisted. And persisting them sort of helps with eclipse attacks (#17326). I think I'm confused because the check for block-relay-only connections in the code is sometimes to see if m_tx_relay exists, which is non-intuitive because block-relay-only also implies that addrs are not gossiped with this peer either, not just transactions, and sometimes to call I think the new name for !g_relay_txes, m_ignore_incoming_txs, is much clearer. |
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index a69efa4fc0..3ea2c1a1f9 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1657,7 +1657,7 @@ void static ProcessGetData(CNode& pfrom, Peer& peer, const CChainParams& chainpa
const CInv &inv = *it++;
- if (pfrom.m_tx_relay == nullptr) {
+ if (peer.IsBlockOnlyConn()) {
// Ignore GETDATA requests for transactions from blocks-only peers.
continue;
} That's out of scope for this PR.
Great. @MarcoFalke gets credit for that! |
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.
review ACK 179616f nice cleanup! 🚔
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
review ACK 179616f8211883739df6e06852bd976dcdd0c3c9 nice cleanup! 🚔
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhgiwv8DdUGvchEGZlcyNFDb/+qNnq3WawkfpGWNb6Ncw1UhyOpoKtyLHCU8YtX
8KFBToEOqMSQw9vljAJx9oRYEd/ugMBJgCxpdlLMuFeOpw9q7DIxGCUxJdtte3sU
HQUPMduUvIb3PD6AXZC0uiTJk7S2DtZ7GhdPiVC1MK9prUZv/t17EA4o2daYFYZQ
2kz5vsvRXk2I5oh56sk0IlXr2Wid0+m6XDLj1Nf1CKZntg1DrR7+FeF9KN+pDuu5
FV6hUE7Enqnv67MY8L2qDegLAxdHGhCoS6wWwZIciahEtXbUHPLexERdE7Mm38pp
nHyidWXW1BVpYPIu8EssHboMreNxiX2BN4kyA2YPlKwmsmQjprBil+SnYaIVAWD4
8B5hxjH+f+DIxDliIphn3ABiLvJmXXh7GVG1XKKGdoBv5Po+YXh0UezPli6Fon49
gqWmaqYeRfD1gxFAdMaM0Bl1bbFUuDKarN1knvU99h87t7u4op6PcxDl52r2mb93
ePmRESnn
=hNL8
-----END PGP SIGNATURE-----
python: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
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 ceedf23 only change is rebase 🏑
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
re-ACK ceedf230fd only change is rebase 🏑
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgCvAv+K3VviMunaCVXNAeZ/hZH34QUHITi3yW5mVjRux8HD/eTowDKtm+kMo/p
t2+ADIT+xufMOh4xBjJ/tk18daxL7IHceABiNuAP/uDUVOn+QeCYbfueVj0UBepS
G1mBS750Cy/frouSFD2Gn35H/8fNBtSTyAggKAveJ27cSK9h/nk2pp7xiyo+pG27
8+KoEt//u44zMRlLKFiEkMG6O60/RtxIndpLuU0t+T3qUv8CFyJYaWVjMng8ZA5B
2CvEI/7reaSWzyvfLakbkPdUtX6YqMixGSphq2U0AjcKShOSGF6wRnpo3bspsHXy
aBo8OOp/E3X74Ui8DaAEnXP7VQj6wYLZsCKAsv/f0Dn3AohEawRPkiNG/4pgArbH
iN746lD/VpJIABh3LdgY2FsyQ+lvf0mwol7WpNzMzIpy3qzvs8mixN+2HAuDWo02
/XNDqfOP2sb22+leSeiujZTm0YmkLdBfJbjSpVeLWBmEbHZ8aUY4GTewFe0CvULf
GcvKddFt
=+MY6
-----END PGP SIGNATURE-----
Timestamp of file with hash c72658247447f9b3ea4dd216ccb2048076b4de79b559adad9feea0a1f8001eea -
ceedf23
to
4fdca52
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.
Would be nice if the previous feedback about MakeUnique was addressed, but looks fine already.
re-ACK 4fdca52 🎞
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
re-ACK 4fdca52007 🎞
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjHMAv/ZPMhJbZefHl6UIHBCAxBD64CT2DiBLoPw/GmGmgxq1vBr8LIPR1RYfvB
tr8VcMtrqa+WaMszsEE3f+WAC86C49rbGn4r1MIEkFMiBZWn4N1nno5thhtCv9h8
mfnFpJUqlgeFv+5ZXh63Y0mA1PbA4B7KQ1V1hc9WXK+tTzTN06B7wKJGf9/PJWUl
sCWYpN5KBr4KGjlw6eJB9C141aIyUOgXzzep7waYeQqA4kUaJ6h7xk2g/1pLRA2f
v5Ds/DrHY5wHfdLEv82Jdpmi+GC2DZ+buiuo+CpHMli3VdclrOtPLEVkAwPJTSMu
UMOLzgZ9cOm0B9yCm2DtgRh1bVLJfAN3lzKpv2NObVZgW1sUQYHg1AFBJDMtj7dA
0zssUKJWLkbwKrND5LAocCHWlu0hBoYeM2wycWNRNvTUJlO8b9tzwrh2jpFlmVBK
AjM40R1MbjIl3SirWjbB7a4DD0ubl9KPCYCm6eGEZryT5VuIvOAfDz7IeC6iKjrq
uQVHH7b8
=1TZV
-----END PGP SIGNATURE-----
Timestamp of file with hash 7771d7eb2920b1e3060dc2d3e986607c8393b9886bc4213c99ec34be0994af1c -
@MarcoFalke addressed your review comments. Sorry for dropping them earlier. |
4fdca52
to
a21667a
Compare
re-ACK a21667a 🖱 Show signature and timestampSignature:
Timestamp of file with hash |
a21667a
to
22d960b
Compare
rebased |
At different times, this PR has had ACKs from @sipa @narula and @MarcoFalke. There have only been minor changes and rebases since those ACKs. Some reACKs at the same commit hash would be very appreciated! |
re-ACK 22d960b 🥃 Show signature and timestampSignature:
Timestamp of file with hash |
needs rebase 🗡️ |
Also remove vestigial commend in init.cpp
22d960b
to
34e33ab
Compare
rebased |
utACK 34e33ab |
re-ACK 34e33ab 💐 Show signature and timestampSignature:
Timestamp of file with hash |
Summary: ``` g_relay_txes is only required inside net_processing and is set only once at startup. Instead of having a global, move it to be a const member of PeerManager. This requires moving PushNodeVersion() into PeerManager, which also allows us to remove the connman argument. ``` Backport of [[bitcoin/bitcoin#20217 | core#20217]]. Ref T1696. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Maniphest Tasks: T1696 Differential Revision: https://reviews.bitcoinabc.org/D10884
g_relay_txes
is only required inside net_processing and is set only once at startup. Instead of having a global, move it to be a const member of PeerManager.This requires moving
PushNodeVersion()
intoPeerManager
, which also allows us to remove theconnman
argument.