|
1 | | -# Upgrade AtomOne |
| 1 | +# Upgrading AtomOne |
2 | 2 |
|
3 | | -This guide provides instructions for upgrading to specific versions of AtomOne. |
| 3 | +This guide provides instructions for upgrading AtomOne from v1.x to v2.x. |
| 4 | + |
| 5 | +This document describes the steps for validators and full node operators, to |
| 6 | +upgrade successfully for the AtomOne v2 release. |
| 7 | + |
| 8 | +For more details on the release, please see the [release notes][v2]. |
| 9 | + |
| 10 | +## Release Binary |
| 11 | + |
| 12 | +Please use the correct release binary: `v2.0.0`. |
| 13 | + |
| 14 | +## Instructions |
| 15 | + |
| 16 | +- [Upgrading AtomOne](#upgrading-atomeone) |
| 17 | + - [Release Binary](#release-binary) |
| 18 | + - [Instructions](#instructions) |
| 19 | + - [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) |
| 20 | + - [Upgrade date](#upgrade-date) |
| 21 | + - [Preparing for the upgrade](#preparing-for-the-upgrade) |
| 22 | + - [System requirements](#system-requirements) |
| 23 | + - [Backups](#backups) |
| 24 | + - [Testing](#testing) |
| 25 | + - [Current runtime](#current-runtime) |
| 26 | + - [Target runtime](#target-runtime) |
| 27 | + - [Upgrade steps](#upgrade-steps) |
| 28 | + - [`minimum-gas-prices` change](#minimum-gas-prices-change) |
| 29 | + - [Method I: Manual Upgrade](#method-i-manual-upgrade) |
| 30 | + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) |
| 31 | + - [Manually preparing the binary](#manually-preparing-the-binary) |
| 32 | + - [Preparation](#preparation) |
| 33 | + - [Auto-Downloading the AtomOne binary](#auto-downloading-the-gaia-binary) |
| 34 | + - [Expected upgrade result](#expected-upgrade-result) |
| 35 | + - [Upgrade duration](#upgrade-duration) |
| 36 | + - [Rollback plan](#rollback-plan) |
| 37 | + - [Communications](#communications) |
| 38 | + - [Risks](#risks) |
| 39 | + |
| 40 | +## On-chain governance proposal attains consensus |
| 41 | + |
| 42 | +Once a software upgrade governance proposal is submitted to the Cosmos Hub, |
| 43 | +both a reference to this proposal and an `UPGRADE_HEIGHT` are added to the |
| 44 | +[release notes][v2]. |
| 45 | +If and when this proposal reaches consensus, the upgrade height will be used to |
| 46 | +halt the "old" chain binaries. You can check the proposal on one of the block |
| 47 | +explorers or using the `atomoned` CLI tool. |
| 48 | +Neither core developers nor core funding entities control the governance. |
| 49 | + |
| 50 | +## Upgrade date |
| 51 | + |
| 52 | +The date/time of the upgrade is subject to change as blocks are not generated |
| 53 | +at a constant interval. You can stay up-to-date by checking the estimated |
| 54 | +estimated time until the block is produced one of the block explorers (e.g. |
| 55 | +https://www.mintscan.io/atomone/blocks/`UPGRADE_HEIGHT`). |
| 56 | + |
| 57 | +## Preparing for the upgrade |
| 58 | + |
| 59 | +### System requirements |
| 60 | + |
| 61 | +### Backups |
| 62 | + |
| 63 | +Prior to the upgrade, validators are encouraged to take a full data snapshot. |
| 64 | +Snapshotting depends heavily on infrastructure, but generally this can be done |
| 65 | +by backing up the `.atomone` directory. |
| 66 | +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data |
| 67 | +upon upgrade. See below [upgrade using cosmovisor](#method-ii-upgrade-using-cosmovisor) |
| 68 | +section. |
| 69 | + |
| 70 | +It is critically important for validator operators to back-up the |
| 71 | +`.atomone/data/priv_validator_state.json` file after stopping the atomoned |
| 72 | +process. This file is updated every block as your validator participates in |
| 73 | +consensus rounds. It is a critical file needed to prevent double-signing, in |
| 74 | +case the upgrade fails and the previous chain needs to be restarted. |
| 75 | + |
| 76 | +### Testing |
| 77 | + |
| 78 | +XXX UPDATE? |
| 79 | + |
| 80 | +For those validator and full node operators that are interested in ensuring |
| 81 | +preparedness for the impending upgrade, you can run a [v15 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). |
| 82 | + |
| 83 | +### Current runtime |
| 84 | + |
| 85 | +The AtomOne mainnet network, `atomone-1`, is currently running [AtomOne |
| 86 | +v1.0.0][v1]. We anticipate that operators who are running on v1.0.0, will be |
| 87 | +able to upgrade successfully. Validators are expected to ensure that their |
| 88 | +systems are up to date and capable of performing the upgrade. This includes |
| 89 | +running the correct binary and if building from source, building with the |
| 90 | +appropriate `go` version. |
| 91 | + |
| 92 | +### Target runtime |
| 93 | + |
| 94 | +The AtomOne mainnet network, `atomone-1`, will run **[AtomOne v2.0.0][v2]. |
| 95 | +Operators _**MUST**_ use this version post-upgrade to remain connected to the |
| 96 | +network. The new version requires `go v1.21` to build successfully. |
| 97 | + |
| 98 | +## Upgrade steps |
| 99 | + |
| 100 | +There are 2 major ways to upgrade a node: |
| 101 | + |
| 102 | +- Manual upgrade |
| 103 | +- Upgrade using [Cosmovisor](https://pkg.go.dev/cosmossdk.io/tools/cosmovisor) |
| 104 | + - Either by manually preparing the new binary |
| 105 | + - Or by using the auto-download functionality (this is not yet recommended) |
| 106 | + |
| 107 | +If you prefer to use Cosmovisor to upgrade, some preparation work is needed |
| 108 | +before upgrade. |
| 109 | + |
| 110 | +### `minimum-gas-prices` change |
| 111 | + |
| 112 | +**AtomOne v2.0.0** introduces `photon` as the only fee token, so it requires a |
| 113 | +modification of the validator configuration, namely the `minimum-gas-prices` |
| 114 | +which must contain the `uphoton` denom in addition to the `uatone` denom (so |
| 115 | +both denom). This setting is located in the `$ATOMONE_HOME/config/app.toml` |
| 116 | +file. |
| 117 | + |
| 118 | +For example, considering this existing setting: |
| 119 | +```toml |
| 120 | +minimum-gas-prices = "0.001uatone" |
| 121 | +``` |
| 122 | +Before upgrading, the setting should be changed to: |
| 123 | +```toml |
| 124 | +minimum-gas-prices = "0.001uatone,0.001uphoton" |
| 125 | +``` |
| 126 | + |
| 127 | +### Method I: Manual Upgrade |
| 128 | + |
| 129 | +Make sure **AtomOne v1.0.0** is installed by either downloading a [compatible |
| 130 | +binary][v1], or building from source. Check the required version to build this |
| 131 | +binary in the `Makefile`. |
| 132 | + |
| 133 | +Run AtomOne v1.0.0 till upgrade height, the node will panic: |
| 134 | + |
| 135 | +```shell |
| 136 | +ERR UPGRADE "v2" NEEDED at height: <UPGRADE_HEIGHT>: upgrade to v2 and applying upgrade "v2" at height:<UPGRADE_HEIGHT> |
| 137 | +``` |
| 138 | + |
| 139 | +Stop the node, and switch the binary to **AtomOne v2.0.0** and re-start by |
| 140 | +`atomone start`. |
| 141 | + |
| 142 | +It may take several minutes to a few hours until validators with a total sum |
| 143 | +voting power > 2/3 to complete their node upgrades. After that, the chain can |
| 144 | +continue to produce blocks. |
| 145 | + |
| 146 | +### Method II: Upgrade using Cosmovisor |
| 147 | + |
| 148 | +#### Manually preparing the binary |
| 149 | + |
| 150 | +##### Preparation |
| 151 | + |
| 152 | +- Install the latest version of Cosmovisor (`1.5.0`): |
| 153 | + |
| 154 | +```shell |
| 155 | +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest |
| 156 | +cosmovisor version |
| 157 | +# cosmovisor version: v1.5.0 |
| 158 | +``` |
| 159 | + |
| 160 | +- Create a `cosmovisor` folder inside `$ATOMONE_HOME` and move AtomOne `v1.0.0` |
| 161 | +into `$ATOMONE_HOME/cosmovisor/genesis/bin`: |
| 162 | + |
| 163 | +```shell |
| 164 | +mkdir -p $ATOMONE_HOME/cosmovisor/genesis/bin |
| 165 | +cp $(which atomoned) $ATOMONE_HOME/cosmovisor/genesis/bin |
| 166 | +``` |
| 167 | + |
| 168 | +- Build AtomOne `v2.0.0`, and move atomoned `v2.0.0` to |
| 169 | + `$ATOMONE_HOME/cosmovisor/upgrades/v2/bin` |
| 170 | + |
| 171 | +```shell |
| 172 | +mkdir -p $ATOMONE_HOME/cosmovisor/upgrades/v2/bin |
| 173 | +cp $(which atomoned) $ATOMONE_HOME/cosmovisor/upgrades/v2/bin |
| 174 | +``` |
| 175 | + |
| 176 | +At this moment, you should have the following structure: |
| 177 | + |
| 178 | +```shell |
| 179 | +. |
| 180 | +├── current -> genesis or upgrades/<name> |
| 181 | +├── genesis |
| 182 | +│ └── bin |
| 183 | +│ └── atomoned # old: v1.0.0 |
| 184 | +└── upgrades |
| 185 | + └── v2 |
| 186 | + └── bin |
| 187 | + └── atomoned # new: v2.0.0 |
| 188 | +``` |
| 189 | + |
| 190 | +- Export the environmental variables: |
| 191 | + |
| 192 | +```shell |
| 193 | +export DAEMON_NAME=atomoned |
| 194 | +# please change to your own gaia home dir |
| 195 | +# please note `DAEMON_HOME` has to be absolute path |
| 196 | +export DAEMON_HOME=$ATOMONE_HOME |
| 197 | +export DAEMON_RESTART_AFTER_UPGRADE=true |
| 198 | +``` |
| 199 | + |
| 200 | +- Start the node: |
| 201 | + |
| 202 | +```shell |
| 203 | +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME |
| 204 | +``` |
| 205 | + |
| 206 | +XXX NOTE: keep that sentence ?? |
| 207 | + |
| 208 | +Skipping the invariant checks is strongly encouraged since it decreases the |
| 209 | +upgrade time significantly and since there are some other improvements coming |
| 210 | +to the crisis module in the next release of the Cosmos SDK. |
| 211 | + |
| 212 | +#### Auto-Downloading the AtomOne binary |
| 213 | + |
| 214 | +**This method is not recommended!** |
| 215 | + |
| 216 | +## Expected upgrade result |
| 217 | + |
| 218 | +When the upgrade block height is reached, AtomOne will panic and stop: |
| 219 | + |
| 220 | +This may take a few minutes to a few hours. |
| 221 | +After upgrade, the chain will continue to produce blocks when validators with a |
| 222 | +total sum voting power > 2/3 complete their node upgrades. |
| 223 | + |
| 224 | +## Upgrade duration |
| 225 | + |
| 226 | +The upgrade may take a few minutes to several hours to complete because |
| 227 | +atomone-1 participants operate globally with differing operating hours and it |
| 228 | +may take some time for operators to upgrade their binaries and connect to the |
| 229 | +network. |
| 230 | + |
| 231 | +## Rollback plan |
| 232 | + |
| 233 | +During the network upgrade, core Cosmos teams will be keeping an ever vigilant |
| 234 | +eye and communicating with operators on the status of their upgrades. During |
| 235 | +this time, the core teams will listen to operator needs to determine if the |
| 236 | +upgrade is experiencing unintended challenges. In the event of unexpected |
| 237 | +challenges, the core teams, after conferring with operators and attaining |
| 238 | +social consensus, may choose to declare that the upgrade will be skipped. |
| 239 | + |
| 240 | +Steps to skip this upgrade proposal are simply to resume the `atomone-1` |
| 241 | +network with the (downgraded) v1.0.0 binary using the following command: |
| 242 | + |
| 243 | +```shell |
| 244 | +atomoned start --unsafe-skip-upgrade <UPGRADE_HEIGHT> |
| 245 | +``` |
| 246 | + |
| 247 | +Note: There is no particular need to restore a state snapshot prior to the |
| 248 | +upgrade height, unless specifically directed by core Cosmos teams. |
| 249 | + |
| 250 | +Important: A social consensus decision to skip the upgrade will be based solely |
| 251 | +on technical merits, thereby respecting and maintaining the decentralized |
| 252 | +governance process of the upgrade proposal's successful YES vote. |
| 253 | + |
| 254 | +## Communications |
| 255 | + |
| 256 | +Operators are encouraged to join the `#validate-private` channel |
| 257 | +of the AtomOne (unofficial) Discord. This channel is the primary communication |
| 258 | +tool for operators to ask questions, report upgrade status, report technical |
| 259 | +issues, and to build social consensus should the need arise. This channel is |
| 260 | +restricted to known operators and requires verification beforehand. Requests to |
| 261 | +join the `#validator-private` channel can be sent to the `#support` channel. |
| 262 | + |
| 263 | +## Risks |
| 264 | + |
| 265 | +As a validator performing the upgrade procedure on your consensus nodes carries |
| 266 | +a heightened risk of double-signing and being slashed. The most important piece |
| 267 | +of this procedure is verifying your software version and genesis file hash |
| 268 | +before starting your validator and signing. |
| 269 | + |
| 270 | +The riskiest thing a validator can do is discover that they made a mistake and |
| 271 | +repeat the upgrade procedure again during the network startup. If you discover |
| 272 | +a mistake in the process, the best thing to do is wait for the network to start |
| 273 | +before correcting it. |
| 274 | + |
| 275 | +[v1]: https://github.com/atomone-hub/atomone/releases/tag/v1.0.0 |
| 276 | +[v2]: https://github.com/atomone-hub/atomone/releases/tag/v2.0.0 |
0 commit comments