[!WARNING]
This feature is experimental.
I have done lots of manual tests before submit this PR, but more production environment tests are still required.
Add an optional fee estimator with different algorithms and a RPC method for it.
Description
I do lots manual tests for several day, I don't sure which algorithm is better, so I just submit both of them.
Let's make choice after collect more data in production environment (both mainnet and testnet).
Only 4 levels of priorities for the fee estimator.
Different algorithms have different APIs, I just use some constants as default parameters to avoid specialized parameters, to make the public API more generic.
The main difference is I use the block interval to replace the time interval, to avoid unit conversion with random distributions, since our APIs require blocks as the target unit for estimation.
The details of this algorithm are written in the head section of that source code file.
Merged fallback fee estimates algorithm from #4465.
Usage
Append the following content to ckb.toml:
[fee_estimator]
# Specifies the fee estimates algorithm. Current algorithms: ConfirmationFraction, WeightUnitsFlow.
algorithm = "WeightUnitsFlow"
And enable JSON-RPC API module Experiment.
After the CKB node started, try the following command:
What problem does this PR solve?
Add an optional fee estimator with different algorithms and a RPC method for it.
Description
I do lots manual tests for several day, I don't sure which algorithm is better, so I just submit both of them.
Let's make choice after collect more data in production environment (both mainnet and testnet).
Only 4 levels of priorities for the fee estimator.
Different algorithms have different APIs, I just use some constants as default parameters to avoid specialized parameters, to make the public API more generic.
Current, there are 2 built-in algorithms:
Confirmation Fraction
Migrated from this CKB PR.
ππΌ Sometimes, it returns unreasonable result, I haven't figured it out yet, since I couldn't reproduce it manually.
Weight-Units Flow
A variant of the Weight-Units Flow Fee Estimator for Bitcoin.
The main difference is I use the block interval to replace the time interval, to avoid unit conversion with random distributions, since our APIs require blocks as the target unit for estimation.
The details of this algorithm are written in the head section of that source code file.
Merged fallback fee estimates algorithm from #4465.
Usage
Append the following content to
ckb.toml
:And enable JSON-RPC API module
Experiment
.After the CKB node started, try the following command:
An example of result is:
What is changed and how it works?
What's Changed:
Related changes
owner/repo
:Check List
Tests
Release note