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

Configuration values that are stored as maps in configuration files are merged, not overwritten. #1434

Closed
sstone opened this issue May 25, 2020 · 1 comment

Comments

@sstone
Copy link
Member

sstone commented May 25, 2020

Features are represented as a map in our configuration files, which means that the corresponding configuration object defined in application.conf does not overwrite the "base" definition found in reference.conf, as it would if it was a string or number, but is merged with it (see https://github.com/lightbend/config/blob/c17d58e09af11f9e2a9ddae2eccca18f5f0f01f6/HOCON.md#duplicate-keys-and-object-merging).

With the following configuration files:

reference.conf:
  features {
    initial_routing_sync = optional
    option_data_loss_protect = optional
    gossip_queries = optional
    gossip_queries_ex = optional
    var_onion_optin = optional
  }

application.conf:
  features {
    option_data_loss_protect = mandatory
    var_onion_optin = optional
    payment_secret = optional
    basic_mpp = optional
  }

The final configuration, as read by the application, will be equivalent to:

  features {
    initial_routing_sync = optional
    option_data_loss_protect = mandatory
    gossip_queries = optional
    gossip_queries_ex = optional
    var_onion_optin = optional
    payment_secret = optional
    basic_mpp = optional
  }

There are several potential fixes:

  • configuration keys that are represented by maps could be removed from eclair-core's reference.conf file, so there's nothing to merge with.
  • a null value could be inserted in application,.conf to discard values defined in reference.conf:
application.conf:

  features : null
  features {
    option_data_loss_protect = mandatory
    var_onion_optin = optional
    payment_secret = optional
    basic_mpp = optional
  }
  • or we could use an another representation for map-like fields such as Features
@t-bast
Copy link
Member

t-bast commented Jul 27, 2020

Fixed by #1435

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

No branches or pull requests

3 participants