-
Notifications
You must be signed in to change notification settings - Fork 137
Drop max_inbound_htlc_value_in_flight_percent_of_channel
#878
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
Draft
jkczyz
wants to merge
4
commits into
lightningdevkit:main
Choose a base branch
from
jkczyz:2026-04-lsp-max-in-flight
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ab0aa16
Adapt to lightning-block-sync API changes
jkczyz 2ab93c1
Expose a bindings-compatible BestBlock
jkczyz 4fda093
Drop max_inbound_htlc_value_in_flight_percent_of_channel
jkczyz 20bae9a
f - Assert unannounced-channel default stays at 100%
jkczyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,7 @@ use lightning::ln::channelmanager::{PaymentId, TrustedChannelFeatures}; | |
| use lightning::ln::types::ChannelId; | ||
| use lightning::routing::gossip::NodeId; | ||
| use lightning::sign::EntropySource; | ||
| use lightning::util::config::{ | ||
| ChannelConfigOverrides, ChannelConfigUpdate, ChannelHandshakeConfigUpdate, | ||
| }; | ||
| use lightning::util::config::{ChannelConfigOverrides, ChannelConfigUpdate}; | ||
| use lightning::util::errors::APIError; | ||
| use lightning::util::persist::KVStore; | ||
| use lightning::util::ser::{Readable, ReadableArgs, Writeable, Writer}; | ||
|
|
@@ -1273,20 +1271,24 @@ where | |
| if lsp_node_id == counterparty_node_id { | ||
| // When we're an LSPS2 client, allow claiming underpaying HTLCs as the LSP will skim off some fee. We'll | ||
| // check that they don't take too much before claiming. | ||
| // | ||
| // We also set maximum allowed inbound HTLC value in flight | ||
| // to 100%. We should eventually be able to set this on a per-channel basis, but for | ||
| // now we just bump the default for all channels. | ||
| channel_override_config = Some(ChannelConfigOverrides { | ||
| handshake_overrides: Some(ChannelHandshakeConfigUpdate { | ||
| max_inbound_htlc_value_in_flight_percent_of_channel: Some(100), | ||
| ..Default::default() | ||
| }), | ||
| update_overrides: Some(ChannelConfigUpdate { | ||
| accept_underpaying_htlcs: Some(true), | ||
| ..Default::default() | ||
| }), | ||
| ..Default::default() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: as elsewhere, maybe a quick |
||
| }); | ||
|
|
||
| // LSPS2 channels are unannounced; rely on LDK's default of 100% | ||
| // inbound HTLC value-in-flight so the LSP can forward the initial | ||
| // payment in full. | ||
| debug_assert_eq!( | ||
| self.channel_manager | ||
| .get_current_config() | ||
| .channel_handshake_config | ||
| .unannounced_channel_max_inbound_htlc_value_in_flight_percentage, | ||
| 100 | ||
| ); | ||
| } | ||
| } | ||
| let res = if allow_0conf { | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To confirm here I don't think setting 100% here would have helped as that maximum only applies to the inbound HTLCs on that channel. To make sure that 100% of the value can be allocated to outbound HTLCs from the LSP's perspective as the comment describes, the user needs to set their
max_inboundto 100%.So seems to me the intention of the code did not match the comment ?
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... yeah it does seem that way.