HomePhabricator

[backport#19260] p2p: disconnect peers that send filterclear + update existing…

Description

[backport#19260] p2p: disconnect peers that send filterclear + update 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 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

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Jun 16 2020, 07:50
majcostaCommitted on May 13 2021, 12:32
majcostaPushed on May 13 2021, 12:32
Reviewer
Restricted Project
Differential Revision
D9512: [backport#19260] p2p: disconnect peers that send filterclear + update existing filter msg disconnect logic
Parents
rABCb97f1a9415a0: [backport#19264] [tests] Don't import asyncio to test magic bytes
Branches
Unknown
Tags
Unknown