-
Notifications
You must be signed in to change notification settings - Fork 906
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
setconfig: new command to set (a few!) config parameters dynamically #6303
Conversation
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.
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
1455418
to
2aa1c08
Compare
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>
2aa1c08
to
961fa3f
Compare
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.
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
And handle the config file reasonable intelligently.