0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-05 10:17:30 -05:00
bitcoin-bitcoin-core/src/wallet/test
Samuel Dobson 70676e40d8
Merge bitcoin/bitcoin#22009: wallet: Decide which coin selection solution to use based on waste metric
86beee0579 Use waste metric for deciding which selection to use (Andrew Chow)
b3df0caf7c tests: Test GetSelectionWaste (Andrew Chow)
4f5ad43b1e Add waste metric calculation function (Andrew Chow)
935b3ddf72 scripted-diff: tests: Use KnapsackSolver directly (Andrew Chow)
6a023a6f90 tests: Add KnapsackGroupOutputs helper function (Andrew Chow)
d5069fc1aa tests: Use SelectCoinsBnB directly instead of AttemptSelection (Andrew Chow)
54de7b4746 Allow the long term feerate to be configured, default of 10 sat/vb (Andrew Chow)

Pull request description:

  Branch and Bound introduced a metric that we call waste. This metric is used as part of bounding the search tree, but it can be generalized to all coin selection solutions, including those with change. As such, this PR introduces the waste metric at a higher level so that we can run both of our coin selection algorithms (BnB and KnapsackSolver) and choose the one which has the least waste. In the event that both find a solution with the same change, we choose the one that spends more inputs.

  Also this PR sets the long term feerate to 10 sat/vb rather than using the 1008 block estimate. This allows the long term feerate to be the feerate that we switch between consolidating and optimizing for fees. This also removes a bug where the long term feerate would incorrectly be set to the fallback fee. While this doesn't matter prior to this PR, it does have an effect following this. The long term feerate can be configured by the user through a new `-consolidatefeerate` option.

ACKs for top commit:
  Xekyo:
    reACK 86beee0 via git range-diff fe47558...86beee0
  meshcollider:
    re-utACK 86beee0579

Tree-SHA512: 54b154b346538eca68ae2a3b83a033b495c1605c14f842bfc43ded2256b110983ce674c647fe753cf0305b1b178403d8d60d6d4203c7a712bec784be52e90d42
2021-09-01 16:59:13 +12:00
..
coinselector_tests.cpp tests: Test GetSelectionWaste 2021-08-27 12:46:17 -04:00
db_tests.cpp Fix build with Boost 1.77.0 2021-08-24 12:49:02 +02:00
init_test_fixture.cpp Fix build with Boost 1.77.0 2021-08-24 12:49:02 +02:00
init_test_fixture.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
init_tests.cpp Change BOOST_CHECK to BOOST_CHECK_EQUAL to see mismatched values when a check fails. 2021-02-09 15:00:02 +01:00
ismine_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
psbt_wallet_tests.cpp Construct and use PrecomputedTransactionData in PSBT signing 2021-06-12 12:25:28 -07:00
scriptpubkeyman_tests.cpp test: Remove no longer needed MakeChain calls 2020-12-07 20:46:03 -05:00
spend_tests.cpp [docs] Add release notes for #21528 2021-08-04 12:36:22 -07:00
util.cpp wallet test refactor: add CreateSyncedWallet function 2021-06-12 11:22:41 -04:00
util.h wallet test refactor: add CreateSyncedWallet function 2021-06-12 11:22:41 -04:00
wallet_crypto_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
wallet_test_fixture.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
wallet_test_fixture.h test: Remove no longer needed MakeChain calls 2020-12-07 20:46:03 -05:00
wallet_tests.cpp Use context.args in CWallet::Create instead of gArgs. 2021-08-24 07:46:52 +02:00
walletdb_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00