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

libplugin: show default option values #7306

Merged

Conversation

rustyrussell
Copy link
Contributor

libplugin didn't have a way of showing defaults, which are often informative. This means they don't show up in listconfig (unless actually set) which surprised me.

This fixes that, so you can have an optional routine to show the value when you register a plugin. This means you now see the following new values in listconfig in a default configuration:

  • autoclean-cycle.value_int=3600
  • bitcoin-rpcclienttimeout.value_int=60
  • bitcoin-retry-timeout.value_int=60
  • funder-max-their-funding.value_str=4294967295sat
  • funder-per-channel-min.value_str=10000sat
  • funder-reserve-tank.value_str=0sat
  • funder-fund-probability.value_int=100

1. sql's dev-sqlfilename should be registered as a dev option.
2. bcli's timeout is an integer, not a string.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Serves as an example, but also shows a quirk which we fix in the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This means we can see the values in listconfigs, even if we haven't set
them yet.

In particular, we now see the following:

* autoclean-cycle.value_int=3600
* bitcoin-rpcclienttimeout.value_int=60
* bitcoin-retry-timeout.value_int=60
* funder-max-their-funding.value_str=4294967295sat
* funder-per-channel-min.value_str=10000sat
* funder-reserve-tank.value_str=0sat
* funder-fund-probability.value_int=100

Changelog-Changed: plugins: libplugin now shows plugin option default values (where they're non-trivial)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the v24.05 milestone May 14, 2024
struct amount_sat *sats)
{
/* We do not expose raw numbers for sats fields: raw numbers
* in our interface means MSAT! */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good call. It's one thing for the user to set these parameters in the config, but another thing to consume them here. It might be nice if we could enforce a suffix/formatting on non-default configs as well.

Copy link
Collaborator

@endothermicdev endothermicdev left a comment

Choose a reason for hiding this comment

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

Nice changes. I didn't realize these weren't already populated.
ACK 7cba9f5

@endothermicdev endothermicdev merged commit 757e6f8 into ElementsProject:master May 15, 2024
35 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.

None yet

2 participants