fees: document non-monotonic estimation edge case #31080

pull willcl-ark wants to merge 1 commits into bitcoin:master from willcl-ark:doc-fee-inconsistency changing 1 files +8 −0
  1. willcl-ark commented at 8:42 pm on October 12, 2024: member

    Closes: #11800

    In scenarios where data is available for higher targets but not for lower ones, this method may return lower fee rates for higher confirmation targets. This could occur if estimateCombinedFee returns no valid data (-1) for some estimates for a low target, but does return valid data for a higher target.

    Users of this function should be aware of this potential, if unlikely, inconsistency in behaviour in data-sparse scenarios.

  2. DrahtBot commented at 8:42 pm on October 12, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31080.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ismaelsadeeq, adamandrews1
    Approach ACK tdb3

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. in src/policy/fees.cpp:906 in 745fe425b5 outdated
    901@@ -902,6 +902,14 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation
    902      * horizons so we already have monotonically increasing estimates and
    903      * the purpose of conservative estimates is not to let short term
    904      * fluctuations lower our estimates by too much.
    905+     *
    906+     * Note: In scenarios where data is available for higher targets but not
    


    adamandrews1 commented at 8:23 pm on October 15, 2024:
    Nit: The lead is a bit buried here. I would plainly state “Monotonically increasing estimates are not guaranteed in certain data-sparse scenarios. In particular, (fill in the rest of your comment)”

    willcl-ark commented at 10:00 pm on October 15, 2024:

    Thanks, I’m happy to take this suggestion. What do you think about:

     * Note: Monotonically increasing estimates are not guaranteed in certain
     * data-sparse scenarios. In particular, if estimateCombinedFee returns no
     * valid data (-1) for some estimates for a lower target, but does return
     * valid data for a higher target, the estimate can theoretically return a
     * higher value for higher targets.
    

    adamandrews1 commented at 10:02 pm on October 15, 2024:
    Great - LGMT

    willcl-ark commented at 8:15 am on October 16, 2024:
    OK pushed that in 372ca14
  4. adamandrews1 approved
  5. willcl-ark force-pushed on Oct 16, 2024
  6. adamandrews1 approved
  7. adamandrews1 commented at 7:29 pm on October 16, 2024: none
    Concept ACK Approach ACK
  8. laanwj added the label TX fees and policy on Oct 20, 2024
  9. laanwj added the label Docs on Oct 20, 2024
  10. fanquake requested review from ismaelsadeeq on Oct 21, 2024
  11. DrahtBot added the label CI failed on Oct 22, 2024
  12. in src/policy/fees.cpp:910 in 372ca14fbe outdated
    901@@ -902,6 +902,12 @@ CFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation
    902      * horizons so we already have monotonically increasing estimates and
    903      * the purpose of conservative estimates is not to let short term
    904      * fluctuations lower our estimates by too much.
    905+     *
    906+     * Note: Monotonically increasing estimates are not guaranteed in certain
    907+     * data-sparse scenarios. In particular, if estimateCombinedFee returns no
    908+     * valid data (-1) for some estimates for a lower target, but does return
    909+     * valid data for a higher target, the estimate can theoretically return a
    910+     * higher value for higher targets.
    


    ismaelsadeeq commented at 10:11 am on October 22, 2024:
    0     * Note: In certain rare edge cases, monotonically increasing estimates may not be 
    1     * guaranteed. Specifically, given two targets N and M, where M > N, if a sub-estimate
    2     * for target N fail to return a valid fee rate, while target M has valid fee rate for that
    3     * sub-estimate, target M may result in a higher fee rate 
    4     * estimate than target N.
    5     *
    6     * See: [#11800 (comment)](/bitcoin-bitcoin/11800/#issuecomment-349697807)
    

    I think the suggestion describes scenario better as stated in #11800 (comment).

    This will be even better when we specify which sub-estimate failures break the monotonic behavior of the fee rate estimates. The comments mention that we check the maximum confirmations for shorter time horizons to preserve this behavior.

    This applies to the first three sub-estimates for economical estimates and the first two for conservative estimates.

  13. ismaelsadeeq commented at 10:13 am on October 22, 2024: member
    Concept ACK
  14. DrahtBot removed the label CI failed on Oct 25, 2024
  15. tdb3 commented at 7:23 pm on November 2, 2024: contributor

    Approach ACK

    The update suggested in #31080 (review) seems to increase clarity.

  16. DrahtBot commented at 0:33 am on May 1, 2025: contributor

    There hasn’t been much activity lately. What is the status here?

    Finding reviewers may take time. However, if the patch is no longer relevant, please close this pull request. If the author lost interest or time to work on this, please close it and mark it ‘Up for grabs’ with the label, so that it can be picked up in the future.

  17. maflcko commented at 5:18 pm on May 4, 2025: member
    @willcl-ark I guess you’ll have to push the requested change, or reply to it, or close this pull?
  18. fees: document non-monotonic estimation edge case
    Closes: #11800
    
    Note: In certain rare edge cases, monotonically increasing estimates may
    not be guaranteed. Specifically, given two targets N and M, where M > N,
    if a sub-estimate for target N fails to return a valid fee rate, while
    target M has valid fee rate for that sub-estimate, target M may result
    in a higher fee rate estimate than target N.
    
    See: https://github.com/bitcoin/bitcoin/issues/11800#issuecomment-349697807
    1e0de7a6ba
  19. willcl-ark force-pushed on May 6, 2025
  20. willcl-ark commented at 8:51 am on May 6, 2025: member

    @willcl-ark I guess you’ll have to push the requested change, or reply to it, or close this pull?

    Sure @maflcko, I took the suggestion and rebased.

  21. ismaelsadeeq approved
  22. ismaelsadeeq commented at 12:06 pm on May 6, 2025: member
    Code review ACK 1e0de7a6ba926487c8a075856b74af2a3a0eb8ef
  23. DrahtBot requested review from tdb3 on May 6, 2025
  24. DrahtBot requested review from adamandrews1 on May 6, 2025
  25. adamandrews1 commented at 12:18 pm on May 6, 2025: none
    Code review ACK 1e0de7a

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-05-09 03:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me