multi: Implement smart fee estimation. #1434
Sending for initial review and to discuss some last points that might require working before merging.
As a preliminary, I'm sending attached the fee database collected over the last few days in mainnet, and the dump of the estimator state for this same database:
Results of the estimation:
A few notes for discussion:
Current stats after running in mainnet for ~2 weeks.
This adds the first version of the fees package, responsible for performing fee estimation of network transactions. The main goal of fee estimation is to allow the usage of dynamic fees by wallets, contingent on block contention and the desired confirmation range for a given transaction. This version was based on bitcoin core fee estimation.
This commit performs the necessary modifications to hook the fee estimation facility added by the previous commit into the node software. The block manager is modified to notify the estimator of all new blocks, such that their transactions can be accounted for, and the mempool is modified to relay transactions entering and leaving it, so that those transactions can be tracked. The results of the estimator can be queried by issuing estimatesmartfee rpc commands to the node.