Check that funder covers the fee spike buffer multiple after a splice#4433
Check that funder covers the fee spike buffer multiple after a splice#4433tankyleo wants to merge 2 commits intolightningdevkit:mainfrom
Conversation
|
👋 Thanks for assigning @wpaulino as a reviewer! |
9035906 to
1959d52
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4433 +/- ##
==========================================
+ Coverage 85.94% 85.98% +0.04%
==========================================
Files 159 159
Lines 104644 104652 +8
Branches 104644 104652 +8
==========================================
+ Hits 89934 89985 +51
+ Misses 12204 12165 -39
+ Partials 2506 2502 -4
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:
|
| 1 | ||
| }; | ||
|
|
||
| let feerate_per_kw = if !funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() { |
There was a problem hiding this comment.
Shouldn't this be funding.get_channel_type() == ChannelTypeFeatures::only_static_remote_key?
There was a problem hiding this comment.
mentioned offline: only_static_remote_key would not match against only_static_remote_key + scid_privacy channels.
There was a problem hiding this comment.
The zero fee commitments case is quite subtle, can we at least add a comment?
|
👋 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. |
Notably, if a party splices funds into the channel, their new balance must be above the new reserve.
c1b8f14 to
260dcc5
Compare
| 1 | ||
| }; | ||
|
|
||
| let feerate_per_kw = if !funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() { |
There was a problem hiding this comment.
The zero fee commitments case is quite subtle, can we at least add a comment?
lightning/src/ln/splicing_tests.rs
Outdated
| let (preimage_0_to_1_b, _hash_0_to_1, ..) = route_payment(&nodes[0], &[&nodes[1]], 40_000_000); | ||
|
|
||
| // Let the sender of the splice-out first be channel fundee, then the channel funder: | ||
| // 0) Set the channel up such that when the sender requests a splice-out, their balance is equal to their |
There was a problem hiding this comment.
Let's inline these comments throughout the code instead, and move do_clunky_splice_out_dance into a closure here
lightning/src/ln/splicing_tests.rs
Outdated
| matches!(events.pop().unwrap(), Event::DiscardFunding { channel_id: chan_id, .. } if chan_id == channel_id ) | ||
| ); | ||
| assert!( | ||
| matches!(events.pop().unwrap(), Event::SpliceFailed { channel_id: chan_id, .. } if chan_id == channel_id) |
There was a problem hiding this comment.
Use expect_splice_failed_events
| } | ||
|
|
||
| #[cfg(test)] | ||
| fn do_test_splice_pending_htlcs(config: UserConfig) { |
There was a problem hiding this comment.
There's a lot of unnecessary verticality throughout the test, can we clean those up by extracting things into vars when useful?
260dcc5 to
5462ab2
Compare
We do this for HTLCs, so we should also do this for splices. This only applies to channels with non-zero-fee HTLC transactions.
5462ab2 to
f784731
Compare
and