mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 16:26:37 +00:00
net: Skip cs_main when a peer has no orphan work #36445
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!36445
Loading…
Reference in a new issue
No description provided.
Delete branch "net/orphan-check-without-cs-main"
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?
ProcessMessagestakescs_mainfor every peer on every handler pass, just to check for orphan transactions to reconsider, though most peers have none. This PR checks for orphan work underm_tx_download_mutexfirst and skipscs_mainwhen there is none. Peers with orphan work take the same path as before, plus one uncontended lock.This removes needless
cs_maincontention with validation, RPC and wallet threads. It's part of a broader effort to reducecs_maincontention in net processing (see #36244 for context), but stands on its own.ProcessMessageshandling apingcs_mainfor 50 msRelease builds, median of 3 runs.
SendMessagesin the same handler pass still takescs_main.Tested by
process_messages_without_orphan_work, which fails without this change.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.
Base:
cf80493e2367786ce9946c522eb8313a52c90557Head:
6549bb4bd6ae27c339c7a277bab9d48ed2fb730cNo verified findings are available from this partial review.
Review coverage was incomplete. The archaeology review had incomplete evidence. The adversarial_glm review had incomplete evidence.
Full review report
I think these kind of refactors only make sense if/when https://github.com/bitcoin/bitcoin/pull/36244 is an accepted goal by the project
I have not actually looked, just noting for this PR's sake.
This PR stands on its own, though: skipping
cs_mainwhen a peer has no orphan work helps on master today, with or without #36244.#36244 just benefits more from it.
PR description updated for greater clarity.