HomePhabricator

test: tx orphan handling

Description

test: tx orphan handling

Summary:

I was doing some mutation testing (through reckless refactoring) locally and found some specific behaviors in orphan handling that weren't picked up by tests. Adding some of these test cases now can maybe help with reviewing refactors like #28031.
 - Parent requests aren't sent immediately. A delay is added and the requests are filtered by AlreadyHaveTx before they are sent, which means you can't use fake orphans to probe precise arrival timing of a tx.
 - Parent requests include all that are not AlreadyHaveTx. This means old confirmed parents may be requested.
 - The node does not give up on orphans if the peer responds to a parent request with notfound. This means that if a parent is an old confirmed transaction (in which notfound is expected), the orphan should still be resolved.
 - Rejected parents can cause an orphan to be dropped, but it depends on the reason and only based on txid.
 - Rejected parents can cause an orphan to be rejected too, by both wtxid and txid.
 - Requests for orphan parents should be de-duplicated with "regular" txrequest. If a missing parent has the same hash as an in-flight request, it shouldn't be requested.
 - Multiple orphans with overlapping parents should not cause duplicated parent requests.

Backport of core#28199.

The test_orphan_inherit_rejection case makes no sense without segwit so it has been removed, and well as some changes related to the absence of segwit and/or mempool ancestors accounting.

Depends on D16505.

Test Plan:

./test/functional/test_runner.py p2p_orphan_handling

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16503

Details

Provenance
glozow <gloriajzhao@gmail.com>Authored on Aug 11 2023, 14:51
FabienCommitted on Jul 19 2024, 14:07
FabienPushed on Jul 19 2024, 14:07
Reviewer
Restricted Project
Differential Revision
D16503: test: tx orphan handling
Parents
rABC673bc1eb29cf: net_processing: ignore transactions while in IBD
Branches
Unknown
Tags
Unknown

Event Timeline