Skip to content
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

Merged
merged 3 commits into from
Aug 2, 2023

Conversation

luckysori
Copy link
Contributor

Fixes #952.

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).
@luckysori luckysori self-assigned this Aug 2, 2023
@luckysori luckysori linked an issue Aug 2, 2023 that may be closed by this pull request
Copy link
Contributor

@holzeis holzeis left a 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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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:

/// 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
}

Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@luckysori
Copy link
Contributor Author

luckysori commented Aug 2, 2023

Nice, what parts of the ldk config can we change with that specifically?

With this PR the only thing that we are changing is the ability to override the ChannelConfig for open channels. Since this feature is only used by the coordinator and the coordinator currently only cares about updating the proportional routing fees, that's all that we can do.

Eventually we might want to use this feature to change other bits.

I guess that will have no impact on the handshake?

Yep, it will have no effect.

Base automatically changed from fix/dprint-rustfmt-nightly to main August 2, 2023 09:57
@luckysori luckysori added this pull request to the merge queue Aug 2, 2023
Merged via the queue into main with commit e9dfc4a Aug 2, 2023
7 checks passed
@luckysori luckysori deleted the feat/reconfigure-channels-after-update branch August 2, 2023 10:10
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.

Update proportional routing fee for existing channels
3 participants