mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-07-13 07:29:34 +02:00
55e3a57f22qa: Avoid UTXO reuse between test functions (Hodlinator)9c5dd2926ap2p: Ignore CMPCTBLOCK from peer that hasn't sent SENDCMPCT (David Gumberg)bf9884f4e5p2p: make blocksonly nodes ignore CMPCTBLOCK messages (David Gumberg)92cea63c71test: (Un)solicited invalid cb -> get disconnected. (David Gumberg)e845e26344test: p2p: Nodes ignore unsolicited CMPCTBLOCK's (David Gumberg)8313591715p2p: Drop unsolicited CMPCTBLOCK from non-HB peer (David Gumberg)44f377a71frefactor: test: Static assert_highbandwidth_states (David Gumberg)25457a3272test: Tighten getblocktxn checks in parallel cb reconstruction test. (David Gumberg)51dd90fb50refactor: Merge announce_cmpct_block() defs into one (Hodlinator) Pull request description: Processing unsolicited `CMPCTBLOCK`'s from a peer that has not been marked high bandwidth is not well-specified behavior in BIP-0152, in fact the BIP seems to imply that it is not permitted: > "[...] method is not useful for compact blocks because `cmpctblock` blocks can be sent unsolicitedly in high-bandwidth mode" See https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki#separate-version-for-segregated-witness This PR disables processing of CMPCTBLOCK messages in three cases: $1$. When the block is unsolicited and from a non-HB peer. $2$. When this node is running in `-blocksonly` mode. $3$. When the peer has not advertised `CMPCTBLOCK` support with a `SENDCMPCT` message. Not processing unsolicited blocks slightly raises the cost of discovering a peer's mempool via `CMPCTBLOCK` as described in #28272. As pointed out there, getting an HB slot is relatively easy, so this does not prevent an attacker from doing this, it just slightly raises the bar. Probably more important is not processing `CMPCTBLOCK` messages as a `-blocksonly` node. A blocksonly node has a lot less surface area for leaking its mempool since it does no transaction relay, and leaking a blocksonly node's mempool is pretty dangerous since it is very likely to be the origin for all of the transactions in its mempool. ACKs for top commit: achow101: ACK55e3a57f22w0xlt: reACK55e3a57f22hodlinator: re-ACK55e3a57f22polespinasa: lgtm ACK55e3a57f22Tree-SHA512: 118bea55adca01dbd6467ba5ae3adf420d960794a6a2c40dd30fcc7d79aa944e01af0f6dd6bd6ff6d33dc9155171f6f4f497cbd7e8eb6d3c4c89e12740b51c05