Expose current dust exposure in ChannelDetails#4470
Open
Bortlesboat wants to merge 1 commit intolightningdevkit:mainfrom
Open
Expose current dust exposure in ChannelDetails#4470Bortlesboat wants to merge 1 commit intolightningdevkit:mainfrom
Bortlesboat wants to merge 1 commit intolightningdevkit:mainfrom
Conversation
|
👋 Thanks for assigning @tankyleo as a reviewer! |
06585ba to
c571ad4
Compare
Add current_dust_exposure_msat field to ChannelDetails that surfaces the total dust exposure including both dust HTLC values and the commitment transaction fee component. This is the maximum of the holder and counterparty commitment transaction dust exposures. Users can compare this value against max_dust_htlc_exposure in ChannelConfig to understand how close a channel is to its dust exposure limit without needing internal channel access. Fixes lightningdevkit#2264
c571ad4 to
4f9b1e5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4470 +/- ##
==========================================
+ Coverage 85.98% 86.01% +0.02%
==========================================
Files 159 159
Lines 105415 105424 +9
Branches 105415 105424 +9
==========================================
+ Hits 90643 90679 +36
+ Misses 12255 12235 -20
+ Partials 2517 2510 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🔔 1st Reminder Hey @tankyleo! This PR has been waiting for your review. |
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.
Summary
Adds a
current_dust_exposure_msatfield toChannelDetailsthat surfaces the current total dust exposure on a channel.ChannelConfig::max_dust_htlc_exposureto monitor how close a channel is to its dust limitOption<u64>,Nonefor objects serialized prior to 0.2.1Implementation
dust_exposure_msattoAvailableBalances— computed asmax(local_dust_exposure_msat, remote_dust_exposure_msat)inget_available_balances(tx_builder.rs)current_dust_exposure_msat: Option<u64>toChannelDetailsstruct, populated from the balance computation infrom_channelFixes #2264