- Breaking:
BnbMetric'sscore,bound, anddraintake thetarget: Targetas a parameter, andCoinSelector::run_bnb/bnb_solutionsgain a leadingtargetargument. ConsequentlyLowestFeeandChangelessno longer store atargetfield. This removes the target thatChangeless<M>previously had to keep in sync with its inner metric, and aligns the metric API with the rest ofCoinSelector, wheretargetis always passed in. - Breaking:
BnbMetricmetrics now decide the change output themselves. The trait gains adrain(&mut self, cs) -> Drainmethod; call it on a branch-and-bound solution (or theLowestFeemetric directly) to get the change output the metric optimized against, instead of computing a separateChangePolicy. - Breaking:
CoinSelector::run_bnbnow returns(Ordf32, Drain)instead of justOrdf32, handing back the change output the metric decided on for the winning selection. - Breaking:
LowestFeeno longer takes achange_policy. It now takesdust_relay_feerate: FeeRateanddrain_weights: DrainWeights, and adds change only when doing so lowers the long-term fee and the change would not be dust. - Add
DrainWeights::dust_threshold(dust_relay_feerate), the minimum value a change output with these weights must have to not be dust. - Add
CoinSelector::select_srd, a Single Random Draw selector (port of Bitcoin Core'sSelectCoinsSRD) that adds candidates in random order until the change reacheschange_lower, producing a healthy-sized (privacy-friendly) change output instead of minimizing fees. Adds theCHANGE_LOWERconstant for Core's value. - Breaking:
Changelessis nowChangeless<M>, wrapping an inner metric it constrains to changeless solutions (e.g.Changeless<LowestFee>), replacing the previous tuple-composition approach. - Breaking: Removed the
BnbMetrictuple implementations (impl BnbMetric for ((A, f32), ...)). Weighted composition of independent metrics is no longer supported; the only composition still provided is the changeless constraint, now expressed asChangeless<M>. If you relied on tuples to blend multiple objectives, there is no drop-in replacement. - Breaking:
CoinSelector::selected_indicesandCoinSelector::bannednow return&Bitsetinstead of&BTreeSet<usize>.Bitsetexposescontains/len/is_empty/iter(#46) - Replace the internal
Cow<BTreeSet>/Cow<[usize]>selection state with aBitsetand anArc-shared candidate order, making the per-branch clones in branch-and-bound substantially cheaper (#46) - Fix compilation error when building with
--no-default-features(#36)
- Use
u64for weights instead of u32 - Fix feerate not being rounded up to vbytes #29
- Fix
new_tr_keyspendweight
- Remove
is_target_met_with_change_policy: it was redundant. If the target is met without a change policy it will always be met with it. - Remove
min_feein favour ofreplacewhich allows you to replace a transaction - Remove
Drainargument fromCoinSelector::select_until_target_metbecause adding a drain won't change when the target is met. - No more
base_weightinCoinSelector. Weight of the outputs is tracked intarget. - You now account for the number of outputs in both drain and target and their weight.
- Removed waste metric because it was pretty broken and took a lot to maintain