p2p: do not park spent confirmed txs as orphans - #558
Merged
Merged
Conversation
Spent or missing-vout prevouts on a confirmed create are MissingPrevout, not orphanage, so we stop GETDATAing parents of txs we just stripped. INV AlreadyHave includes Class A and a recent-confirmed txid/wtxid ring. Re-delivery of an already-parked orphan still fetches parents (TTL) but does not log a second txrelay: park line. Co-authored-by: Cursor <cursoragent@cursor.com>
A missing vout on a tip-connected create is KnownUnavailable even if is_outpoint_spent errors, so we do not park it. Pin recent-confirmed clear/re-note so INV AlreadyHave coverage does not drop the line gate. Co-authored-by: Cursor <cursoragent@cursor.com>
Pick up leftover Esplora and fork-header coverage pins so the never-falls line gate compares this branch against current master.
Coverage never-falls was red against current master. Drive confirm_write with relay on, FIFO evict of the recent-confirmed ring, and park of a spend whose create lost its Class A height. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mainnet
txrelay: parkfloods were mostly txs whose parents were already confirmed (or the confirmed bodies themselves), not true child-before-parent. INV AlreadyHave only looked at the live mempool and orphanage, so peers re-GETDATA'd what we had just stripped.MissingPrevout, not an orphan park (QueryUtxoProvider::chain_prevout). Spentness lookup failure on a confirmed create fails closed (KnownUnavailable).tx_fk_by_txid_tip.txrelay: park.Does not change tip-follow peer count, INV trickle, or mempool admission policy.
Test plan
spent_confirmed_prevout_is_missing_not_orphanget_coin_skips_block_tx_fks_and_mtp_without_time_lock(re-accept confirmed →MissingPrevout, Class A + recent-confirmed AlreadyHave, disconnected create parks)confirm_wire_script_splitfills recent-confirmed wtxid on IBDconfirm_writerecent_confirmed_evicts_oldest_over_caphandle_peer_frame_mempool_tx_and_inv_paths(genesis Class A + generated coinbase INV do not GETDATA)park_orphan_is_graph_onlyre-insertfresh: false;parked_orphan_tx_is_not_logged_as_rejectsecondtxhas no park linecargo clippy --workspace --all-targets -- -D warningsfmt,deny,clippy,ast-grep,test,windows,macos,coverage)