mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 12:17:38 +00:00
p2p: Use separate compact block nonce per network #36955
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36955
Loading…
Reference in a new issue
No description provided.
Delete branch "202611_cb_fingerprint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This issue was reported by ajtowns on IRC some time ago.
For compact blocks, when we serve the last compact block from cache, we use a single nonce for all peers currently.
This means anyone can request the most recent tip as a compact block via
getdata(MSG_CMPCT_BLOCK)over a clearnet and a tor connection and then compare the nonces - if they match it's the same node.Fix this by using a different nonce per network/bind (
CNode::m_network_key).This means a little bit more work in
NewPoWValidBlockwhere we will now createCBlockHeaderAndShortTxIDsobjects for each network on which a peer has made us their hb peer. More instances may be created later when serving non-hb peers viaGETDATA. Note that while on master, theCBlockHeaderAndShortTxIDswas created eagerly, and its serialization lazily, we now create both objects lazily.From a high-level point of view, there are various remaining fingerprinting vectors even with this fix, some hard to fix, but I do think that we should be fixing at least the most obvious ones.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, 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
🔵 Suggestion · Outbound onion connections remain linkable through the cached nonce
Ordinary outbound onion peers sharing a local Tor proxy still receive the same cached tip nonce, preserving pre-existing linkage between those connections even though this PR separates networks.
Location:
src/net_processing.cpp:2234(head).🔵 Suggestion · The new nonce test leaves the
SendMessageslookup uncheckedA wrong network key confined to the changed
SendMessagescompact-block lookup would leave all new nonce assertions passing.Location:
src/net_processing.cpp:6257(head).Review coverage was incomplete.
Reviewed:
ee20048dda7f· Review report · Previous reportspermalink
The Ralph comment reminds me of an old conversation:
https://github.com/bitcoin/bitcoin/pull/33464#pullrequestreview-3813897610
So maybe we should revisit it with this PR, which also affects outbounds?
Concept ACK
Concept ACK
@davidgumberg how would this work together with prefilling?
Good point, I didn't think about #35558 when opening this PR. I don't think they are mutually exclusive (we could have the prefilled blocks cache keyed by network), but prefilling would introduce a different fingerprint vector, albeit weaker than the nonce.
I'm not sure how much prefilled blocks would differ among nodes, but even if it turned out to be significant, there could be various possible strategies to avoid it.
But also, I'm not sure how important or useful it is to prefill blocks on privacy networks in the first place:
As far as I can see, the TCP window reasoning of #35558 may not apply when the queried
CNode::m_sockis not the connection to the peer but the local proxy/damon. Has this been tested?In addition, Tor and I2p are probably not on the critical path for network-wide propagation/selfish mining issues anyway.