mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
test: make p2p_orphan_handling's never-requested checks able to fail #36406
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!36406
Loading…
Reference in a new issue
No description provided.
Delete branch "test-orphan-handling-never-requested-int"
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?
assert_never_requestedcompares its argument with the hashes in the node's getdata messages, which are ints.test_orphan_inherit_rejectionpasses it hex strings, so its four checks pass whatever the node requests.This passes ints, which needs two more changes. The rejected parent is now relayed from
peer2: relaying a transaction makes the node request it from that peer (the parent has no witness, so the request is for its txid), and frompeer1that request would fail thepeer1check. Mocktime is bumped before thepeer1andpeer2checks, because the node requests an orphan's missing parent only after a delay; without the bump those checks would pass before any request could be sent.It also fixes a comment: the parent is rejected for its weight (
tx-size), not its fee.To see each check fail, change the scenario so that the node does request the hash. The commit message lists the changes I used.
Found while porting these tests to https://github.com/btclib-org/bitcoin-node-tests.
Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.
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:
69142eacd1374925cc9e4ea736c21fcec16307d0Head:
5f22014aca2d071edfea95e8d3d4ba0bebbc57caI found no actionable issues in this static review.
Full review report
concept ACK, good catches
Could we add this to
assert_never_requestedto remove the footgun and find misuse elsewhere going forward:since we're changing this to peer2, and it's non-obvious, very brief comment why?
nit: think this works here and elsewhere and is less verbose
Thanks, all three taken, and rebased on master. The int check is in its own commit; it trips nowhere else, because
assert_never_requestedis only defined and used in this test.x["txid"]is a hex string, so I usedx["tx"].txid_intinstead ofx["txid"].txid_int.ACK https://github.com/bitcoin/bitcoin/pull/36406/commits/5f22014aca2d071edfea95e8d3d4ba0bebbc57ca
ACK
5f22014acaralph referenced this pull request2026-11-16 19:07:04 +00:00