mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 15:08:38 +00:00
p2p: skip parent lookups for orphan announcements that cannot add a candidate #36884
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!36884
Loading…
Reference in a new issue
No description provided.
Delete branch "orphan-announcer-early-exit"
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?
For a wtxid announcement of a transaction that is in the orphanage,
AddTxAnnouncementcomputes the missing parents of the orphan (GetUniqueParents, thenAlreadyHaveTxper parent) and then callsMaybeAddOrphanResolutionCandidate. That function returns without using the parents if the peer is already an announcer of the orphan. If the peer has no relay permission andm_txrequest.Count(peer) + unique_parents.size() > MAX_PEER_TX_ANNOUNCEMENTS, it returns after using only their count. In both cases the peer is not added as a candidate, and the same lookups run again for everyinvmessage that lists the wtxid. #35878 deduplicates within one message only.This PR does both checks before the parent lookups. The second check uses
vin.size()in place of the number of missing parents.Behavior change:
vin.size()is an upper bound for the number of missing parents. A peer without relay permission is no longer added as a candidate whenCount(peer) + vin.size()exceedsMAX_PEER_TX_ANNOUNCEMENTSbutCount(peer)plus the number of missing parents does not. That needs inputs that share a parent, or parents that are already known.Measurement: regtest, one node, RelWithDebInfo, base
a527a0077a. The orphanage holds 12 orphans with 2430 inputs each. One peer, which delivered one of the 12 orphans and has sent at least 3600 announcements of unknown wtxids before, sends 300invmessages that each list the 12 wtxids. Time perinvmessage:Tests: no new test. Passing locally: unit suites
txdownload_testsandorphanage_tests; functionalp2p_orphan_handling.py,p2p_tx_download.py,p2p_opportunistic_1p1c.py,p2p_1p1c_network.py,p2p_invalid_tx.py,p2p_permissions.py,p2p_leak_tx.py,mempool_packages.py. Not run: the rest of both suites, fuzz targets, lint.Contributed by turingpoint.
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
No conflicts as of last run.
🔵 Suggestion · Input-count bound excludes otherwise eligible fallback peers
The disclosed stricter policy turns away some late orphan announcers that the exact budget check accepts, while first-receipt candidates still use the distinct-missing-parent count.
Location:
src/node/txdownloadman_impl.cpp:186(head).🔵 Suggestion · Late-announcer budget boundary and relay exemption lack coverage
Existing tests do not distinguish the new conservative admission rule from the exact helper, or check relay permission at the late-announcer budget boundary.
Location:
src/node/txdownloadman_impl.cpp:186(head).Review coverage was incomplete.
Reviewed:
b2f33e529879· Review report · Previous reportspermalink