When suggesting the “fee estimation should use chunk feerates”, I had imagined it would just use our mempool’s clusters/chunks to determine those values.
Yes
I guess you could track chunks + the individual transactions, and only use exact matches after you linearize the block?
I agree and think that’s what’s better to do and the safest.
So we should track chunks, individual transactions are also chunks with single transactions.
Whenever we receive a new block we linearize the block to get a series of chunks.
If there is an exact match for a chunk of transactions and its fee rate, remove it as a success.
Otherwise, remove the chunk transactions from the fee estimator mapMempoolTxs and blockIndex.
The mempool should notify the fee estimator about new chunks, updated chunks, and chunk eviction.
Reasons why chunk fee rate will not match in some cases might be due to
- Mempool differences
- Differences in linearization algorithm
- When a subset of the package is mined
I think it’s best to ignore if there is a mismatch in all the cases above.
This way we are on safe side by relying on our mempool just as sipa mentioned.