Fix a legitimate scenario that feerate is not always available, due to the randomly generated fees that causes current percentage to be smaller than success break point, in TxConfirmStats::EstimateMedianVal (in src/policy/fees.cpp). The solution is to hard code a list of fees that guarantee to pass the check of fees and smart fees.
To reproduce/validate the issue, run the test with a specific randomseed: 2986529890161488286
build/test/functional/test_runner.py test/functional/feature_fee_estimation.py –randomseed=2986529890161488286 –tmpdir /tmp
To generate the good data point, i.e., global_fee_list, I ran the original test with –randomseed=298652989016148828, which is a good randomseed, and output the calculated result of fee:
0rand_fee = float(fee_increment) * (1.1892 ** random.randint(0, 28))
1
2fee = min_fee - fee_increment + satoshi_round(rand_fee, rounding=ROUND_DOWN) # output this fee as the data point that can be used to generate deterministic result.
Then, for each calling of function small_txpuzzle_randfee , simply take the result from the data point, i.e., global_fee_list and that’s it.
More details can be found in discussion of #31944