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

Upgrade: Design and experiments for Upgrade and Migration support #39

Closed
ashcherbakov opened this issue Sep 10, 2020 · 3 comments
Closed

Comments

@ashcherbakov
Copy link
Contributor

ashcherbakov commented Sep 10, 2020

It should be based on https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor and https://docs.cosmos.network/master/modules/upgrade/

The main idea:

  1. New releases (packages) are hosted on GitHub (https://docs.github.com/en/actions/publishing-packages-with-github-actions/about-packaging-with-github-actions)
  2. Validator process is run from under the cosmovisor shim, which can perform updates
  3. Trustees send and approve (as usual) an Upgrade transaction specifying
  • update time (time or block height)
  • a link to the package and its checksum
  1. if state migration is needed (there are breaking changes), then developers create and regisetr a special Handler
  2. when cosmovisorsees that it's update time (it will be the same "time" for all nodes; for example, the same block height), it performs the update (potentially downloading the binary). Migration Handler is also executed.

What needs to be done:

  1. Update transaction implementation (PROPOSE_UPDATE and APPROVE_UPDATE). The current approach in https://docs.cosmos.network/master/modules/upgrade/ is based on https://docs.cosmos.network/master/modules/gov/, and it looks like we can not use the gov module as it depends on staking and tokens.
  2. We may have to do some minor changes in https://docs.cosmos.network/master/modules/upgrade/ module by the same reason (need to get rid of gov dependency?)
  3. integrate cosmovisor, update instructions
  4. test that everything works as expected

Notes

WBS and estimates: https://cloud.dsr-corporation.com/index.php/s/6dkyjZwnLcGMMwG, "update" tab.

@ashcherbakov ashcherbakov added this to To do in DCL Sep 10, 2020
@ashcherbakov ashcherbakov added this to the v0.2: Test Net Launch milestone Sep 10, 2020
@ashcherbakov ashcherbakov moved this from To do to In progress in DCL Oct 12, 2020
@ashcherbakov ashcherbakov moved this from In progress to To do in DCL Oct 7, 2021
@ashcherbakov ashcherbakov modified the milestones: v0.3, v0.4 Nov 1, 2021
@ashcherbakov ashcherbakov moved this from To do to In progress in DCL Jan 24, 2022
@ashcherbakov
Copy link
Contributor Author

Possible options:

  • O1: Upgrade from Cosmos + Custom Gov module
    • import upgrade from cosmos as-is (no copy);
    • custom gov module (copy x/goc to DCL) with necessary changes (get rid of staking)
    • Possible only if cosmos's x/upgrade can work with our custom giv module without any changes in x/upgrade
  • O2: Upgrade from Cosmos + Custom DCLUpgrade Ext (Propose/Approve)
    • import upgrade from cosmos as-is (no copy);
    • new dclupgrade-ext module in DCL with a custom propose/approve upgrade transactions (similar to other modules)
    • Possible only if cosmos's x/upgrade can work with our custom upgrade extension module without any changes in cosmos's x/upgrade
  • O3: Custom Upgrade module with Custom Propose/Approve txns in it
    • copy cosmos's x/upgrade to DCL as dclupgrade module; get rid of x/gov dependency
    • implement propose/approve upgrade transactions right in dclupgrade module (similar to other modules)
    • Possible without any pre-conditions, but it may be not the best option if O1 or O2 are possible
  • O4: Custom Upgrade module + Custom gov module
    • copy cosmos's x/upgrade to DCL as dclupgrade module; get rid of x/gov dependency
    • custom gov module (copy x/goc to DCL) with necessary changes (get rid of staking);
    • make custom upgrade and custom gov modules work with each other
    • Possible without any pre-conditions, but it may be not the best option if O1 or O2 are possible. Also we may do O3 instead as it seems more simple and better matches other DCL modules.

@ashcherbakov
Copy link
Contributor Author

It's possible to re-use upgrade module from Cosmos, so we can do either O1 or O2.
O2 is chosen, as it's more simple and matches the rest of the DCL modules regarding voting.
#200 is created to implement a generic governance module in future.

@spivachuk
Copy link
Contributor

spivachuk commented Feb 8, 2022

Clarified WBS

  • Design
    • Explore x/upgrade, x/gov and cosmovisor documentation [done]
    • Run cosmovisor example [done]
    • Consider implementation options [done]
  • Implementation
    • Add x/upgrade module to the project [done]
    • Implement x/dclupgrade module (for upgrade proposal/approval process) [done]
    • Write unit tests for x/dclupgrade module
    • Get a sample upgrade with a sample migration working on a pool in docker [done]
    • Modify make targets, related bash scripts and docker environment to use cosmovisor
    • Modify systemd service and node deployment scripts to use cosmovisor
  • Testing
    • Write CLI integration tests of upgrade scheduling
    • Write gRPC/REST integration tests of upgrade scheduling
    • Prepare infrastructure for CLI integration tests of upgrade procedure
    • Write CLI integration tests of upgrade procedure
    • Update integration test of node deployment
  • Documentation
    • Update documentation

@ashcherbakov ashcherbakov changed the title Upgrade and Migration support Upgrade: Design and experiments for Upgrade and Migration support Feb 9, 2022
DCL automation moved this from In progress to Done Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
DCL
  
Done
Development

No branches or pull requests

4 participants