refactor: rename fees.{h, cpp} to fees/block_policy_estimator{h, cpp} #33218

pull ismaelsadeeq wants to merge 4 commits into bitcoin:master from ismaelsadeeq:08-2025-block-policy-refactor changing 26 files +38 −36
  1. ismaelsadeeq commented at 5:47 pm on August 19, 2025: member

    This PR is a simple refactoring that does four things:

    1. Renames test/policy_fee_tests.cpp to test/feerounder_tests.cpp.
    2. Renames policy/fees.{h,cpp} to policy/fees/block_policy_estimator.{h,cpp}.
    3. Renames policy/fees_args.cpp to policy/fees/block_policy_estimator_args.cpp.
    4. Modifies estimateSmartFee to return the block height at which the estimate was made by adding a best_height unsigned int value to the FeeCalculation struct.

    Motivation

    In preparation for adding a new fee estimator, the fees directory is created so we can organize code into block_policy_estimator and mempool because

    a) It would be clunky to add more code directly under fees. b) Having policy/fees.{h,cpp} and policy/mempool.{h,cpp} would also be undesirable.

    Therefore, it makes sense to structure the it as policy/fees/block_policy_estimator, policy/fees/mempool, etc. Hence test file were also updated accordingly.

    The current block height is also returned because later in #30157 we log the height at which each estimate is made (at the debug log category of fee estimation :) ). This feature is particularly useful for empirical data analysis.

  2. fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp
    - Also remame the test suite name to match the new name.
    5a4b1c7727
  3. fees: refactor: rename fees to block_policy_estimator
    - Also move it to policy/fees and update the includes
    3864a5b964
  4. fees: rename fees_args to block_policy_estimator_args
    - Also move them to policy/fees/ and update includes
    - Note: the block_policy_estimator_args.h include in block_policy_estimator_args.cpp was done manually.
    cfa0784857
  5. fees: return current block height in estimateSmartFee 6c917b8ded
  6. DrahtBot commented at 5:47 pm on August 19, 2025: 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/33218.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32523 (wallet: Remove isminetypes by achow101)
    • #28690 (build: Introduce internal kernel library by TheCharlatan)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. ismaelsadeeq renamed this:
    fees: refactor: Create `policy/fees` dir and rename `fees.{h, cpp}` to `fees/block_policy_estimator{h, cpp}`
    refactor: rename `fees.{h, cpp}` to `fees/block_policy_estimator{h, cpp}`
    on Aug 19, 2025
  8. DrahtBot added the label Refactoring on Aug 19, 2025
  9. DrahtBot added the label Needs rebase on Aug 21, 2025
  10. DrahtBot commented at 3:46 pm on August 21, 2025: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.

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-08-24 09:13 UTC

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