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

[Feature]: app config setting overwrite #19257

Closed
p0mvn opened this issue Jan 26, 2024 · 5 comments
Closed

[Feature]: app config setting overwrite #19257

p0mvn opened this issue Jan 26, 2024 · 5 comments

Comments

@p0mvn
Copy link
Member

p0mvn commented Jan 26, 2024

Summary

We repeatedly have a use case where it is useful to overwrite config values in a new patch based on a certain value.

However, there is no good UX for doing so.

Here is an example of how we worked around the issue by simply string-matching the config values. It would be nice to have a more intuitive way of achieving this.

Problem Definition

No response

Proposed Feature

  • Expose API for overwriting specific app.toml and config.toml values during start command.
  • Ensure that comments and general config file structure is preserved
  • Ensure that other config values are not overridden with defaults
  • Make it generalized and capable of working with many types
@tac0turtle
Copy link
Member

Hey this is already possible, when reading the config you would override the value set there with what you expect. It looks like this is meant to hardcode a value. Evmos and other teams do this already

@p0mvn
Copy link
Member Author

p0mvn commented Jan 29, 2024

Is there documentation on how to do this?

On our v0.47 SDK, I've run into multiple issues. For example, some existing SDK helpers would overwrite and reset other config values.

I spent considerable effort figuring out how to do this using SDK APIs but concluded that custom logic is the most viable path.

It seems that more folks have experienced similar issues.

@julienrbrt
Copy link
Member

julienrbrt commented Jan 29, 2024

I believe it is only currently possible at config initialization (f.e. to set chain defaults: https://github.com/cosmos/cosmos-sdk/blob/8f0d5b1/simapp/simd/cmd/config.go).
I don't think there is an easy way / api to update existing values, once the config exists, after a binary upgrade, for instance.

@julienrbrt
Copy link
Member

julienrbrt commented Jan 29, 2024

One solution would be to import confix and use one of its command (https://github.com/cosmos/cosmos-sdk/blob/753ac5d/tools/confix/cmd/mutate.go#L21) to update the value. IMHO this would look nicer than osmosis-labs/osmosis#7368.

@tac0turtle
Copy link
Member

closing this as there are a few answers, thanks Julien

@github-project-automation github-project-automation bot moved this from 👀 To Do to 🥳 Done in Cosmos-SDK Feb 19, 2024
@tac0turtle tac0turtle removed this from Cosmos-SDK Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants