-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate AvailableBalances::balance_msat #3247
Deprecate AvailableBalances::balance_msat #3247
Conversation
c22796d
to
c94c933
Compare
c94c933
to
714c055
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3247 +/- ##
==========================================
+ Coverage 89.71% 89.84% +0.12%
==========================================
Files 125 125
Lines 102801 103009 +208
Branches 102801 103009 +208
==========================================
+ Hits 92226 92545 +319
+ Misses 7865 7754 -111
Partials 2710 2710 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the CI is complaining about something, probably we should relax the check for this deprecated field?
warning: build failed, waiting for other jobs to finish...
error: use of deprecated field `ln::channel_state::ChannelDetails::balance_msat`: use [`ChannelMonitor::get_claimable_balances`] instead
--> lightning/src/routing/router.rs:3605:4
|
3605 | balance_msat: 0,
| ^^^^^^^^^^^^^^^
error: use of deprecated field `ln::channel_state::ChannelDetails::balance_msat`: use [`ChannelMonitor::get_claimable_balances`] instead
--> lightning/src/routing/router.rs:8880:4
|
8880 | balance_msat: 10_000_000_000,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `lightning` due to 7 previous errors
Yip, I'll ignore it for our usage. |
714c055
to
0b2fce6
Compare
lightning/src/ln/channel.rs
Outdated
@@ -80,6 +80,7 @@ pub struct ChannelValueStat { | |||
|
|||
pub struct AvailableBalances { | |||
/// The amount that would go to us if we close the channel, ignoring any on-chain fees. | |||
#[deprecated(since = "0.0.124", note = "use [`ChannelMonitor::get_claimable_balances`] instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to deprecate this, its internal-only and not exported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can deprecate it to avoid new uses internally from creeping in causing us pain to remove this later.
lightning/src/ln/channel.rs
Outdated
@@ -80,6 +80,7 @@ pub struct ChannelValueStat { | |||
|
|||
pub struct AvailableBalances { | |||
/// The amount that would go to us if we close the channel, ignoring any on-chain fees. | |||
#[deprecated(since = "0.0.124", note = "use [`ChannelMonitor::get_claimable_balances`] instead")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can deprecate it to avoid new uses internally from creeping in causing us pain to remove this later.
lightning/src/ln/channel_state.rs
Outdated
@@ -363,6 +369,10 @@ pub struct ChannelDetails { | |||
/// This does not consider any on-chain fees. | |||
/// | |||
/// See also [`ChannelDetails::outbound_capacity_msat`] | |||
#[deprecated( | |||
since = "0.0.124", | |||
note = "use [`ChannelMonitor::get_claimable_balances`] instead" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link to ChainMonitor::get_claimable_balances
instead, since that's more directly usable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after Matt's comment
0b2fce6
to
f21e138
Compare
Latest changesdiff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 0b15151c..731b203f 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -82,3 +82,3 @@ pub struct AvailableBalances {
/// The amount that would go to us if we close the channel, ignoring any on-chain fees.
- #[deprecated(since = "0.0.124", note = "use [`ChannelMonitor::get_claimable_balances`] instead")]
+ #[deprecated(since = "0.0.124", note = "use [`ChainMonitor::get_claimable_balances`] instead")]
pub balance_msat: u64,
diff --git a/lightning/src/ln/channel_state.rs b/lightning/src/ln/channel_state.rs
index f21822cd..7a9bbf9b 100644
--- a/lightning/src/ln/channel_state.rs
+++ b/lightning/src/ln/channel_state.rs
@@ -371,6 +371,3 @@ pub struct ChannelDetails {
/// See also [`ChannelDetails::outbound_capacity_msat`]
- #[deprecated(
- since = "0.0.124",
- note = "use [`ChannelMonitor::get_claimable_balances`] instead"
- )]
+ #[deprecated(since = "0.0.124", note = "use [`ChainMonitor::get_claimable_balances`] instead")]
pub balance_msat: u64,
diff --git a/pending_changelog/3247-deprecate-balance_msat.txt b/pending_changelog/3247-deprecate-balance_msat.txt
index 1f0eebd5..662eb3de 100644
--- a/pending_changelog/3247-deprecate-balance_msat.txt
+++ b/pending_changelog/3247-deprecate-balance_msat.txt
@@ -1 +1 @@
-* The `AvailableBalances::balance_msat` field has been deprecated in favor of `ChannelMonitor::get_claimable_balances`. `AvailableBalances::balance_msat` will be removed in an upcoming release (#3247).
+* The `AvailableBalances::balance_msat` field has been deprecated in favor of `ChainMonitor::get_claimable_balances`. `AvailableBalances::balance_msat` will be removed in an upcoming release (#3247). |
The ChannelMonitor::get_claimable_balances method provides a more straightforward approach to the balance of a channel, which satisfies most use cases. The computation of AvailableBalances::balance_msat is complex and originally had a different purpose that is not applicable anymore. We deprecate AvailableBalances::balance_msat now and will remove it in a following release. Co-authored-by: Willem Van Lint <[email protected]>
76b601e
to
0a1adeb
Compare
The
ChannelMonitor::get_claimable_balances
method provides a more straightforward approach to the balance of a channel, which satisfies most use cases. The computation ofAvailableBalances::balance_msat
is complex and originally had a different purpose that is not applicable anymore. We deprecateAvailableBalances::balance_msat
now and will remove it in a following release by #3243.See #3243 for context/motivation.