Repository navigation
Conversation
aagbotemi
force-pushed
the
feat/lowest-fee-min-change-value
branch
from
December 3, 2026 19:28
28090aa to
efc1871
Compare
aagbotemi
marked this pull request as ready for review
December 3, 2026 21:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
min_change_valuetoLowestFee. Change below it is not created, and the excess goes to fee instead. Use 0 to keep the current behavior.Note to Reviewers
LowestFeehas no way to take a minimum change value. Since #49,LowestFeeno longer accepts aChangePolicy, so callers with a minimum have to apply it after branch and bound returns. That decides change twice, which #49 set out to remove: BnB picks a selection for its change, the caller drops that change, and the excess is paid as fee. bdk-tx hits this in bitcoindevkit/bdk-tx#47, where it drops change belowchange_min_valueafterrun_bnb.The minimum is checked after the spend-cost and dust checks in
drain_value. It can only remove change, never force it, so the proof inboundfor selections with change still holds.For selections without change,
LowestFee::boundassumes a change output costsoutput_weight * feerate. That is not true when the absolute or replacement fee is the binding constraint, so the bound can prune a cheaper selection that has change (#83). This PR makes that easier to hit, since change belowmin_change_valuewidens the window where it applies, so it should land after the fix for #83.Changelog notice
LowestFeetakes amin_change_value: u64. Change below it is not created, and the excess goes to fee. Use 0 to keep the previous behavior.Checklists