The block policy estimator currently assumes that a miner is incentivized to include a transaction only by its own fee. That is if a tracked transaction A
with a feerate of 1sat/vb
is confirmed because it was CPFP’d by a child transaction B
with a feerate of 20sat/vb
it will happily fill its 1ksat/kvb bucket with a success confirmation. Note that B
isn’t tracked as it has in-mempool ancestors.
This is concerning as it would not only miss part of the data necessary to provide a correct (higher) estimate (as it’s the case for RBF, cf #22539) but it would wrongly assume an incorrect (lower) estimate was right. It is even more concerning if we take into account that estimating a too low fee could have security implications for protocols requiring timely confirmation of transactions.
Of course, the estimation would only get worse as CPFP is increasingly used on the network. But it is actively used currently [0] on the network, many applications allow for this functionality directly [1] or indirectly [2]. And with the increasing usage of L2s such as the Lightning Network, we can expect the CPFP usage to increase even more as fee bumping methods get more common. Interestingly, with the current estimator the more anchor output-based fee bumping (shifting the fees from the parent to a child transaction) are used on the network the less the estimation will be reliable for everyone.
This PR proposes a naive implementation for accounting for child transaction(s) feerates when a parent transaction gets confirmed in CBlockPolicyEstimator
’s processBlock
. It would fail to split the feerate if multiple parents share the same child and assign the whole package (but the other parent(s)) feerate to the first seen parent. Accurate tracking would introduce way more complexity.
[0] TODO: Provide some raw data about historical usage of CPFP
[1] For instance Bluewallet, LND, Mycelium and SparrowWallet do. And Lightning implems recommend to do a CPFP if the funding transaction doesn’t confirm in a timely manner until we have an upgrade of the funding protocol allow for RBF.
[2] For lots of wallets include the Bitcoin Core one during a fee spike users continue to transact using unconfirmed UTxOs with transactions of increasing feerate (and even sometimes open an issue because they hit the descendants limit).