First Morpheus “Apollo” on-chain upgrade

Riccardo Montagnin
Desmos Network
Published in
4 min readJun 2, 2021

--

Since we’ve launched Morpheus “Apollo” on April 27th, we’ve seen more than 180 validators joining and more than 656.000 transactions being performed. Thanks to some community members, we’ve also seen that our chain can handle a high traffic without any problem.

During this time, we tried every way to break what we have introduced and we were able to find a security bug that affects our custom Cosmos account implementation: the profile.

Currently, if you create a profile and then perform a failing transaction paying a fee, you will see your balance being constantly depleted of your funds. This is due to a bug inside the implementation of the profile that does not allow the chain to properly remove a failed transaction from the nodes’ mempools. This results in the transaction being included in each block and the fees being subtracted periodically from the account wallet. This is also why nodes are observing the following logs:

Logs of a node trying to include the failed transactions in each block. Courtesy of astilos from Discord

We’ve been able to identify this bug thanks to the extended tests that we conducted on the chain code, and we have already fixed it thanks to the help of amaurym from Regen.network and dimi from stake.fish.

A part from this bug, we have also taken the time to fix other things and update Desmos to be based on the new Cosmos v0.42.5 version, which re-introduces the config subcommand and fixes the build errors that were present on ARM devices.

We are now finally ready to upgrade the Morpheus “Apollo” testnet to use this newer Desmos version. However, since the upgrade includes some changes to the way how things are stored inside the chain, it will require a live on-chain upgrade.

This means that the upgrade must be coordinated between all validators and executed at the same time. To do this we are going to use the x/upgrade module, that allows the execution of live upgrades without having to stop the chain, as well as Cosmovisor, which will help validators taking care of such upgrades.

Setting up Cosmovisor 🔧

If you are running a full node or a validator node, please make sure you setup Cosmovisor inside it. To do this, you can follow the guide we have created and posted on our documentation website here. If you find any errors or need more help please do not hesitate to contact us inside our Discord server.

Upgrade procedure 📥

In order to use the x/upgrade module and the Cosmovisor utility, what will happen is the following.

1. Upgrade proposal creation

First thing first, our team will create an on-chain upgrade governance proposal signalling that we are ready to perform the upgrade. This proposal will contain all the details of the upgrade such as:

  • the time in which the upgrade will happen
  • the Desmos version to be used for the upgrade

Once the proposal is created, the community will have 3 days to signal they are ready to support it. This can be done by voting YES to such proposal. If you don’t know how to vote a governance proposal, please ask help inside our Discord server and we will be ready to help you if needed.

2. Live upgrade

If the proposal passes, the upgrade will be scheduled for the specified time and date. This will leave validators mode time to setup their nodes and get ready for it.

Once the time comes, the following operations will take place:

  1. The chain will halt telling that an upgrade is expected.
  2. Cosmovisor will download the new Desmos version to be used.
  3. Cosmovisor will change the used Desmos version to the new one and restart the node with it.

As you can see, everything will be taken care by Cosmovisor. However, if anything fails we will be ready to give assistance on our Discord server and help solving the problems by hand.

Once enough validators have updates their Desmos version successfully, the chain will restart properly.

Upgrade details

Currently, we have already tagged the new Desmos version naming it v0.16.3 . If you are interested in the changes, make sure you read the change log here.

We are planning to submit the governance proposal on Thursday June 3rd 2021, which means the vote period will end on June 5th 2021. However, to leave more time to the validators we will plan the upgrade to happen on June 9th 2021 at 13:00 UTC. Please make sure that your node is properly setup by that date.

As always, we will provide help to anyone on our Discord server so make sure you join it if you need assistance.

We would like to thanks all our current “Apollo” validators for the work they’ve put into this testnet. We can’t wait to see what will happen next 😎.

Practice without improvement is meaningless.

— Chuck Knox

--

--

Riccardo Montagnin
Desmos Network

I’ve got too many places where to write my bio, so if you wanna see the updated one go to Twitter: https://twitter.com/ricmontagnin