Skip to content

Conversation

murchandamus
Copy link
Contributor

@murchandamus murchandamus commented Dec 1, 2023

Fixes a bunch of issues around tests for coinselection, and disables changeless solutions when building transactions with SFFO.

Depends on #28994

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 1, 2023

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

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:

  • #29206 (test: Add algo assert to bnb_search_test by yancyribbens)
  • #28977 (Add Gutter Guard Selector by murchandamus)
  • #28366 (Fix waste calculation in SelectionResult by murchandamus)
  • #27877 (wallet: Add CoinGrinder coin selection algorithm by murchandamus)

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.

@murchandamus
Copy link
Contributor Author

Rebased on top of #28994

achow101 added a commit that referenced this pull request Dec 12, 2023
576bee8 fuzz: disable BnB when SFFO is enabled (furszy)
05e5ff1 test: add coverage for BnB-SFFO restriction (furszy)
0c57557 wallet: create tx, log resulting coin selection info (furszy)
5cea25b wallet: skip BnB when SFFO is active (Murch)

Pull request description:

  Solves #28918. Coming from #28918 (comment) discussion.

  The intention is to decouple only the bugfix relevant commits from #28985, allowing them to be included in the 26.x release. This way, we can avoid disabling the coin selection fuzzing test for an entire release.

  Note:
  Have introduced few changes to the bug fix commit so that the unit tests pass without the additional burden introduced in #28985.

ACKs for top commit:
  josibake:
    ACK 576bee8
  murchandamus:
    ACK 576bee8
  achow101:
    ACK 576bee8

Tree-SHA512: f5d90eb3f3f524265afe4719495c9bf30f98b9af26cf039f7df5a7db977abae72caa7a3478cdd0ab10cd143bc1662e8fc5286b5bc10fc10f0dd582a45b45c31a
@murchandamus murchandamus force-pushed the 2023-11-no-changeless-sffo branch from 5b8c165 to ad7e31c Compare December 12, 2023 16:47
@murchandamus murchandamus force-pushed the 2023-11-no-changeless-sffo branch from ad7e31c to 832a384 Compare December 14, 2023 21:22
Originally these tests verified that at a SelectCoins level the solution
with fewer inputs gets preferred at high feerates, and the solution with
more inputs gets preferred at low feerates. This actually relies on the
behavior of BnB, so these tests are moved to the BnB tests.

Originally these tests relied on SFFO to work.
- Testing that negative effective value filters a UTXO is a behavior of
  AvailableCoins and has nothing to do with BnB
- Combining Preset inputs with additional inputs resulting from coin
  selection algorithms is a SelectCoins-level behavior and has nothing
  to do with BnB
Also removes `bnb_search_tests` from coinselector_tests altogether
The behavior of test_22670 needed to be amended as we no longer are
searching for changeless solutions with knapsack on SFFO and thus the
trick to calculating the fee for the change output no longer worked.
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 9, 2024

🐙 This pull request conflicts with the target branch and needs rebase.

@murchandamus murchandamus mentioned this pull request Mar 1, 2024
@DrahtBot
Copy link
Contributor

DrahtBot commented May 8, 2024

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose 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.

@murchandamus
Copy link
Contributor Author

Closed in favor of #29532 and #28366

achow101 added a commit that referenced this pull request May 6, 2025
85368aa test: Run simple tests at various feerates (Murch)
d610951 test: Recreate BnB iteration exhaustion test (Murch)
2a1b275 test: Remove redundant repeated test (Murch)
4781f5c test: Recreate simple BnB failure tests (Murch)
a94030a test: Recreate BnB clone skipping test (Murch)
7db6f01 test: Move BnB feerate sensitivity tests (Murch)
2bafc46 test: Recreate simple BnB success tests (Murch)

Pull request description:

  This PR is splitting off some of the improvements made in #28985 and starts addressing the issues raised in #27754.

  I aim to completely replace `coinselector_tests` with `coinselection_tests`. The goal is to generally use coins created per a nominal _effective value_ so we can get away from testing with `CoinSelectionParams` that are non-representative and effectuate counterintuitive behavior such as `feerate = 0` or `cost_of_change = 0`

ACKs for top commit:
  achow101:
    ACK 85368aa
  monlovesmango:
    ACK 85368aa
  w0xlt:
    ACK 85368aa

Tree-SHA512: 1a984837b4efddc0d8abe11668898fb207fb539e784bf911d4038211274b82e0fe1f8fffe7e5a19e0e013ccb7dc40e3f62d853a2a729980d0d935e66f12b9156
@bitcoin bitcoin locked and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants