Repository navigation
p2p: Reconsider package transactions that are immediately trimmed - #36328
instagibbs wants to merge 3 commits into
Conversation
…iderable A transaction evicted by LimitMempoolSize() right after being accepted by itself is TX_RECONSIDERABLE: a package with a higher feerate may still get it in. Transactions submitted together as a package and evicted by the final trim in AcceptPackage() were TX_MEMPOOL_POLICY instead, as that code predates TX_RECONSIDERABLE. For 1p1c relay this put an evicted parent and child in the reject filter until the next block, so a new child could not bump the parent back in.
…ild before a new block
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsNo conflicts as of last run. |
0a3ab2c to
3c6cd0c
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
mzumsande
left a comment
There was a problem hiding this comment.
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.
3c6cd0c to
f19e4bf
Compare
|
@mzumsande split it up, thanks |
ismaelsadeeq
left a comment
There was a problem hiding this comment.
ACK f19e4bf
I also went through the other TX_MEMPOOL_POLICY reasons. 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.
| BOOST_CHECK(tx_result.m_effective_feerate == package_feerate); | ||
| BOOST_CHECK(tx_result.m_wtxids_fee_calculations == std::vector<Wtxid>({tx_parent->GetWitnessHash(), tx_child->GetWitnessHash()})); |
There was a problem hiding this comment.
nit: can be boost check equal

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.