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
Changing maximum htlc value based on channel being public #2980
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for looking into this!
Hmm, I don't think we should adjust get_holder_htlc_maximum_msat
. Rather, we'd likely want to adjust get_announced_htlc_max
to return 10% of capacity or so when the channel is announced, and the currently used 95% otherwise.
Also, if you do this, can you add a test asserting that your change results in the expected behavior?
After some offline discussion with @TheBlueMatt we arrived at the conclusion that we should limit both the That is, the changes likely need to happen in |
Hii, In the issue comment you said we have to limit actual |
Yes, but as mentioned above, after some offline discussion we concluded that we want to limit both. However, #2851 pertains the
No, I don't think this is correct. Limiting in |
Ok ,
I have a doubt here, that |
I'm not quite following your question? As mentioend above, these are two separate issues, for now we should only make sure the |
yes i got that, My question was rust-lightning/lightning/src/ln/channel.rs Line 3464 in 2c0fcf2
|
Ah, no, I think it likely should stay where it's at as we're also using it in |
I have updated the changes in |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2980 +/- ##
==========================================
+ Coverage 89.39% 90.82% +1.42%
==========================================
Files 117 118 +1
Lines 95514 113356 +17842
Branches 95514 113356 +17842
==========================================
+ Hits 85389 102951 +17562
- Misses 7903 8260 +357
+ Partials 2222 2145 -77 ☔ View full report in Codecov by Sentry. |
@@ -3470,7 +3470,11 @@ fn get_holder_max_htlc_value_in_flight_msat(channel_value_satoshis: u64, config: | |||
} else { | |||
config.max_inbound_htlc_value_in_flight_percent_of_channel as u64 | |||
}; | |||
channel_value_satoshis * 10 * configured_percent | |||
if config.announced_channel{ |
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.
Hmm, we can't totally ignore the config value for private channels - outside of being useful for privacy the max-in-flight number is useful to limit exposure to loss when closing with a watchtower, etc. I'm not quite sure what the right API is, maybe we make it an Option
to let the default differ based on the channel being public?
This Pr solves issue #2851