Test: Add new minimum to tested feerates
What changed, and why it matters
This commit only changes test code. It updates the list of transaction fee rates used in wallet coin-selection unit tests to reflect a recent lowering of Bitcoin Core's default minimum fee rate and to cover more edge cases. No production code is modified, so this has no direct security impact on running Bitcoin nodes or wallets.
No security action required. Review as normal test-maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is confined to src/wallet/test/coinselection_tests.cpp. It replaces a locally defined feerates vector in the bnb_test test case with a shared FEERATES constant that includes values around the new 100 s/kvB default minimum, the old 1000 s/kvB default, dust/LTFRE-related values, and previously used high/extreme values. This is purely a test-coverage adjustment.
Changed components
src/wallet/test/coinselection_tests.cppInspect captured patch +16 / −3
diff --git a/src/wallet/test/coinselection_tests.cpp b/src/wallet/test/coinselection_tests.cpp
index 46b0b463..347e00f7 100644
--- a/src/wallet/test/coinselection_tests.cpp
+++ b/src/wallet/test/coinselection_tests.cpp
@@ -18,6 +18,21 @@ static FastRandomContext default_rand;
static const int P2WPKH_INPUT_VSIZE = 68;
static const int P2WPKH_OUTPUT_VSIZE = 31;
+/**
+ * This set of feerates is used in the tests to test edge cases around the
+ * default minimum feerate and other potential special cases:
+ * - zero: 0 s/kvB
+ * - minimum non-zero s/kvB: 1 s/kvB
+ * - just below the new default minimum feerate: 99 s/kvB
+ * - new default minimum feerate: 100 s/kvB
+ * - old default minimum feerate: 1000 s/kvB
+ * - a few non-round realistic feerates around default minimum feerate,
+ * dust feerate, and default LTFRE: 315 s/kvB, 2345 s/kvB, and
+ * 10'292 s/kvB
+ * - a high feerate that has been exceeded occasionally: 59'764 s/kvB
+ * - a huge feerate that is extremely uncommon: 1'500'000 s/kvB */
+static const std::vector<int> FEERATES = {0, 1, 99, 100, 315, 1'000, 2'345, 10'292, 59'764, 1'500'000};
+
/** Default coin selection parameters allow us to only explicitly set
* parameters when a diverging value is relevant in the context of a test,
* without reiterating the defaults in every test. We use P2WPKH input and
@@ -123,9 +138,7 @@ static void TestBnBFail(std::string test_title, std::vector<OutputGroup>& utxo_p
BOOST_AUTO_TEST_CASE(bnb_test)
{
- std::vector<int> feerates = {0, 1, 5'000, 10'000, 25'000, 59'764, 500'000, 999'000, 1'500'000};
-
- for (int feerate : feerates) {
+ for (int feerate : FEERATES) {
std::vector<OutputGroup> utxo_pool;
const CoinSelectionParams cs_params = init_cs_params(feerate);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.