This was suggested in #26933 (comment).
The Problem Package CPFP (only accessible through regtest-only RPC submitpackage) allows 0-fee (or otherwise below min relay feerate) transactions if they are bumped by a child. We need to know what to do with these transactions if they lose their sponsor, e.g. due to a replacement that removed the input spending this 0-fee transaction.
This is made slightly more complicated by the fact that our “selection scoring” (BlockAssembler) is different from our “eviction scoring.” Roughly, we select based on ancestor feerate and evict based on descendant feerate. This may lead to evicting things we would actually want to mine and not evicting things that we will never mine.
This PR’s approach is to remove the 1sat/vB -blockmintxfee
and have BlockAssembler select anything in the mempool (still based on ancestor packages, but not stopping at 1sat/vB). It also adds logic to TrimToSize()
to evict anything paying <=0 fees. The idea is, if we’re getting to the bottom of our mempool, we scrape up all the sats we can. Anything that pays some fee is worth adding to the block template.
A major advantage of this approach is that 0-fee, non-v3 transactions can be bumped in package CPFP.
A few observations which may or may not be problematic:
- This increases the potential work after a reorg, since we add an extra step of removing the below-minrelayfeerate entries.
- This increases the number of transactions that may be evicted in a replacement (from the worst case scenario we discussed before, it’s up to 2500 entries).
- This means you can remove a transaction from your own mempool by calling prioritisetransaction with a negative value.