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 and refactore app options passing #8915

Closed
4 tasks
robert-zaremba opened this issue Mar 17, 2021 · 2 comments
Closed
4 tasks

Fix and refactore app options passing #8915

robert-zaremba opened this issue Mar 17, 2021 · 2 comments
Labels
C:server Issues related to server with github.com/cosmos/cosmos-sdk T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T: Dev UX UX for SDK developers (i.e. how to call our code) Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.

Comments

@robert-zaremba
Copy link
Collaborator

Summary

We don't have a clear way how to pass app configuration down to packages and modules. Currently this is done through Context, globals and a global config.

Problem Definition

  1. Putting things into Context obfuscates the parameters flow
  2. Using mutable globals is even worse - we will loose a control on the app management
  3. Using a global Config object with imports other packages to set concrete types is not usable - only few packages could be able to use it, all rest will be in a circular dependency check.

Ref: https://github.com/cosmos/cosmos-sdk/pull/8825/files#r595494865

Proposal

Consider:

  • splitting package configuration into sub pacages (but not types)
  • create object factories

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba robert-zaremba added the T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). label Mar 17, 2021
@robert-zaremba robert-zaremba changed the title Fix and refactore app options Fix and refactore app config Mar 17, 2021
@robert-zaremba robert-zaremba changed the title Fix and refactore app config Fix and refactore app options passing Mar 17, 2021
@robert-zaremba robert-zaremba changed the title Fix and refactore app options passing Fix and refactore app option passing Mar 17, 2021
@robert-zaremba robert-zaremba changed the title Fix and refactore app option passing Fix and refactore app options passing Mar 17, 2021
@clevinson clevinson added Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. T: Dev UX UX for SDK developers (i.e. how to call our code) labels Mar 18, 2021
@robert-zaremba
Copy link
Collaborator Author

cc: @gsora

@github-actions github-actions bot added the stale label Jul 31, 2021
@github-actions github-actions bot closed this as completed Aug 6, 2021
@julienrbrt julienrbrt reopened this Apr 7, 2022
@tac0turtle tac0turtle added the C:server Issues related to server with github.com/cosmos/cosmos-sdk label Jun 19, 2024
@julienrbrt
Copy link
Member

We've added a DynamicConfig in core: https://github.com/cosmos/cosmos-sdk/blob/main/core/server/config.go#L3-L8.
It is always the same as AppOptions where you can pass config (for modules).

The issue you link refers to the client context and the client APIs that are being simplified here: #20623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:server Issues related to server with github.com/cosmos/cosmos-sdk T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T: Dev UX UX for SDK developers (i.e. how to call our code) Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
Status: 🥳 Done
Development

No branches or pull requests

4 participants