Repository navigation
fix(wallet): include fees when selecting inactive proofs - #2564
Merged
Merged
Conversation
j-kon
approved these changes
Sep 21, 2026
j-kon
left a comment
Contributor
There was a problem hiding this comment.
Findings
- No critical, warning, or nit-level issues found.
- Corrects an early return in
select_proofswhere inactive proofs bypassedinclude_fees: true, leading to insufficient fund calculations when keysets were rotated. - Appropriately routes selected inactive proofs through
Self::include_fees. - Added comprehensive test coverage in
inactive_fee_tests.rsverifying fee coverage, shortfall handling with active proofs, and derivation index age preference.
- Corrects an early return in
Summary
Reviewed proof selection logic in crates/cdk/src/wallet/proofs.rs and the new test suite in crates/cdk/src/wallet/proofs/inactive_fee_tests.rs. The fix correctly ensures fee requirements are fulfilled when spending inactive keyset proofs.
Verdict
APPROVE
Collaborator
|
@cdk-bot review |
cdk-bot
reviewed
Sep 22, 2026
cdk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Verified findings approved for disclosure:
- Fee top-up on inactive-proofs branch never reconsiders equal-nominal lower-fee subsets, causing avoidable over-selection (low) - see inline comment
Unanchored locations included in summary:- crates/cdk/src/wallet/proofs.rs:318
thesimplekid
force-pushed
the
fix/inactive-proof-fees
branch
from
September 22, 2026 19:24
88469ae to
b7cb458
Compare
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
When inactive-keyset proofs cover the requested amount before fees, selection returns early without honoring
include_fees. An 8-sat proof at 500 ppk leaves only 7 sats after redemption. Apply the existing fee-coverage helper while retaining keyset and coin-age preferences.Notes to the reviewers
Four regressions fail before the fix; all 51 proof-selection tests pass afterward, including fee opt-out and age ordering. Targeted Clippy, formatting and whitespace checks pass. Independent of #2499; no public API or database changes.
Full
just quick-checkpasses on the current PR head (88469ae6) with Rust 1.98.0,nixpkgs-fmt1.3.0 andtypos1.46.3. Changed Rust files also pass the repository’s nightly rustfmt import rules.Suggested CHANGELOG Updates
FIXED
Checklist
just quick-checkon the current PR head.