[Splicing] Add reserve check to splicing
This is a continuation of #3407, adds proper channel balance/reserve check, when handling splice_ack (on initiator side).
👋 Hi! This PR is now in draft status. I'll wait to assign reviewers until you mark it as ready for review. Just convert it out of draft status when you're ready for review!
Relevant comments from #3407:
-
[X]
value_to_self_msatdoesn't include fees and anchor outputs value, to be considered similar to how it's done inbuild_commitment_transactionhttps://github.com/lightningdevkit/rust-lightning/pull/3407#discussion_r1970725164 -
[ ] https://github.com/lightningdevkit/rust-lightning/pull/3407#discussion_r1970522088
-
[X] https://github.com/lightningdevkit/rust-lightning/pull/3407#discussion_r1972029584
Relevant method: check_splice_balances_meet_v2_reserve_requirements
Suggestions implemented; for reserve requirement check, the balance is adjusted with fees and eventual anchor output value (see 6ec1a190bdf3a0dae19964f7b9c9e971434c294c). On hold, waiting for #3407 to land first.
Rebased, post #3407 .
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.93%. Comparing base (1e1d300) to head (b2d874c).
:warning: Report is 753 commits behind head on main.
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
| Flag | Coverage Δ | |
|---|---|---|
| fuzzing | 22.18% <40.00%> (-0.46%) |
:arrow_down: |
| tests | 88.76% <100.00%> (-0.02%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
👋 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.
Fixes done:
- Fix Pre&Post reserve check
- Assert that there are no pending HTLCs
- Move splice reserve checks to FundedChannel, because few other fields are needed (is_v2, reserves from funding)
- Fix Msat-Sat discrepancy in balance/reserve check, which I just noticed
- Handle originally-v1 channel pre-splice reserve specially.
🔔 1st Reminder
Hey @jkczyz @wpaulino! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.
🔔 2nd Reminder
Hey @jkczyz @wpaulino! This PR has been waiting for your review. Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.
Rebased to refresh
Rebased to recent main (post- #3736 ), more cleanup needed.
This work was taken as a part of splicing landing in 0.2. 🎉