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

Clarify distinction between legacy proposals and non-legacy proposals #16929

Closed
rootulp opened this issue Jul 11, 2023 · 6 comments · Fixed by #16932
Closed

Clarify distinction between legacy proposals and non-legacy proposals #16929

rootulp opened this issue Jul 11, 2023 · 6 comments · Fixed by #16932
Labels
T:Docs Changes and features related to documentation.

Comments

@rootulp
Copy link
Contributor

rootulp commented Jul 11, 2023

Context

cosmos-sdk/x/gov/README.md

Lines 495 to 501 in b18b6c4

### Legacy Proposal
A legacy proposal is the old implementation of governance proposal.
Contrary to proposal that can contain any messages, a legacy proposal allows to submit a set of pre-defined proposals.
These proposal are defined by their types.
While proposals should use the new implementation of the governance proposal, we need still to use legacy proposal in order to submit a `software-upgrade` and a `cancel-software-upgrade` proposal.

Question

I'm confused on the difference between legacy proposals and non-legacy proposals. This section indicates that a legacy proposal is for software-upgrade and a cancel-software-upgrade.

  1. Is MsgSoftwareUpgrade the type that this is referring to? If yes, would it help clarify that this type is legacy with the word "deprecated" in the godoc?
  2. What is the difference between types/v1 and types/v1beta1? When should each be used?
@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Jul 11, 2023
@julienrbrt
Copy link
Member

julienrbrt commented Jul 11, 2023

While proposals should use the new implementation of the governance proposal, we need still to use legacy proposal in order to submit a software-upgrade and a cancel-software-upgrade proposal.

This is outdated, and this mention can be removed.

  1. No, this is a gov v1 proposal. A gov v1beta1 proposal looks like this:
    func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content {
    /
    type SoftwareUpgradeProposal struct {

    Both are supported by the gov module.
  2. You should simply use msgs as proposals (i.e gov v1).

@julienrbrt julienrbrt added T:Docs Changes and features related to documentation. and removed needs-triage Issue that needs to be triaged labels Jul 11, 2023
@rootulp
Copy link
Contributor Author

rootulp commented Jul 11, 2023

Both are supported by the gov module.

Is one form considered legacy and/or deprecated? Sorry I still don't understand the difference between v1 and v1beta1 types, can you please re-clarify?

@rootulp
Copy link
Contributor Author

rootulp commented Jul 11, 2023

Proposals:

  1. Can NewSoftwareUpgradeProposal be renamed to include the word "legacy"?
    func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content {
  2. Can the godoc for NewSoftwareUpgradeProposal describe that it is "legacy" or deprecated?

@julienrbrt
Copy link
Member

Hey, the type itself SoftwareUpgradeProposal, is deprecated. I do not see why not renaming the constructor however if it makes the API clearer.

Is one form considered legacy and/or deprecated? Sorry I still don't understand the difference between v1 and v1beta1 types, can you please re-clarify?

Yes, the v1beta1 form is legacy and deprecated. The difference is that gov v1 can handle any msg as proposals, and gov v1beta1 can only handle a list of registered proposal messages.

@rootulp
Copy link
Contributor Author

rootulp commented Jul 12, 2023

I do not see why not renaming the constructor however if it makes the API clearer.

I think renaming NewSoftwareUpgradeProposal to NewLegacySoftwareUpgradeProposal would make the API clearer. Additionally, I think the godoc should mention "legacy" or deprecated. I'm happy to open an issue or PR if its helpful.

@julienrbrt
Copy link
Member

julienrbrt commented Jul 12, 2023

I do not see why not renaming the constructor however if it makes the API clearer.

I think renaming NewSoftwareUpgradeProposal to NewLegacySoftwareUpgradeProposal would make the API clearer. Additionally, I think the godoc should mention "legacy" or deprecated. I'm happy to open an issue or PR if its helpful.

Feel free to open a PR and reference this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Docs Changes and features related to documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants