-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update ChannelConfig
of open channels
#1050
Conversation
It was a good idea to rename the `user_config` in ecc14ce, because the original name was not very descriptive. But this `UserConfig` is just the LDK config in the context of 10101. So we should call it `ldk_config`.
Calling it `payments.rs` is better since we want to add more tests related to payments through a JIT channel.
In patch 2ddbee0 we mentioned that we wanted to be able to update the `ChannelConfig` for open channels (specifically to be able to update the routing fees charged).
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.
Nice, what parts of the ldk config can we change with that specifically? I guess that will have no impact on the handshake?
@@ -770,6 +771,29 @@ where | |||
settings, | |||
}) | |||
} | |||
|
|||
pub fn update_ldk_settings(&self, ldk_config: UserConfig) { |
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.
🤔 shouldn't we differentiate between public and private channels here? Otherwise we will always have on or the other if that gets executed.
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.
Good question! What this PR adds shouldn't have an effect on whether channels are public or private because that is controlled by ChannelHandshakeConfig::announced_channel
which is not controlled by ChannelConfig
. In general, I'm not sure there is a mechanism to turn a private channel into a public one.
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.
In relation to updating the UserConfig
in general, we already have a default value for announced_channel
for both coordinator and app. In the case of the coordinator we default to public channels and only override this when opening JIT channels in the event handler.
In theory we could change this default value with this API, but that would be weird. It's actually currently impossible to change it via the coordinator settings, which only support updating the forwarding_fee_proportional_millionths
value:
10101/coordinator/src/settings.rs
Lines 99 to 110 in 2e574bf
/// The part of the coordinator settings pertaining to the LDK node. | |
pub fn to_ldk_settings(&self) -> UserConfig { | |
// Since we currently have to keep the coordinator settings in sync with the tests in | |
// `ln-dlc-node`, we let the library define the default settings (which is bad) | |
let mut ldk_config = ln_dlc_node::ldk_coordinator_config(); | |
ldk_config | |
.channel_config | |
.forwarding_fee_proportional_millionths = self.forwarding_fee_proportional_millionths; | |
ldk_config | |
} |
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.
Nice
With this PR the only thing that we are changing is the ability to override the Eventually we might want to use this feature to change other bits.
Yep, it will have no effect. |
Fixes #952.