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

refactor(simapp): use app v2 for core sdk modules #4334

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Aug 13, 2023

Description

Spike, feel free to merge if the IBC team find that useful.

This PR makes the Core SDK Modules use app wiring. Given that IBC modules do not support app wiring yet, this is then an example of a mixed configuration.
The advantage for IBC to have such mixed app.go, is still to benefit of app v2 from the Cosmos SDK modules, and hence a smaller app.go; as well as not having any breaking change in app wiring for Core SDK module in the future.
As well as demonstrating other app developers how to use a mixed app v2 (we have docs https://docs.cosmos.network/main/building-apps/app-go-v2#registering-non-app-wiring-modules, but this can still be a good reference) until you migrate.

Commit Message / Changelog Entry

refactor(simapp): use app v2 for core sdk modules

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

Copy link
Member Author

@julienrbrt julienrbrt Aug 14, 2023

Choose a reason for hiding this comment

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

It will look so much nicer when IBC modules use depinject.

)
if err != nil {
panic(err)
// AutoCliOpts returns the autocli options for the app.
Copy link
Member Author

Choose a reason for hiding this comment

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

This can be depinjected when IBC fully uses app v2.

@damiannolan
Copy link
Member

Looks great @julienrbrt, if I have some extra time I might push some commits to this if that's cool?

Would be great to see if we could get e2e's running with this, but now that I think of it, I think we may still be waiting on interchaintest v0.50 compat.

@crodriguezvega
Copy link
Contributor

This is very useful; thank you very much, @julienrbrt! I had a quick look and was thinking if there was a reason why you replaced the legacy app.go with the v2 one, instead of keeping the legacy and adding an app_v2.go, as you are doing in the SDK. What are you plans for the legacy app.go in the SDK?

@julienrbrt
Copy link
Member Author

This is very useful; thank you very much, @julienrbrt! I had a quick look and was thinking if there was a reason why you replaced the legacy app.go with the v2 one, instead of keeping the legacy and adding an app_v2.go, as you are doing in the SDK. What are you plans for the legacy app.go in the SDK?

The idea is that given that we verify the manual wiring of the SDK modules directly in the SDK, you do not need to do it here too. I guess once you fully use depinject for your app v2 it will make sense to do the same as the SDK for the IBC modules.
So this is sort of your legacy app.go, which as well demonstrate a mixture of dependency injection and manual wiring.

@faddat
Copy link
Contributor

faddat commented Aug 20, 2023

Love this. Thank you @julienrbrt !

@crodriguezvega crodriguezvega added this to the vNext milestone Sep 4, 2023
@colin-axner colin-axner deleted the branch cosmos:feat/upgrade-sdk-v0.50 September 4, 2023 16:30
@colin-axner colin-axner closed this Sep 4, 2023
@colin-axner
Copy link
Contributor

Looks like the pr got automatically closed after meging the feature branch. I'm not able to reopen or rebase. You can reopen against main

@julienrbrt
Copy link
Member Author

Sure, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants