mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 11:53:39 +00:00
p2p: Reconsider package transactions that are immediately trimmed #36328
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!36328
Loading…
Reference in a new issue
No description provided.
Delete branch "package-trim-reconsiderable"
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?
In-master, if a package is entered into mempool at the lowerst chunk feerate, pushing the mempool oversize, this causes that transaction (package) to be trimmed immediately. This is fine and expected, but the returned validation result
TX_MEMPOOL_POLICYprecludes the now-evicted parent from being considered again (i.e. fetched / processed as package) until after another block is found.This is not a major issue, but would result in unneeded censorship of someone low-balling package feerates.
The already-in-mempool case needs a bit more logic due to the
FeeFailure's requirement of package feerate knowledge, so I opted to defer it for now.Related to finding made by Loupe, and subsequently Red Team.
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
No conflicts as of last run.
🚧 At least one of the CI tasks failed.
Task
ASan + LSan + UBSan + integer: https://github.com/bitcoin/bitcoin/actions/runs/36027432164/job/107727417441LLM reason (✨ experimental): CI failed to compile
test_bitcoinbecause Clang-Wthread-safety(treated as-Werror) reported an exclusivecs_mainlock is missing when callingProcessNewPackageintxpackage_tests.cpp.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
f19e4bfc9be5· Full review report · Previous reportspermalink
This PR closes out R10: https://gist.github.com/instagibbs/880a76535fd802fced9f9a5253cdbb40
Concept ACK
Seems to me that the first part is much more important because it could be encountered via p2p 1p1c.
The second part seems less urgent, and I think it could wait until after removing the fee information from
FeeFailure, as suggested in the OP.As far as I understand, the second part would mostly be encountered via rpc anyway, where it makes no observable difference (same error string). By delaying it we wouldn't need to introduce
deduplicated_feerates.@mzumsande split it up, thanks
Code Review ACK
f19e4bfc9bACK
f19e4bfc9bI also went through the other
TX_MEMPOOL_POLICYreasons. The "max feerate exceeded" one is a local only guard that can't be triggered over p2p, others are legitimate except one left deliberately by the OP. For that, I think a user who hits it can workaround the rejection by e.g. running with a larger -maxmempool, or starting from an empty mempool and not accepting incoming txs (-blocksonly). larger -maxmempool is optimistic but better because a blocksonly node relays only its own transactions and accepts none from peers, so it could be a source leak.This should be fixed too.
nit: can be boost check equal