Skip to content

Conversation

TheBlueMatt
Copy link
Collaborator

Fixes #2420

In the next commit we'll add the ability to update the default
configuration used for new channels and which controls some global
decisions in the `ChannelManager`. However, first, we have to put
it behind a mutex so that it can be updated at runtime, which we do
here.

We also take this opportunity to rename `default_configuration` to
simply `config`, since it has been more than only the default
configuration for new channels for some time.
The `UserConfig` is used to set the default configuration on new
channels and also controls some global behavior in
`ChannelManager`, so should probably be updatable without
restarting the node. Here we add such a method.

We also take this opportunity to rename the `UserConfig` related
methods and update their docs since `UserConfig` has been more than
just the default configuration for new channels for some time.

Fixes lightningdevkit#2420
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Aug 31, 2025

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot ldk-reviews-bot requested a review from tnull August 31, 2025 00:43
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

❌ Patch coverage is 91.02564% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.73%. Comparing base (bbfc694) to head (72fa184).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 89.70% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4038      +/-   ##
==========================================
- Coverage   88.74%   88.73%   -0.02%     
==========================================
  Files         176      176              
  Lines      129012   129039      +27     
  Branches   129012   129039      +27     
==========================================
+ Hits       114491   114500       +9     
- Misses      11926    11941      +15     
- Partials     2595     2598       +3     
Flag Coverage Δ
fuzzing 21.91% <34.24%> (+0.01%) ⬆️
tests 88.56% <89.74%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Hmm, I somehow had remembered that this wasn't as trival as some config values couldn't be changed during runtime without exposing risky behavior. However, given that I can't fully recall what this was about, and that I couldn't pinpoint any cases in the code, it probably means I was misremembering or they are gone by now.

Changes themselves look straightforward, so landing this for now.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@tnull tnull merged commit 5b6b691 into lightningdevkit:main Sep 1, 2025
25 checks passed
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.

Allow changing ChannelManager::default_configuration at runtime
3 participants