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

Fix missing option names, make [lokid]:rpc required #2055

Merged
merged 3 commits into from
Nov 27, 2022

Conversation

jagerman
Copy link
Member

Three changes:

  1. At some point between 0.9.9 and 0.9.10 we removed the printing of option names when a value doesn't have a default, but this means the config is littered with things like:

        # This option sets the greater foo value.

    with no actual option name printed out when there is no default.

    This fixes it by always printing the option name in such a case, just with an empty value, e.g.:

        # This option sets the greater foo value.
        #big-foo=
  2. This makes the [lokid]:rpc setting required, because we cannot actually start up in service node mode if it is missing. The debs, which do have a sensible default, replace the rpc setting in the generated config in postinst (and broke because the commented-out field was missing, because of the above).

  3. Default and Required don't make sense together, so we now fail to compile if used together. Similarly for Required and Hidden. The test code had a bunch of places that did use them together anyway: the behaviour of Default+Required was to write the uncommented default value into the config file, but we decided a long time ago that empty configs was our default so supporting that doesn't make sense.

At some point between 0.9.9 and 0.9.10 we removed the printing of option
names when a value doesn't have a default, but this means the config is
littered with things like:

    # This option sets the greater foo value.

with no actual option name printed out when there is no default.

This fixes it by always printing the option name in such a case, just
with an empty value, e.g.:

    # This option sets the greater foo value.
    #big-foo=
When running as a service node we can't do anything without a lokid rpc
URL, and we don't necessarily have a good default for it.

This makes it required so that we fail with an appropriate error message
(rather than connect timeouts) if it is not specified.
Default & Required makes no sense: if we have a default it makes no
sense to make it required.  The previous behaviour when this was
specified was to force an (uncommented) value in the config with the
value, but this was only used in the test suite.

Required & Hidden makes no sense either: if it's required to be
specified we definitely don't want to hide it from the generated config
file.

These are now compile-time failures.
@majestrate majestrate merged commit 9edda9f into oxen-io:dev Nov 27, 2022
@jagerman jagerman added this to the 0.9.11 milestone Nov 29, 2022
@kraniet888
Copy link

Hi

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.

3 participants