mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 12:20:38 +00:00
p2p: plug "tier 1" 1p1c liveness holes #36506
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!36506
Loading…
Reference in a new issue
No description provided.
Delete branch "2026-10-1p1c-liveness-fixes"
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?
Resolves a few key weaknesses in 1p1c relay, focusing on issues that can be easily achieved on average cpfp behavior.
Deferred fuzz harness for the holes: https://github.com/instagibbs/bitcoin/tree/2026-11-1p1c-liveness-fuzz
Known issues doc: https://gist.github.com/instagibbs/880a76535fd802fced9f9a5253cdbb40
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.Conflicts
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
LLM Linter (✨ experimental)
Possible places where comparison-specific test macros should replace generic comparisons:
test/functional/p2p_opportunistic_1p1c.py:assert package_fee / honest_vsize * 1000 > mempoolminfee→ Preferassert_greater_than(package_fee / honest_vsize * 1000, mempoolminfee).2026-11-30 20:30:50
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments.
🔵 Suggestion · A retained low-feerate child can delay its acceptable sibling after a tip change
After a tip change clears the pair cache, a retained low-feerate child can consume another parent delivery before an acceptable sibling is tried; no production occurrence of this sequence has been identified.
Location:
src/net_processing.cpp:3466(head).🔵 Suggestion · A failed
BOOST_REQUIREleavesconnmanwith a destroyedPeerManagerIf a fatal assertion fails after the test nodes are registered, stack unwinding destroys
peermanbeforeconnman, whose destructor then finalizes those nodes through a danglingm_msgproc.Location:
src/test/txdownload_tests.cpp:482(head).🔵 Suggestion · The new functional test misses repeated evaluation of the failed padded pair
The test checks child retention and honest-parent recovery, but would not detect repeated package evaluation when the attacker resends the same padded parent.
Location:
test/functional/p2p_opportunistic_1p1c.py:395(head).🔵 Suggestion ·
d8c1eb7couples tracker-state changes to relay-policy changesThe new
TxRequestTrackeroperation has independently testable completion and deletion semantics that are easier to validate separately from its witness-sensitive relay-policy use.Location: src/txrequest.cpp:566 (commit).
Reviewed:
d8c1eb7e8d3a· Review report · Previous reportspermalink
@marcofleon @mzumsande this will be the ultimate target PR to fuzz
Tested
c8abd9ee41: each of the four fixes is caught by a test this PR adds or extends. I reverted each fix on its own, keeping the tests, and each revert madetxdownload_tests,orphanage_testsorp2p_opportunistic_1p1c.pyfail, while the unchanged branch passes them all. I did not review the C++ changes. Details on request.ACK
c8abd9ee41. I have now reviewed the four fixes commit by commit and found nothing blocking. One gap remains for a follow-up: in the 1p1c package path, aDIFFERENT_WITNESSresult still goes throughProcessInvalidTx, so a witness-stripped copy of a mempool parent puts the parent's txid in the reject filter, asTX_CONFLICTdid before3a2b5539a1. A functional test shows it end to end: an attacker peer re-sends the stripped copy with an orphan of its own, and after the parent leaves the mempool, an honest child is dropped as having a rejected parent. Test on request.reACK
8d44ac8909. The newDIFFERENT_WITNESScase closes the 1p1c gap I noted atc8abd9ee41, and the only other code change is its test,known_parent_in_package_does_not_poison_after_eviction. I builttest_bitcoinand rantxdownload_tests,orphanage_testsandtxpackage_tests: the new test passes, and fails with that case moved back next toINVALID.@fametrano fuzzer hit it, which is a good sign
Concept ACK
I reviewed the
net_processingfixes/non-fuzz changes and they are all quite small and reviewable, and they all look good to me.Personally, it would help me to ACK quicker if the large
p2p_1p1c_livenessfuzz target was added in a separate PR, especially since all the changes covered by other tests as well, and a lot of code gets added first and then removed again in later commits - but up to you of course.If that makes it easier, can do. Would you prefer just to have me close https://github.com/bitcoin/bitcoin/pull/36437 , split out the fuzz target commits, and get this one merged ASAP?
Rabased on master, deferring the fuzz harness as future PR work at https://github.com/instagibbs/bitcoin/tree/2026-11-1p1c-liveness-fuzz
Code Review ACK
a30665c3c6I reviewed the entire code changes after the new fuzz test was deferred, the comments are minor.
I think I'd prefer a different name, such as
ForgetTxHashOfTypeor similar to avoid confusion with the existing method (e.g.ForgetTxHash(ptx->GetHash())used to be a compile error, now it compiles and has different behavior fromForgetTxHash(ptx->GetHash().ToUint256())) which may not be intended by future callers.nit: Maybe we don't really need this? It's only called from tests, and it seems that existing checks already covers the behavior pretty well, so not sure if its adds enough additional coverage.
suggestion taken
removed
Code Review ACK
d8c1eb7e8dConcept ACK