mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:38:37 +00:00
test: fix no-immediate-response check in p2p_orphan_handling.py #37010
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!37010
Loading…
Reference in a new issue
No description provided.
Delete branch "test-p2p-no_immediate_respose-fix"
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?
The no-immediate-response check in p2p_orphan_handling.py currently can't fail and thus doesn't test anything:
assert_no_immediate_responsesavesself.last_messagebefore and aftersend_and_ping, but both names refer to the same dict, whichon_messageupdates in place. Fix it by copying the dict before sending. The second copy isn't strictly needed, since nothing changes the dict after the ping returns, but it's added so both snapshots are taken the same way.This affects both call sites, including the check that the node doesn't serve a not-yet-announced parent to a spy peer.
To check the helper itself, apply the subtest below (e.g. with
git apply). An outbound peer gets an immediategetdatafor an announced tx, which the helper should detect. On master it fails with "No exception raised"; with this PR it passes:Patch
I'm not sure it makes sense to add a test for a test helper, so this isn't part of the PR for now. Happy to add it as a separate commit if reviewers think it's worth it.
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.No findings were published from this review.
Review coverage was incomplete.
Reviewed:
a62be857f4de· Review report · Previous reportspermalink
lgtm ACK
a62be857f4Backported to
32.xin #36984.Backported to
31.xin #36928 and30.xin #36929.