Skip to content

Drop non-anchor channel fee upper bound limit entirely #2696

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

Quite a while ago we added checks for the total current dust exposure on a channel to explicitly limit dust inflation attacks. When we did this, we kept the existing upper bound on the channel's feerate in place. However, these two things are redundant - the point of the feerate upper bound is to prevent dust inflation, and it does so in a crude way that can cause spurious force-closures.

Here we simply drop the upper bound entirely, relying on the dust inflation limit to prevent dust inflation instead.

@wpaulino
Copy link
Contributor

When we did this, we kept the existing upper bound on the channel's feerate in place.

We kept it but increased it from 2x to 10x (see d3af49e). Do you recall why the bump was done then? I agree that it is redundant.

@TheBlueMatt
Copy link
Collaborator Author

I think we just didn't think it through at the time, or maybe as a sanity check?

@wpaulino
Copy link
Contributor

LGTM but CI is failing

@TheBlueMatt TheBlueMatt force-pushed the 2023-10-no-chan-feerate-upper-bound branch from c332a79 to c60947b Compare November 1, 2023 02:45
@TheBlueMatt
Copy link
Collaborator Author

Fixed.

@wpaulino
Copy link
Contributor

wpaulino commented Nov 1, 2023

The fuzz build failed now:

thread 'full_stack::tests::test_no_existing_test_breakage' panicked at 'assertion failed: `(left == right)`
  left: `None`,
 right: `Some(1)`', src/full_stack.rs:1040:9

@TheBlueMatt TheBlueMatt force-pushed the 2023-10-no-chan-feerate-upper-bound branch from c60947b to 40953be Compare November 1, 2023 22:35
@TheBlueMatt
Copy link
Collaborator Author

Grrrrr, fixed.

@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b6f3d0a) 88.79% compared to head (d30d599) 89.83%.
Report is 33 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2696      +/-   ##
==========================================
+ Coverage   88.79%   89.83%   +1.04%     
==========================================
  Files         112      113       +1     
  Lines       88502    94464    +5962     
  Branches    88502    94464    +5962     
==========================================
+ Hits        78581    84862    +6281     
+ Misses       7690     7377     -313     
+ Partials     2231     2225       -6     
Files Coverage Δ
lightning/src/chain/chaininterface.rs 97.14% <ø> (ø)
lightning/src/ln/channel.rs 93.62% <100.00%> (+5.22%) ⬆️
lightning/src/util/test_utils.rs 77.14% <100.00%> (-0.06%) ⬇️

... and 23 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

wpaulino
wpaulino previously approved these changes Nov 1, 2023
Quite a while ago we added checks for the total current dust
exposure on a channel to explicitly limit dust inflation attacks.
When we did this, we kept the existing upper bound on the channel's
feerate in place. However, these two things are redundant - the
point of the feerate upper bound is to prevent dust inflation, and
it does so in a crude way that can cause spurious force-closures.

Here we simply drop the upper bound entirely, relying on the dust
inflation limit to prevent dust inflation instead.
@TheBlueMatt
Copy link
Collaborator Author

Fix new warnings

$ git diff-tree -U1 40953beb d30d599a
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 81a4cb9f4..3606b04e6 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -7669,3 +7669,3 @@ mod tests {
 	use crate::ln::channel::InitFeatures;
-	use crate::ln::channel::{Channel, ChannelState, InboundHTLCOutput, OutboundV1Channel, InboundV1Channel, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator, commit_tx_fee_msat};
+	use crate::ln::channel::{ChannelState, InboundHTLCOutput, OutboundV1Channel, InboundV1Channel, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator, commit_tx_fee_msat};
 	use crate::ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS, MIN_THEIR_CHAN_RESERVE_SATOSHIS};
diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs
index 3ca26d529..337dfc063 100644
--- a/lightning/src/util/test_utils.rs
+++ b/lightning/src/util/test_utils.rs
@@ -96,3 +96,3 @@ pub struct TestFeeEstimator {
 impl chaininterface::FeeEstimator for TestFeeEstimator {
-	fn get_est_sat_per_1000_weight(&self, confirmation_target: ConfirmationTarget) -> u32 {
+	fn get_est_sat_per_1000_weight(&self, _confirmation_target: ConfirmationTarget) -> u32 {
 		*self.sat_per_kw.lock().unwrap()
$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants