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

setconfig: new command to set (a few!) config parameters dynamically #6303

Merged
merged 12 commits into from
Jun 20, 2023

Conversation

rustyrussell
Copy link
Contributor

And handle the config file reasonable intelligently.

@rustyrussell rustyrussell added this to the v23.08 milestone Jun 4, 2023
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

from CI looks like the python test needs some more hammering!

Cloning into '/home/runner/work/lightning/lightning/external/libsodium'...
Cloning into '/home/runner/work/lightning/lightning/external/libwally-core'...
tests/test_misc.py:3462:1: W293 blank line contains whitespace
tests/test_misc.py:3473:1: W293 blank line contains whitespace
tests/test_misc.py:3484:1: W293 blank line contains whitespace
tests/test_misc.py:3491:1: W391 blank line at end of file
make: *** [Makefile:532: check-python-flake8] Error 1

@rustyrussell rustyrussell force-pushed the guilt/setconfig branch 4 times, most recently from 1455418 to 2aa1c08 Compare June 5, 2023 03:27
It mainly clutters up options.c.  The deprecated handling was very tied
to it, so it stays there.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
To test, we do min-capacity-sat which is simple.  We also update the
listconfigs man page which contained some obsolete information.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Previously, if these failed we always exited; once we have dymamic
configs this would be a (tiny) memory leak, so use tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Currently only implemented for min-capacity-sat.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: new command `setconfig` allows a limited number of configuration settings to be changed without restart.
Do it slightly intelligently, so if we had set previously using setconfig
we don't keep appending new ones, but replace it in-place.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
If it's a plugin opt, we'll need a callback, so reshuffle logic.  Also
add infra to map option name to plugin and option.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ct type.

I added a plugin arg and was surprised that compile didn't break.
This is because typesafe_cb et al are conditional casts: if the type
isn't as expected it has no effect, but we're passing plugin_option() through
varargs, so everything is accepted!

Add a noop inline to check type, and fix up the two cases where we
used `const char *` instead of `char *`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Plugins: `autoclean` configuration variables now settable with `setconfig`.
Slightly less trivial: reset timer unless it's currently running callback.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK 961fa3f

Wow, this is just super cool to have. I need to think if this can simplify how a plugin manager can configure a plugin at runtime

@rustyrussell rustyrussell merged commit 2636258 into ElementsProject:master Jun 20, 2023
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.

2 participants