Repository navigation
p2p: make orphan processing interruptible (backport) - #64
Merged
Merged
Conversation
Backport Bitcoin Core PR #15644 (866c805) so each peer keeps an orphan_work_set and one orphan is validated per turn. ProcessMessages resumes that work on the peer's next turn. Bump the wallet to 1.0.20. Consensus unchanged. Co-authored-by: NiFTy_RaVeN <nerontus@gmail.com>
The functional harness still used the previous network magic and a protocol version below the peer minimum, so p2p tests could not complete a handshake. Unknown commands are ignored so extra peer messages do not drop the connection. The orphan regression test mines its own regtest chain with a Sign-in mock. Co-authored-by: NiFTy_RaVeN <nerontus@gmail.com>
Regtest coinbases require an active-set commitment. The harness now passes a per-node Sign-in mock for the shared cache and for each test node. The branch workflow runs the orphan-map and release unit tests plus the functional tests that complete on this chain. Co-authored-by: NiFTy_RaVeN <nerontus@gmail.com>
The desktop Sign in / Re-link cooldown was one hour. It is now five minutes. The session file lifetime is unchanged. The branch test workflow notes why the full unit suite is not the gate. Co-authored-by: NiFTy_RaVeN <nerontus@gmail.com>
NiftyRaven
marked this pull request as ready for review
September 27, 2026 03:41
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
Backport of upstream Bitcoin Core PR #15644 ("Make orphan processing interruptible", commit
866c8058a706931f025335b3e794ed2f4d287918) for network robustness.orphan_work_set.ProcessOrphanTxvalidates one orphan per call.ProcessMessagesresumes that work on the peer's next turn.Wallet version is 1.0.20 (same places the 1.0.19 release bumped). Release notes:
docs/RELEASE-1.0.20.md. Package workflows:.github/workflows/package-xcoin-1.0.20.ymland the Light equivalent.Sign in with X / Re-link can be tried again after 5 minutes (
kOAuthCooldownMs, previously one hour). The loopback callback wait stays 15 seconds. A live GUI session still hasexp0 (no wall-clock end). Regtest mock sessions still write a 365-dayexp, and that value is not a kick.A regression functional test (
test/functional/p2p_orphan_processing.py) sends many orphans that each spend several outputs of a not-yet-seen parent, then the parent. It checks that every orphan is accepted and that another peer still completes ping/pong while that work is in progress..github/workflows/orphan-processing.ymlbuilds and runs the related tests on pushes to this branch.Deviations from the attached patch
Behavior matches the patch and upstream
866c805. This tree has no separate orphan lock, soProcessOrphanTxstays undercs_mainand callsmempool.check(pcoinsTip). The patch's validation-state comment was reworded.net.hincludes<set>and a one-line note onorphan_work_set. The release test's version integer is1002000(the 1.0.19 bump still expected1001800).The functional harness uses this chain's network magic and protocol version
70028, ignores unknown peer commands, and passes a regtest Sign-in mock sogenerate()can write an active-set commitment.Test plan
./configure --without-gui --disable-bench --with-incompatible-bdb && make -j3) — compiled.xcoindreportsv1.0.20.0-36f8677. Warnings only. Later commits do not change the node sources that binary was built from, except the Qt Sign in cooldown (not rebuilt here).DoS_tests/DoS_maporphans_test— passxrelease_tests— pass (7 cases)make check— fail, pre-existing. Exit 2:test/util/raven-util-test.pyis missing, andtest/test_ravenaborts (368 cases, 2596 failures). The branch workflow does not gate on that suite.mempool_limit.py— pass (5 s)mempool_persist.py— pass (29 s)p2p_mempool.py— pass (1 s)p2p_leak_tx.py— pass (1 s)p2p_disconnect_ban.py— pass (2 s)p2p_orphan_processing.py— pass. Peer B ping/pong returned in 0.050 s; 32 accepted-orphan log lines; 1 ping log line between the first and last accept.mempool_reorg.py— fail.create_txcannot sign height-102 coinbase vout 0. That output pays an address the mining wallet does not own after payout scripts are applied.feature_assets_mempool.py— fail.issue()requires an identity root.X16R TODO skips already listed in
test_runner.py(not run):feature_cltv,feature_dersig,feature_nulldummy,feature_segwit,mining_basic,p2p_compactblocks,p2p_fingerprint,p2p_segwit,p2p_sendheaders.