bitcoin: compact block fingerprinting
I haven’t written a test for this, but it seems that a peer can fingerprint a chunk of our mempool by announcing a new compact block with a valid header, but inserting many shorttxids that don’t belong to the block but are suspected to be in our mempool. Assuming no short id collisions, we’ll then request each tx that we didn’t find in either vExtraTxnForCompact or the mempool.
I’m not sure how to fix this since compact block relay relies on this behavior. One possible way of fixing this was brought up here https://github.com/bitcoin/bitcoin/pull/27086#issuecomment-1426937832.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 1
- Comments: 20 (20 by maintainers)
Commits related to this issue
- p2p: Drop unsolicited CMPCTBLOCK from non-HB peer 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 s... — committed to davidgumberg/bitcoin by davidgumberg a year ago
- p2p: Drop unsolicited CMPCTBLOCK from non-HB peer 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 s... — committed to davidgumberg/bitcoin by davidgumberg a year ago
It’s ostensibly forwarded once PoW/merkle checks pass, but not promising utxo/script/etc checks.
After #27675 (but also before, with a few more restrictions), we relay any tx from our mempool (except for those that arrived after the last INV sent to the peer), so someone wanting to fingerprint our mempool could just ask for those transactions directly instead I think and then check whether we send it to them or answer with
NOTFOUND.So I wonder why would someone trouble themselves with doing compact blocks for this, which would involve either creating a new valid block header (expensive) or trying to be the first to announce a compact block found by someone else to the victim (which has timing issues), if they could just ask for this info directly? (this doesn’t apply to block-relay-only peers though).