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

Clean up cosmovisor to use x/upgrade as a dependency #10378

Closed
4 tasks done
robert-zaremba opened this issue Oct 15, 2021 · 9 comments · Fixed by #10442
Closed
4 tasks done

Clean up cosmovisor to use x/upgrade as a dependency #10378

robert-zaremba opened this issue Oct 15, 2021 · 9 comments · Fixed by #10442
Assignees
Labels
C:Cosmovisor Issues and PR related to Cosmovisor

Comments

@robert-zaremba
Copy link
Collaborator

robert-zaremba commented Oct 15, 2021

Summary

Currently we are copying code which primary is seating in x/upgrade.

  • remove UpgradeInfo and use upgrade/types.Plan
  • same with upgradeFilename -> upgrade/types.UpgradeInfoFilename
Context

We need to use SDK for the new cosmovisor features:

  • fetch command
  • setup validation

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba robert-zaremba added the C:Cosmovisor Issues and PR related to Cosmovisor label Oct 15, 2021
@robert-zaremba robert-zaremba added this to the cosmovisor v2.0 milestone Oct 15, 2021
@mergify mergify bot closed this as completed in #10442 Nov 9, 2021
mergify bot pushed a commit that referenced this issue Nov 9, 2021
…10442)

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Closes: #10378

Cosmovisor module copies the data type `UpgradeInfo` and constant `upgradeFilename` from upgrade module to cosmovisor module.
This pr will directly import the datatype and const from cosmos-sdk/upgrade module:
`UpgradeInfo` ->  `upgradetypes.Plan`
`upgradeFilename` -> `upgradekeeper.UpgradeInfoFilename`
<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
blewater pushed a commit to e-money/cosmos-sdk that referenced this issue Dec 8, 2021
…osmos#10442)

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Closes: cosmos#10378

Cosmovisor module copies the data type `UpgradeInfo` and constant `upgradeFilename` from upgrade module to cosmovisor module.
This pr will directly import the datatype and const from cosmos-sdk/upgrade module:
`UpgradeInfo` ->  `upgradetypes.Plan`
`upgradeFilename` -> `upgradekeeper.UpgradeInfoFilename`
<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
@tac0turtle
Copy link
Member

this breaks go install. we will need to revert it

@tac0turtle
Copy link
Member

reopening this as its blocked on the api module. We can't have replace tags in a binary when go install is used.

Once the api module is released we will be able to us that upgrade type

@tac0turtle tac0turtle reopened this Feb 17, 2022
@robert-zaremba
Copy link
Collaborator Author

@marbar3778 which go install?

@robert-zaremba
Copy link
Collaborator Author

You mean go install cosmovisor?

@robert-zaremba
Copy link
Collaborator Author

I see:

go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
go: downloading github.com/cosmos/cosmos-sdk/cosmovisor v1.1.0
go: downloading github.com/cosmos/cosmos-sdk v0.45.1
go install: github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest (in github.com/cosmos/cosmos-sdk/cosmovisor@v1.1.0):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

@robert-zaremba
Copy link
Collaborator Author

Both cosmovisor/go.proto and sdk v0.45.1 uses the same replace directive:

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

In cosmovisor we don't need it because we don't do any proto serialization. When I remove the directive from cosmovisor/go.mod, it fails:

go mod tidy
go: downloading github.com/gogo/protobuf v1.3.3
go: github.com/cosmos/cosmos-sdk@v0.45.1 requires
        github.com/gogo/protobuf@v1.3.3: reading github.com/gogo/protobuf/go.mod at revision v1.3.3: unknown revision v1.3.3

Any idea what it could be?
cc: @aaronc

@robert-zaremba
Copy link
Collaborator Author

BTW, @marbar3778 - I think this should be a new issue. It's related to the changes from this one, but it's a different thing.

@tac0turtle
Copy link
Member

tac0turtle commented Feb 17, 2022

It's fixed here #11212. This issue is meant to remove the duplication that will still exist

@robert-zaremba
Copy link
Collaborator Author

#11212 removes what we did in this task. So it's not a solution for this task. We want SDK as a dependency for the fetch command and validation functionality (both in design).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Cosmovisor Issues and PR related to Cosmovisor
Projects
No open projects
3 participants