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

1a7fb5eeee fees: return current block height in estimateSmartFee (ismaelsadeeq)
ab49480d9b fees: rename fees_args to block_policy_estimator_args (ismaelsadeeq)
06db08a435 fees: refactor: rename fees to block_policy_estimator (ismaelsadeeq)
6dfdd7e034 fees: refactor: rename policy_fee_tests.cpp to feerounder_tests.cpp (ismaelsadeeq)

Pull request description:

  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.

ACKs for top commit:
  maflcko:
    re-ACK 1a7fb5eeee 🐤
  polespinasa:
    re ACK 1a7fb5eeee
  willcl-ark:
    ACK 1a7fb5eeee
  janb84:
    re ACK 1a7fb5eeee

Tree-SHA512: fef7ace2a9f262ec0361fb7a46df5108afc46b5c4b059caadf2fd114740aefbb2592389d11646c13d0e28bf0ef2cfcfbab3e659c4d4288b8ebe64725fd1963c0
This commit is contained in:
merge-script
2025-10-28 11:57:59 -04:00
26 changed files with 38 additions and 36 deletions

View File

@@ -43,6 +43,7 @@ add_executable(test_bitcoin
descriptor_tests.cpp
disconnected_transactions.cpp
feefrac_tests.cpp
feerounder_tests.cpp
flatfile_tests.cpp
fs_tests.cpp
getarg_tests.cpp
@@ -72,7 +73,6 @@ add_executable(test_bitcoin
pcp_tests.cpp
peerman_tests.cpp
pmt_tests.cpp
policy_fee_tests.cpp
policyestimator_tests.cpp
pool_tests.cpp
pow_tests.cpp

View File

@@ -3,13 +3,13 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <consensus/amount.h>
#include <policy/fees.h>
#include <policy/fees/block_policy_estimator.h>
#include <boost/test/unit_test.hpp>
#include <set>
BOOST_AUTO_TEST_SUITE(policy_fee_tests)
BOOST_AUTO_TEST_SUITE(fee_rounder_tests)
BOOST_AUTO_TEST_CASE(FeeRounder)
{

View File

@@ -4,7 +4,7 @@
#include <common/messages.h>
#include <consensus/amount.h>
#include <policy/fees.h>
#include <policy/fees/block_policy_estimator.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>

View File

@@ -5,7 +5,7 @@
#include <common/messages.h>
#include <merkleblock.h>
#include <node/types.h>
#include <policy/fees.h>
#include <policy/fees/block_policy_estimator.h>
#include <rpc/util.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>

View File

@@ -3,8 +3,8 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <kernel/mempool_entry.h>
#include <policy/fees.h>
#include <policy/fees_args.h>
#include <policy/fees/block_policy_estimator.h>
#include <policy/fees/block_policy_estimator_args.h>
#include <primitives/transaction.h>
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>

View File

@@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <policy/fees.h>
#include <policy/fees_args.h>
#include <policy/fees/block_policy_estimator.h>
#include <policy/fees/block_policy_estimator_args.h>
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>

View File

@@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <policy/fees.h>
#include <policy/fees_args.h>
#include <policy/fees/block_policy_estimator.h>
#include <policy/fees/block_policy_estimator_args.h>
#include <policy/policy.h>
#include <test/util/txmempool.h>
#include <txmempool.h>

View File

@@ -28,7 +28,7 @@
#include <node/peerman_args.h>
#include <node/warnings.h>
#include <noui.h>
#include <policy/fees.h>
#include <policy/fees/block_policy_estimator.h>
#include <pow.h>
#include <random.h>
#include <rpc/blockchain.h>