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

docs: simply ADR-47 #16150

Closed
wants to merge 5 commits into from
Closed

docs: simply ADR-47 #16150

wants to merge 5 commits into from

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented May 15, 2023

Description

Extracted from #14878.
Opening this PR with a simplification of ADR-47 to get a feeling on what to do with this ADR.

  • Should still implement it as is?
  • Should we simplify it as it is in this PR?
  • Or shall we simply reject it?

Related: #14878, #11875, #11543, #10718

If we go with it, I can continue #14878 and wrap up the 4 issues above.


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • 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 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)

@julienrbrt julienrbrt requested a review from a team as a code owner May 15, 2023 10:15
@github-prbot github-prbot requested review from a team, samricotta and testinginprod and removed request for a team May 15, 2023 10:15
@@ -3,28 +3,28 @@
## Changelog

* Nov, 23, 2021: Initial Draft
* Feb 15, 2023: Remove `pre_run` and `post_run` fields for simplifying the ADR
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 does not seem needed anymore, is that a correct assumption?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This ADR has been in the back of my mind for the last year+. To me, the only thing really worthwhile in it, is the pre_run and post_run stuff. Cosmovisor currently has support for running a pre-upgrade command on the new executable. Support for running an externally defined command before and/or after an upgrade would still be handy, though. An example pre-run is updating config files to a new format (e.g. when all the -s change to _s). An example post-run is sending a notification somewhere that a node is back up.

That being said, the post_run concept might be better as something a node can configure rather than something all nodes on a chain would run. I can't remember all of the use-cases previously thought of for it, though.

As for the Artifacts defined in this PR, I actually now think it's something that I do not want. We (at Provenance Blockchain) put a URL in the info field that returns the UpgradeConfig JSON. We've had a few instances where an upgrade proposal is submitted and passed, but before the upgrade height, we discover a major issue. Because the actual executable download URLs aren't in the proposal, we're able to change them to a version without the issue. Without this ability, it'd often be impossible to prevent the chain from upgrading to the problematic version.

If the pre_run and post_run parts are being removed from this ADR, I'd suggest getting rid of the ADR altogether.

Copy link
Member Author

@julienrbrt julienrbrt May 16, 2023

Choose a reason for hiding this comment

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

Exactly, the fact cosmovisor can run a pre-upgrade command on the new binary if it exists, makes the pre_run field unnecessary now.
Agreeing as well with your second point that post_run is something that nodes can configure.
Bringing a new breakage client breakage just for a sake of improving that info field, is a nit, so we may indeed simply reject/retract the ADR.

Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Copy link
Collaborator

@SpicyLemon SpicyLemon left a comment

Choose a reason for hiding this comment

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

A few notes.

Also, all of the will be -> is changes should be undone since the ADR hasn't been implemented yet, and is talking about things that will be done, not what they currently are.

The upgrade instructions will contain a list of artifacts available for each platform.
It allows for the definition of a pre-run and post-run commands.
These commands are not consensus guaranteed; they will be executed by Cosmosvisor (or other) during its upgrade handling.
The `x/upgrade.Plan` message is updated for providing upgrade artifacts. The artifacts available define each platform.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is discussing things not yet done, it should be future tense. Also, the second sentence is weird to me. I'm not quite sure what it's trying to say.

Suggested change
The `x/upgrade.Plan` message is updated for providing upgrade artifacts. The artifacts available define each platform.
The `x/upgrade.Plan` message will be updated to provide a list of artifacts, one for each available platform.

1. The `{checksum}` from the query parameter MUST equal the `checksum` provided in the `Artifact`.
1. The `{checksum_algo}` from the query parameter MUST equal the `checksum_algo` provided in the `Artifact`.
1. The following validation is currently done using the `info` field. We will apply similar validation to the `UpgradeInstructions`.
1. There MUST be at least one entry in `artifacts`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This contradicts the claim that the new artifacts are optional.

Comment on lines -181 to +142
We will deprecate the use of the `info` field for anything other than human readable information.
A warning will be logged if the `info` field is used to define the assets (either by URL or JSON).
The `info` field should be deprecated for anything other than human readable information.
A warning is logged if the `info` field is used to define the assets (either by URL or JSON).
Copy link
Collaborator

Choose a reason for hiding this comment

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

After thinking about this for the last year+, I don't think this deprecation is a good idea. The specific functionality being removed that is still needed, is the ability to provide a URL that returns the artifact download URLs. The new artifacts stuff requires the artifact download URLs to be directly in the upgrade plan.

Comment on lines +203 to +206
* [Current upgrade.proto](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/upgrade/v1beta1/upgrade.proto)
* [Upgrade Module README](https://github.com/cosmos/cosmos-sdk/blob/main/x/upgrade/README.md)
* [Cosmovisor README](https://github.com/cosmos/cosmos-sdk/blob/main/tools/cosmovisor/README.md)
* [Pre-upgrade README](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/migrations/01-pre-upgrade.md)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Pre-upgrade README link is incorrect. The old one still works, but I'm not sure where it was moved to now.

Also, these links need to be to specific version tags and not to /main/ (or any other branch). They're here to provide context which is lost if the content changes later, or worse, the file moves and the link no longer works.


## Context

The `upgrade` module in conjunction with Cosmovisor are designed to facilitate and automate a blockchain's transition from one version to another.

Users submit a software upgrade governance proposal containing an upgrade `Plan`.
The [Plan](https://github.com/cosmos/cosmos-sdk/blob/v0.44.5/proto/cosmos/upgrade/v1beta1/upgrade.proto#L12) currently contains the following fields:
The [Plan](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/upgrade/v1beta1/upgrade.proto#L13-L45) currently contains the following fields:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This link needs to be to a specific version instead of a link to whatever main currently has, specially since it include line numbers.

@SpicyLemon
Copy link
Collaborator

  • Should still implement it as is?
  • Should we simplify it as it is in this PR?
  • Or shall we simply reject it?

My vote is to simply reject it.

@julienrbrt
Copy link
Member Author

  • Should still implement it as is?
  • Should we simplify it as it is in this PR?
  • Or shall we simply reject it?

My vote is to simply reject it.

Let's just do that then 👍🏾

@julienrbrt julienrbrt closed this May 16, 2023
@julienrbrt julienrbrt deleted the julien/adr-47 branch May 16, 2023 18:55
@julienrbrt julienrbrt mentioned this pull request May 16, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants