Skip to content

Creating a release

PoisonPhang edited this page Sep 13, 2023 · 10 revisions

In the document below, replace VERSION with your version, such as v0.10.0

Phase 1: Adding the upgrade to uniond

  1. Write upgrade handler uniond/app/upgrades/VERSION
  2. Add upgrade to uniond/app/upgrades.go
  3. Create PR and merge it into main

Phase 2: Test the Migration

Before the release is deployed to validators and an upgrade is proposed, the release should be tested via our e2e test suite.

Upgrade from Genesis

The upgrade from genesis test will ensure that, starting from the testnet genesis, all of our upgrades can be successfully applied to the network.

To ensure the latest upgrade is also tested, open e2e/upgrades.nix and append a call to upgradeTo to the end of the upgrade-from-genesis script.

These calls are in the form of:

${upgradeTo "v$MAJOR.$MINOR.$PATCH" $HEIGHT}

For example:

${upgradeTo "v0.10.0" 20}

It's suggested to have 10 blocks between each upgrade.

Phase 3: Release branch and the first release candidate

  1. Create release-VERSION branch from main
  2. On that branch, create tag VERSION-rc1 with body VERSION-rc1. Push that tag

Phase 4: Adding the release to bundle-testnet

  1. Add the new uniond version here: https://github.com/unionlabs/union/blob/68eec5926d7c50e3c1d78ab87c4af4b09b2806d6/flake.nix#L60
  2. Add it to the bundle here: https://github.com/unionlabs/union/blob/68eec5926d7c50e3c1d78ab87c4af4b09b2806d6/unionvisor/unionvisor.nix#L41
  3. Do GIT_LFS_SKIP_SMUDGE=1 nix flake lock --update-input v0_10_0 where v0_10_0 is your version
  4. Create a PR to add the new version to the bundle-testnet and merge it

Phase 5: Updating the validators

  1. Use nixos rebuild-switch in order to upgrade the Unionvisor version on your remote validator (example: GIT_LFS_SKIP_SMUDGE=1 nixos-rebuild switch --flake .#testnet-validator --target-host union-testnet.cor.systems -L
  2. Wait for the deployment to be complete

Phase 6: On-chain upgrade proposal

  1. Creating the proposal-VERSION.json
  2. ./uniond tx gov draft-proposal --node https://rpc.0xc0dejug.uno:443
  3. Change it so that it matches the following structure, as the default is incorrect:
{
 "messages": [
  {
   "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
   "authority": "union10d07y265gmmuvt4z0w9aw880jnsr700js4jdcz",
   "plan": {
    "name": "VERSION",
    "height": "300",
    "info": "VERSION"
   }
  }
 ],
 "deposit": "15000000muno",
 "title": "VERSION",
 "summary": "Upgrade to VERSION"
}

Make sure that height is current height + 250 blocks

  1. Submit the proposal: ./uniond tx gov submit-proposal ./proposal-v0.10.0.json --from MONIKER --node https://rpc.0xc0dejug.uno:443
  2. Let everyone vote on the proposal: ./uniond tx gov vote 400 yes --from MONIKER --chain-id union-testnet-3 --node https://rpc.0xc0dejug.uno:443
    1. Where 400 should be the proposal # of the upgrade

Now wait until the upgrade is done