feat(selector): implement absolute fee targeting strategy#31
Merged
ValuedMammal merged 1 commit intobitcoindevkit:masterfrom Dec 17, 2025
Merged
feat(selector): implement absolute fee targeting strategy#31ValuedMammal merged 1 commit intobitcoindevkit:masterfrom
ValuedMammal merged 1 commit intobitcoindevkit:masterfrom
Conversation
Collaborator
|
Approach ACK ACK b6fc87d |
ValuedMammal
approved these changes
Dec 17, 2025
ValuedMammal
added a commit
that referenced
this pull request
Dec 17, 2025
…hangePolicy` b04db7e refactor(selector): Rename `FeeTarget` to `FeeStrategy` (valued mammal) 33e7a68 example: Rename change_weights to drain_weights (valued mammal) 0cda404 selector!: Remove `SelectorParams::change_weight` (valued mammal) 827cb70 selector!: Swap `ChangePolicyType` for `bdk_coin_select::ChangePolicy` (valued mammal) bfa2bea example: Fix change spend weight (valued mammal) b6fc87d feat(selector): implement absolute fee targeting strategy (Abiodun) Pull request description: ## Description Fix #29 by removing `ChangePolicyType` from `SelectorParams` in favor of `bdk_coin_select::ChangePolicy`. The idea is that this affords maximum flexibility when defining the change policy. Builds on #31 which implements absolute fee targeting. h/t aagbotemi. A test `test_absolute_fee_vs_feerate_target_value` is added that checks the expected `Target` is constructed based on the chosen `FeeStrategy`. ## Changelog ### Added - selector: Added `FeeStrategy` enum which defines the fee target as either a feerate or fee amount. ### Changed **BREAKING** - `SelectorParams::target_feerate` field is changed to `fee_strategy`. - `SelectorParams::change_policy` field is changed to have type `bdk_coin_select::ChangePolicy`. - `SelectorParams::new` is changed to accept the `fee_strategy` and `change_policy` as inputs. ### Removed - `SelectorParams::change_weight` field is removed now that the change weights are represented in the actual change policy. - Removed `SelectorParams::to_cs_change_policy` as the conversion is no longer necessary. - Removed `ChangePolicyType` enum to allow the user to construct the intended `ChangePolicy`. ACKs for top commit: aagbotemi: ACK b04db7e Tree-SHA512: 8c4ca2c80c9bb10381a63f34a2fd18f0e75cea343cc0161439d4eb3e0d3ec8a8f252ea35914151fef5b5b21acbafcd856e1b36d88bd084f003225fe770ce6611
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
This PR Implements
FeeTarget::AbsoluteFeeto allow users to specify exact fee amounts instead of fee rates. This PR fixes bitcoindevkit/coin-select#41Note to the reviewers
The
AbsoluteFeevariant works by adding the fee amount to the target output value sum and setting the fee rate to ZERO.All Submissions: