mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 09:11:37 +00:00
net: enforce timeout interval for paused send peers #36667
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!36667
Loading…
Reference in a new issue
No description provided.
Delete branch "2610_fpausesend_timer"
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?
Today it's possible to keep some peers running ancient versions paused for a long time. If such a peer is so slow to read as to not drain our send buffer down to the 1MB threshold within a reasonable time frame, we really shouldn't be wasting a connection slot on them. I picked 20 minutes as the reasonable time frame, since it's what we already use for ping timeouts today.
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.Base:
2186232955fa70f47c584fb4973e5d849dcfe0f1Head:
cc2534cdf7b14d0f1a18928ebaab7f7fdd7e839eFindings
Suggestions
Test the paused-send timeout and interval reset (src/net.cpp:2088, head)
Could a focused mock-time test cover this disconnect condition? The existing send-stall case in
p2p_ping_ibd.pyresumes reading after detecting a stall; it does not keep a peer above the send-buffer threshold through the new deadline. To isolate this branch from the earlier send and receive inactivity checks, keep those activity timestamps fresh while the buffer remains over the threshold. Assert that the peer stays connected just before the deadline and disconnects just after it, then drain below the threshold and pause again to verify that the queue and send paths start a fresh interval. Without these targeted assertions, regressions in enforcing or resetting the deadline could go unnoticed.Review coverage was incomplete.
Review limitations
Full review report
set from false to true?
Ah yes i see how that is imprecise.
ACK modulo nit comment thing
215316536dI reproduced.
For later follow-ups, I noticed we have no test coverage for the other pauses we have. Seems important to cover.
utACK
215316536dDone, thanks.
Re-ACK
cc2534cdf7ACK https://github.com/bitcoin/bitcoin/pull/36667/commits/cc2534cdf7b14d0f1a18928ebaab7f7fdd7e839e
Reproduced and tested. only change is comment.
tested ACK
cc2534cdf7Reproduced locally, reviewed manually and with frontier AI models for correctness. Looks good to merge as-is, we can address the nits (including Ralph's) in a follow-up.
We already check and set
fPauseSendin bothSocketSendData()andPushMessage()- if you need to touch again, it may result in smaller diff if you extract it.Extract pause-send updates
In a followup we could unify the boolean and the timestamp - that would keep the state in one atomic.
Use one atomic for the pause state
Backported to
32.xin #36658.Backported to
31.xin #36661.Backported to
30.xin #36664.Backported to
29.xin #36666.post-merge crACK
cc2534cdf7Done in https://github.com/bitcoin/bitcoin/pull/36736