-
Notifications
You must be signed in to change notification settings - Fork 38.6k
p2p: disconnect peers that send filterclear + update existing filter msg disconnect logic #19260
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
|
Concept ACK. There shouldn't be a reason for a node to send filterclear when we haven't offered them bloom services to them. See also BIP 111:
nit: I think this is a good opportunity to move the disconnect handling of |
dbc7d30 to
8207e3b
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. |
8207e3b to
18a2e0a
Compare
|
Code review ACK 18a2e0a3f7071b8df6b20ecc1b34b3f2abb13cfc Great tidy-up. Thanks Gloria! |
|
utACK 18a2e0a I was somewhat confused by the last commit, because the description of the PR is about |
maflcko
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 18a2e0a3f7071b8df6b20ecc1b34b3f2abb13cfc nice cleanup 🌫
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
ACK 18a2e0a3f7071b8df6b20ecc1b34b3f2abb13cfc nice cleanup 🌫
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhzKAv/ejpwEnqSww3TRDRR7fvVaVti9v81jtyV0QVIwfjHvYw3MD3BSifUI8KF
KCWYTX/MVDobco2GQR3Iw1Xnc1oGgH8416c5ehDMTiO9T7+DftefLR1hHb8nidXs
bPrsTfbwvh7TkPsEwVWjSu+lVL1CtYDHDcdyP/t2u8p/r/RpCq1WxEwmSQgqybTK
rCIdWUNQ1yrNd5/gkpydpzIZPLpui19aA+lxwndwuWiME0hTc2li/qE9acsFSLSI
PXM/gClEJ6aKDyVX2AOGfpQv1KEY5OReDsUBi2jdXRXI7n3/1D6kz9YGar4DIhVy
nuVcQFEEMGvGEclQVeIp5ik5JHPta0bFm/i6rSdHSk1Y+b5zqgYmSeNqnUwcUxcG
5jyVXszUw0p61yVgy/7CFaFvIr8oa2xjAt8vvLogdePIjH320j2TA3UBhOWLBkfU
bcWafRJwm13cB3VtSB00HNZ7LBb5mS8AmsV0sY4U4a9//RbgBv/HHgrTkjbFmiCQ
gqH6/zVZ
=Wizi
-----END PGP SIGNATURE-----
Timestamp of file with hash 76972080cdb7d6db860684d9cc7ddc281674c2c67368d5f83cad36c0fa0849c0 -
-nodes not serving bloomfilters should disconnect peers that send filterclear, just like filteradd and filterload -nodes that want to enable/disable txrelay should use feefilter
-Increasing the banscore and/or banning is too harsh, just disconnecting is enough. -Return true from ProcessMessage because we already log receipt of filterclear and disconnect.
18a2e0a to
3a10d93
Compare
|
re-ACK 3a10d93 only change is replacing false with true 🚝 Show signature and timestampSignature: Timestamp of file with hash |
|
Code review ACK 3a10d93 |
|
Concept ACK, I just learned a lot about how bloom filters are used in Bitcoin. |
|
tested ACK: quick test_runner on macOS |
|
😂 Thanks @gillichu, I really appreciate the effort 🙏 It's [`commit`](link) |
No need to use markdown for links to the commit hash. Just paste the full hash and github will automatically convert it to a link to commit. |
WHAT I've been using markdown this whole time 😭 |
|
utACK 3a10d93 |
filterclear was also available to request a node sends TXs after IBD had completed, and using blocksonly at connection handshake - this worked better than using feefilter as it was part of the connection handshake, unlike feefilter, which requires a message later. Anyway, not a big issue, but seems like a lot of work to change something that already worked. Also, bloom filters were introduced before feefilter, so older nodes are now being disrespected by not having TXs sent to them when they ask for them. We shouldn't really be breaking backwards compatibility, IMHO, unless we actually want to on purpose - e.g. is there a reason not to send TXs to old nodes? |
… existing filter msg disconnect logic Summary: 3a10d935ac8ebabdfd336569d943f042ff84b13e [p2p/refactor] move disconnect logic and remove misbehaving (gzhao408) ff8c430c6589ea72b9e169455cf6437c8623cc52 [test] test disconnect for filterclear (gzhao408) 1c6b787e0319c44f0e0bede3f4a77ac7c2089db2 [netprocessing] disconnect node that sends filterclear (gzhao408) Pull request description: Nodes that don't have bloomfilters turned on (i.e. no `NODE_BLOOM` service) should disconnect peers that send them `filterclear` P2P messages. Non-bloomfilter nodes already disconnect peers for [`filteradd` and `filterload`](https://github.com/bitcoin/bitcoin/blob/19e919217e6d62e3640525e4149de1a4ae04e74f/src/net_processing.cpp#L2218), but #8709 removed `filterclear` so it could be used to reset tx relay. This isn't needed now because using `feefilter` message is much better for this purpose (See #19204). Also refactors existing disconnect logic for `filteradd` and `filterload` into respective message handlers and removes banning for them. --- Backport of [[bitcoin/bitcoin#19260 | core#19260]] Depends on D9520 Test Plan: ninja all check check-functional Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Differential Revision: https://reviews.bitcoinabc.org/D9512
Nodes that don't have bloomfilters turned on (i.e. no
NODE_BLOOMservice) should disconnect peers that send themfilterclearP2P messages.Non-bloomfilter nodes already disconnect peers for
filteraddandfilterload, but #8709 removedfilterclearso it could be used to reset tx relay. This isn't needed now because usingfeefiltermessage is much better for this purpose (See #19204).Also refactors existing disconnect logic for
filteraddandfilterloadinto respective message handlers and removes banning for them.