Skip to content

chore: drop dashcore::FeeRate - #482

Merged
xdustinface merged 1 commit into
v0.42-devfrom
refactor/drop-dashcore-feerate
Mar 3, 2026
Merged

xdustinface merged 1 commit into
v0.42-devfrom
refactor/drop-dashcore-feerate

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Feb 27, 2026 •

Copy link
Copy Markdown
Collaborator

We already have the FeeRate struct in KeyWallet, there is no point in maintaining twice the same struct

Summary by CodeRabbit

Release Notes

  • Breaking Changes
    • The FeeRate type and its associated public API have been removed, including all constants, constructors, and conversion methods. Code depending on FeeRate will require updates.

@coderabbitai

coderabbitai Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR removes the entire FeeRate type from the public API by deleting the fee_rate module file and all associated re-exports from the blockdata and library root modules, resulting in a breaking change to the codebase's public interface.

Changes

Cohort / File(s) Summary
FeeRate Module Removal
dash/src/blockdata/fee_rate.rs
Deleted entire module containing FeeRate struct, constants (ZERO, MIN, MAX, BROADCAST_MIN, DUST), constructors, accessors, arithmetic operations (checked_mul, checked_div), trait implementations (Display, From, Mul, Div), and parsing support (202 lines removed).
Public API Re-export Cleanup
dash/src/blockdata/mod.rs, dash/src/lib.rs
Removed module declaration and public re-exports of FeeRate from blockdata and library root, eliminating the type from the public API surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Farewell, dear FeeRate, you've hopped away,
No more sat-per-kwu calculations here to stay,
The module's cleared, the types are gone,
A lighter codebase hops along! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'chore: drop dashcore::FeeRate' directly and clearly summarizes the main change: removing the FeeRate type from the dashcore library to avoid duplication with KeyWallet's implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/drop-dashcore-feerate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@xdustinface xdustinface left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree we shouldn't double keep FeeRate but i think it should still live in dash crate not key-wallet as dash is where the core primitives live and so other crates like rpc-client will still be able to use it without depending on key-wallet. I think you should move the one from key-wallet into dash.

@ZocoLini

ZocoLini commented Mar 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

I strongly disagree.

  • Currently FeeRate is only being used in TransactionBuilder (defined in key-wallet).
  • At the same time TransactionBuilder needs UTXOs, UTXOs are also defined in key-wallet
  • FeeRate doesn't have any value by itself, the only reason to use it is inside TransactionBuilder

It makes more sense to have all those pieces together in dashcore than in key-wallet but that is not the way is designed right now. After i finish fixing the transaction building logic and coin selection I would agree in moving everything into dashcore (my rewrite/fix is moving that stuff into the same module so it will be easy to move it after)

@ZocoLini
ZocoLini requested a review from xdustinface March 3, 2026 15:29
@xdustinface xdustinface changed the title refactor(key-wallet): drop dashcore::FeeRate chore: drop dashcore::FeeRate Mar 3, 2026
@xdustinface
xdustinface merged commit 7615066 into v0.42-dev Mar 3, 2026
51 checks passed
@ZocoLini
ZocoLini deleted the refactor/drop-dashcore-feerate branch July 31, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants