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: x/upgrade as a standalone go module #14560

Closed
Tracked by #11899
kocubinski opened this issue Jan 9, 2023 · 2 comments · Fixed by #14764
Closed
Tracked by #11899

refactor: x/upgrade as a standalone go module #14560

kocubinski opened this issue Jan 9, 2023 · 2 comments · Fixed by #14764
Assignees

Comments

@kocubinski
Copy link
Member

kocubinski commented Jan 9, 2023

Ref: #11899

The SDK module dependency graph below (generated from main 2023-01-09) shows that x/upgrade has only one dependent. If it can be removed it should be trivial to create a go.mod for this module and separate it from the SDK monolith.

image

x/upgrade has dependencies on the SDK modules shown below. As a part of this issue lets do a cursory review and remove them if trivial, or punt to the dependency's issue if not.

$ goFmtString="{{ \$importPath := .ImportPath }} {{ \$forTest := .ForTest }}                                                               
{{ range .Imports }} {{ if \$forTest }} {{ \$forTest }}.test {{else}} {{ \$importPath }} {{end}}-> {{ . }}
{{ end }}"
$ go list -test -f "$goFmtString" ./... | awk -F'->' '$2 ~ "github.com/cosmos/cosmos-sdk/x/"' | awk -F'->' '$2 !~ "github.com/cosmos/cosmos-sdk/x/upgrade"'   
  github.com/cosmos/cosmos-sdk/x/upgrade -> github.com/cosmos/cosmos-sdk/x/auth/types
  github.com/cosmos/cosmos-sdk/x/upgrade -> github.com/cosmos/cosmos-sdk/x/gov/types
  github.com/cosmos/cosmos-sdk/x/upgrade -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/client -> github.com/cosmos/cosmos-sdk/x/gov/client
  github.com/cosmos/cosmos-sdk/x/upgrade/client/cli -> github.com/cosmos/cosmos-sdk/x/gov/client/cli
  github.com/cosmos/cosmos-sdk/x/upgrade/client/cli -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/keeper -> github.com/cosmos/cosmos-sdk/x/gov/types
  github.com/cosmos/cosmos-sdk/x/upgrade/types -> github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx
  github.com/cosmos/cosmos-sdk/x/upgrade/types -> github.com/cosmos/cosmos-sdk/x/authz/codec
  github.com/cosmos/cosmos-sdk/x/upgrade/types -> github.com/cosmos/cosmos-sdk/x/gov/codec
  github.com/cosmos/cosmos-sdk/x/upgrade/types -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/types -> github.com/cosmos/cosmos-sdk/x/group/codec
  github.com/cosmos/cosmos-sdk/x/upgrade.test -> github.com/cosmos/cosmos-sdk/x/auth/types
  github.com/cosmos/cosmos-sdk/x/upgrade.test -> github.com/cosmos/cosmos-sdk/x/gov/types
  github.com/cosmos/cosmos-sdk/x/upgrade.test -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/client/cli.test -> github.com/cosmos/cosmos-sdk/x/gov/client/cli
  github.com/cosmos/cosmos-sdk/x/upgrade/client/cli.test -> github.com/cosmos/cosmos-sdk/x/gov/client/cli
  github.com/cosmos/cosmos-sdk/x/upgrade/client/cli.test -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/keeper.test -> github.com/cosmos/cosmos-sdk/x/gov/types
  github.com/cosmos/cosmos-sdk/x/upgrade/keeper.test -> github.com/cosmos/cosmos-sdk/x/auth/types
  github.com/cosmos/cosmos-sdk/x/upgrade/keeper.test -> github.com/cosmos/cosmos-sdk/x/gov/types
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/authz/codec
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/gov/codec
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/group/codec
  github.com/cosmos/cosmos-sdk/x/upgrade/types.test -> github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1

List of To-dos when creating a go.mod: https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#gomod

@tac0turtle
Copy link
Member

One thing depends on upgrade but from the things upgrade depends on is there anything we can remove? Is this part of the issue?

@kocubinski
Copy link
Member Author

One thing depends on upgrade but from the things upgrade depends on is there anything we can remove? Is this part of the issue?

We don't strictly need to (since everything is still dependent on the SDK monolith) to make a standalone go module, but it's not a bad idea to remove that tech debt now if it's trivial to do so.

@github-project-automation github-project-automation bot moved this to 📝 Todo in Cosmos-SDK Jan 16, 2023
@likhita-809 likhita-809 self-assigned this Jan 25, 2023
@likhita-809 likhita-809 moved this from 📝 Todo to 💪 In Progress in Cosmos-SDK Jan 25, 2023
@github-project-automation github-project-automation bot moved this from 💪 In Progress to 👏 Done in Cosmos-SDK Jan 27, 2023
@tac0turtle tac0turtle removed the Q1:2023 label Apr 3, 2023
@tac0turtle tac0turtle removed this from Cosmos-SDK May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants