Uh oh!
There was an error while loading. Please reload this page.
[Splicing] Add reserve check to splicing - #3641
Conversation
👋 Hi! This PR is now in draft status. |
Relevant comments from #3407:
Relevant method: |
e34d33c to
6ec1a19Compareoptout21
commented
Mar 4, 2025
6ec1a19 to
8ac1467CompareRebased, post #3407 . |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #3641 +/- ##
==========================================
- Coverage 88.94% 88.93% -0.02%
==========================================
Files 174 174 Lines 124200 124539 +339 Branches 124200 124539 +339 ==========================================
+ Hits 110471 110760 +289 - Misses 11253 11283 +30 - Partials 2476 2496 +20
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:
|
8ac1467 to
b073d8cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ldk-reviews-bot
commented
Mar 11, 2025
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
b073d8c to
f406c53CompareUh oh!
There was an error while loading. Please reload this page.
optout21
commented
Mar 20, 2025
Fixes done:
|
ldk-reviews-bot
commented
Mar 22, 2025
ldk-reviews-bot
commented
Mar 24, 2025
| return Err(post_channel_reserve_sats); | ||
| } | ||
| } else { | ||
| if pre_balance >= self.funding.holder_selected_channel_reserve_satoshis * 1000 { |
There was a problem hiding this comment.
We also need to check if the channel has never been spliced before to use the v1 reserve
There was a problem hiding this comment.
I'm not sure how to do that, I suppose is_v2_established() does not change. @wpaulino
There was a problem hiding this comment.
If self.funding.splice_parent_funding_txid is not set and the channel ID is the same as the funding outpoint, then we use the v1 reserve
| /// Pending HTLCs are not taken into account, this method should be used when there is no such, | ||
| /// e.g. in quiscence state | ||
| #[cfg(splicing)] | ||
| fn compute_balances_less_fees(&self, channel_value_sats: u64, value_to_self_msat: u64, is_local: bool) -> (u64, u64) { |
There was a problem hiding this comment.
@tankyleo is going to split up the existing build_commitment_transaction method into two, so that we can get the balances without building the commitment transaction. Once that lands, we can use it here in favor of this to avoid the code duplication.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
47f4737 to
eb1fc46Compare793e8b7 to
a0fe395CompareUh oh!
There was an error while loading. Please reload this page.
d4a0ffa to
c69a2cbComparec78211b to
858ded0Compareoptout21
commented
Aug 4, 2025
Rebased to recent main (post- #3736 ), more cleanup needed. |
951f14d to
3aab4a1Compare3aab4a1 to
b2d874cCompareTheBlueMatt
commented
Nov 13, 2025
This work was taken as a part of splicing landing in 0.2. 🎉 |
This is a continuation of #3407, adds proper channel balance/reserve check, when handling
splice_ack(on initiator side).