mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:44:38 +00:00
WIP: private broadcast: Extra guard against unintended non-private broadcast of private transactions #36607
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!36607
Loading…
Reference in a new issue
No description provided.
Delete branch "2610-privbcast-guard"
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?
Motivation: Reduce the risk of accidental privacy leak happening when broadcasting non-privately a requested transaction that had been previously broadcast privately.
Background: During the initial phase of private broadcast implementation there were unforeseen instances when a private transaction could get broadcast non-privately (see #35032 #35319 #35410 #36309 #36312 #36277 #36330).
Currently known pathways:
submitpackageNote that these are being addressed, but other, currently non-identified pathways cannot be excluded.
Change summary: Add a general, extra safeguard: whenever there is a transaction broadcast request, check if the given transaction has been previously broadcast privately, and if so, refuse to broadcast non-privately.
Transaction relay is not affected, as it should not be affected by private broadcast. When we receive a previously private-broadcast transaction for the first time (it's not yet in our mempool), we relay it as any other relayed transaction. Behavior is unchanged in this regard.
Notes:
abortprivatebroadcastwill be forgotten.Keeping as Draft, because the prerequisite #36477 is pending.
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.
A summary of reviews will appear here.
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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
test/functional/p2p_private_broadcast_then_public.py:privateproadcast-aware→private-broadcast-aware[misspelling]2026-11-02 11:36:49
2 additional verified findings in the full report.
Earlier concerns remain unresolved; see the full report for their current assessments.
🟠 Minor · A local resubmission can stop retries without announcing the transaction
If earlier private sends did not propagate the transaction, a later
submitpackagecan suppress its public announcement and end private retries while still reporting success.Location:
src/net_processing.cpp:2491(head).🟠 Minor · The guard does not suppress announcements of same-txid witness variants
A requested announcement of a valid alternate witness for a privately broadcast transaction is not suppressed, and the shared txid links it to the private transaction; no in-tree producer of such a variant was identified.
Location:
src/private_broadcast.cpp:89(head).🟠 Minor · Calculate remaining attempts from retry eligibility
private_broadcast.cpp:198: a resolved entry that is still IsPending (echoed before all initial sends were picked) takes the else branch and reports m_max_send_attempts - sent, e.g. 999, although only the remaining planned sends can occur.
Location:
src/private_broadcast.cpp:197(head).🔵 Suggestion · Eviction removes the guard for transactions that have not propagated
After a finished entry is evicted, a later wallet resend or
submitpackageannounces the transaction publicly; whether 10,000 entries cover the resend interval depends on unbounded private-broadcast volume.Location:
src/private_broadcast.cpp:41(head).🔵 Suggestion · Peers can still request suppressed transactions from the mempool
The guard stops the INV but leaves the transaction available to
FindTxForGetData, so orphan resolution or a probing peer can still fetch it from this node.Location:
src/net_processing.cpp:2494(head).🔵 Suggestion · The fuzz model does not verify which finished entry is evicted
An implementation that evicts the newest or an arbitrary finished entry would still pass, although the header and release note promise oldest-first eviction.
Location:
src/test/fuzz/private_broadcast.cpp:140(head).Reviewed:
350a7f37832c· Full review report · Previous reportsCI failure:
TSanfails. It may be related to the test pushing the mock time by 36 hours, which may affect some rate limiting. Investigating.Attempted fix for "TSan" CI timeout.
Likely root cause: In the wallet resend part, node0's mocktime jumps 36 hours and then stays frozen. If node0's message handler processes the nodes[2] connection between the jump and the wallet resubmit, it resets that peer's inv trickle timer to the frozen time plus a random delay, so the timer never expires and the inv for the resent transaction is never sent.
Attempted fix: start node0 with
-whitelist=noban,[email protected], which gives its manual connectionsnobanpermission so they skip the trickle timer, aswallet_resendwallettransactions.pydoes vianoban_tx_relay.git range-diff 7b2aae41d79624abc87198932d699ae77ec36323...0cd792580f01796d0ed16d9cf415f7b8a6ac5f20Haven't looked closely, but I wonder if this is the correct fix here.
wallet_resendwallettransactions.pyonly cares about the day-long resend-delay, not the second-long trickle-delay, so it seems correct for that test. However, for the test here, either the test here cares about trickle-delay, in which case it would be cleaner to not usenobanpermission and instead make the test deterministic with syncs or so? Or, the test doesn't care about trickle delay, and can just setnoban_tx_relayglobally? Just wondering, up to you.Thanks for chiming in! Indeed, the global
noban_tx_relayseems to be a cleaner way.I used LLM assistance for finding the failure reason, I've reviewed that it looks plausible, and reproduced locally (both with and without).
This test doesn't care about trickle delay, so disabling it globally is a simpler solution. Changed now.
git range-diff 0cd792580f01796d0ed16d9cf415f7b8a6ac5f20...350a7f37832cba1fc4e453806efd2f4726553968git range-diff 7b2aae41d79624abc87198932d699ae77ec36323...350a7f37832cba1fc4e453806efd2f4726553968🐙 This pull request conflicts with the target branch and needs rebase.
Rebased (due to conflict)
(
git range-diff 350a7f37832cba1fc4e453806efd2f4726553968...d1e83a230e65774e5b5637fe05e51ef2ad6b64bf)