refactor: fuzz: remove cost_of_change from coin-grinder fuzz target #36071

pull yancyribbens wants to merge 1 commits into bitcoin:master from yancyribbens:0824-remove-cost-of-change-from-cg-fuzzer changing 1 files +0 −1
  1. yancyribbens commented at 6:32 PM on August 24, 2026: contributor

    coin-grinder selection algorithm does not take cost_of_change as a parameter.

    CoinGrinder doesn’t use coin_params.m_cost_of_change and the comparison of selection results from CoinGrinder, SRD, and Knapsack does not need it either as only the weight of the selections is relevant. So, line 96 in that fuzz test is both incorrect and dead code. It should be removed.

    cite: stackexchange

    verified coin_grinder fuzz target still works after removal

  2. refactor: fuzz: remove cost_of_change from coin-grinder fuzz target
    coin-grinder selection algorithm does not take cost_of_change as a
    parameter.
    5ec6446a1b
  3. DrahtBot added the label Refactoring on Aug 24, 2026
  4. DrahtBot commented at 6:33 PM on August 24, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK brunoerg, frankomosh

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. yancyribbens commented at 6:33 PM on August 24, 2026: contributor
  6. brunoerg approved
  7. brunoerg commented at 5:43 PM on August 25, 2026: contributor

    ACK 5ec6446a1b83e673a51d9e86fa4c0c0e9930fccc

    m_cost_of_change isn't used for anything of coin-grinder, it's a no-op in the target and it's fine to remove it.

  8. in src/wallet/test/fuzz/coinselection.cpp:227 in 5ec6446a1b


    frankomosh commented at 11:31 AM on September 28, 2026:

    Isn't this sort of a duplicate and should be removed also?


    yancyribbens commented at 4:14 PM on October 22, 2026:

    My proposed change is for coin-grinder which does not use a cost_of_change parameter. This parameter here is in the bnb fuzz_target, so I would not believe it to be here in error.


    frankomosh commented at 4:51 PM on October 29, 2026:

    Sorry, my question wasn’t clear. Yes, the bnb target needs m_cost_of_change. I only meant this one line: its value is replaced on L233 before anything reads it. Was flagged a while back if I am not wrong (https://github.com/bitcoin/bitcoin/pull/32894#discussion_r2201745084).

    However its not blocking, and I guess its probably fine to leave as is, here.


    yancyribbens commented at 9:54 PM on October 29, 2026:

    Oh, I see what you mean now. Yeah, that looks like another oversight but unrelated to this PR. Hmm, it would be pretty easy to write a tool or use a tool to find re-assignments like this. Anyway, thanks for the ACK on this PR, its probably best to leave it as is since its so difficult to get some ACKs around here!

  9. frankomosh commented at 11:32 AM on September 28, 2026: contributor

    Concept ACK

  10. yancyribbens commented at 4:00 PM on October 29, 2026: contributor

    @frankomosh still seeking ACK

  11. frankomosh commented at 4:52 PM on October 29, 2026: contributor

    ACK 5ec6446a1b83e673a51d9e86fa4c0c0e9930fccc


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: 2026-10-30 09:40 UTC