Files
bitcoin/test/functional/feature_fee_estimation.py
Ava Chow e3f416dbf7 Merge bitcoin/bitcoin#32463: test: fix an incorrect feature_fee_estimation.py subtest
9b75cfda4d test: retain the intended behavior of `feature_fee_estimation.py` nodes (ismaelsadeeq)
5c1236f04a test: fix incorrect subtest in `feature_fee_estimation.py` (ismaelsadeeq)

Pull request description:

  Attempt to fix #32461

  In the `estimatesmartfee` RPC, we return the maximum of the following: the feerate estimate for the target, `minrelaytxfee`, and `mempoolminfee`.

  9a05b45da6/src/rpc/fees.cpp (L85)

  The test `test_feerate_mempoolminfee`, originally introduced in ea31caf6b4, is incorrect.

  It should calculate the fee rate ceiling by taking the maximum of the custom `minrelaytxfee`, `mempoolminfee`, and the highest fee rate observed during the test (`check_smart_estimates`). This is necessary because:

  * There is no guarantee that the generated fee rates will exceed both `minrelaytxfee` and `mempoolminfee`.
  * Users can start a node with custom fee settings.

  Due to the non-deterministic nature of the `feature_fee_estimation.py` test, it often passes by chance. The randomly generated fees typically include a value higher than the custom `minrelaytxfee`, inadvertently hiding the issue.

  Issue #32461 identified a random seeds that consistently fails the test because the generated fees never exceed the custom `minrelaytxfee`:

  e.g
  ```
  build/test/functional/feature_fee_estimation.py --random=3450808900320758527
  ```

  This PR has two commits which :

  * Correctly fixes the test by calculating the fee rate ceiling as the maximum of the node `minrelaytxfee`, `mempoolminfee`, and the highest seen fee rate, when verifying smart fee estimates.
  * Improves the subtest name and comment for clarity.
  * Restores the original test behavior by appending 4000 WU to the custom `blockmaxweight`.

ACKs for top commit:
  achow101:
    ACK 9b75cfda4d
  glozow:
    ACK 9b75cfda4d
  theStack:
    Light ACK 9b75cfda4d

Tree-SHA512: 0f7fb0496b50a399b58f6fb1afd95414fad454795fbc0046e22dfc54a2062ae0c519a12ebfeb6ad7ef547438868d99eca2351c0d19d0346adaadb500eff6f15f
2025-07-03 16:45:29 -07:00

21 KiB
Executable File