Skip to content

Commit 803a23f

Browse files
authoredJan 8, 2021
Merge pull request cosmos#364 from CosmWasm/passing-upgrade
Document passing upgrade
2 parents 9ee91d2 + 5942968 commit 803a23f

File tree

1 file changed

+25
-57
lines changed

1 file changed

+25
-57
lines changed
 

‎UPGRADING.md

+25-57
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ We need to have two different versions of `wasmd` which depend on state-compatib
2121
versions of the Cosmos SDK. We only focus on upgrade starting with stargate. You will
2222
have to use the "dump state and restart" approach to move from launchpad to stargate.
2323

24-
For this demo, we will show an upgrade to our Musselnet going from `v0.12.1` to
25-
`v0.14.0`.
24+
For this demo, we will show an upgrade from `v0.14.0` to musselnet branch.
2625

2726
### Handler
2827

@@ -42,7 +41,9 @@ Let's get the two binaries we want to test, the pre-upgrade and the post-upgrade
4241
binaries. In this case the pre-release is already a published to docker hub and
4342
can be downloaded simply via:
4443

45-
`docker pull cosmwasm/wasmd:v0.12.1`
44+
`docker pull cosmwasm/wasmd:v0.14.0`
45+
46+
(If this is not yet released, build it from the tip of master)
4647

4748
The post-release is not published, so we can build it ourselves. Check out this
4849
`wasmd` repo, and the proper `musselnet` branch:
@@ -56,7 +57,7 @@ docker build . -t wasmd:musselnet-v2
5657
Verify they are both working for you locally:
5758

5859
```
59-
docker run cosmwasm/wasmd:v0.12.1 wasmd version
60+
docker run cosmwasm/wasmd:v0.14.0 wasmd version
6061
docker run wasmd:musselnet-v2 wasmd version
6162
```
6263

@@ -74,12 +75,12 @@ docker volume rm -f musselnet_client
7475
docker run --rm -it \
7576
-e PASSWORD=1234567890 \
7677
--mount type=volume,source=musselnet_client,target=/root \
77-
cosmwasm/wasmd:v0.12.1 /opt/setup_wasmd.sh
78+
cosmwasm/wasmd:v0.14.0 /opt/setup_wasmd.sh
7879

7980
# enter "1234567890" when prompted
8081
docker run --rm -it \
8182
--mount type=volume,source=musselnet_client,target=/root \
82-
cosmwasm/wasmd:v0.12.1 wasmd keys show -a validator
83+
cosmwasm/wasmd:v0.14.0 wasmd keys show -a validator
8384
# use the address returned above here
8485
CLIENT=wasm1anavj4eyxkdljp27sedrdlt9dm26c8a7a8p44l
8586
```
@@ -92,17 +93,17 @@ docker volume rm -f musselnet
9293
# add your testing address here, so you can do something with the client
9394
docker run --rm -it \
9495
--mount type=volume,source=musselnet,target=/root \
95-
cosmwasm/wasmd:v0.12.1 /opt/setup_wasmd.sh $CLIENT
96+
cosmwasm/wasmd:v0.14.0 /opt/setup_wasmd.sh $CLIENT
9697

9798
# Update the voting times in the genesis file
9899
docker run --rm -it \
99100
--mount type=volume,source=musselnet,target=/root \
100-
cosmwasm/wasmd:v0.12.1 sed -ie 's/172800s/300s/' /root/.wasmd/config/genesis.json
101+
cosmwasm/wasmd:v0.14.0 sed -ie 's/172800s/300s/' /root/.wasmd/config/genesis.json
101102

102103
# start up the blockchain and all embedded servers as one process
103104
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
104105
--mount type=volume,source=musselnet,target=/root \
105-
cosmwasm/wasmd:v0.12.1 /opt/run_wasmd.sh
106+
cosmwasm/wasmd:v0.14.0 /opt/run_wasmd.sh
106107
```
107108

108109
## Sanity checks
@@ -117,25 +118,25 @@ RCPT=wasm1pypadqklna33nv3gl063rd8z9q8nvauaalz820
117118
docker run --rm -it \
118119
--mount type=volume,source=musselnet_client,target=/root \
119120
--network=host \
120-
cosmwasm/wasmd:v0.12.1 wasmd \
121+
cosmwasm/wasmd:v0.14.0 wasmd \
121122
query bank balances $CLIENT
122123

123124
docker run --rm -it \
124125
--mount type=volume,source=musselnet_client,target=/root \
125126
--network=host \
126-
cosmwasm/wasmd:v0.12.1 wasmd \
127+
cosmwasm/wasmd:v0.14.0 wasmd \
127128
query bank balances $RCPT
128129

129130
docker run --rm -it \
130131
--mount type=volume,source=musselnet_client,target=/root \
131132
--network=host \
132-
cosmwasm/wasmd:v0.12.1 wasmd \
133+
cosmwasm/wasmd:v0.14.0 wasmd \
133134
tx send validator $RCPT 500000ucosm,600000ustake --chain-id testing
134135

135136
docker run --rm -it \
136137
--mount type=volume,source=musselnet_client,target=/root \
137138
--network=host \
138-
cosmwasm/wasmd:v0.12.1 wasmd \
139+
cosmwasm/wasmd:v0.14.0 wasmd \
139140
query bank balances $RCPT
140141
```
141142

@@ -150,15 +151,15 @@ we have > 67% of the voting power and will pass with the validator not voting.
150151
docker run --rm -it \
151152
--mount type=volume,source=musselnet_client,target=/root \
152153
--network=host \
153-
cosmwasm/wasmd:v0.12.1 wasmd \
154+
cosmwasm/wasmd:v0.14.0 wasmd \
154155
query staking validators
155156
VALIDATOR=......
156157

157158
# and stake here
158159
docker run --rm -it \
159160
--mount type=volume,source=musselnet_client,target=/root \
160161
--network=host \
161-
cosmwasm/wasmd:v0.12.1 wasmd \
162+
cosmwasm/wasmd:v0.14.0 wasmd \
162163
tx staking delegate $VALIDATOR 750000000ustake \
163164
--from validator --chain-id testing
164165
```
@@ -178,7 +179,7 @@ you put in your handler):
178179
docker run --rm -it \
179180
--mount type=volume,source=musselnet_client,target=/root \
180181
--network=host \
181-
cosmwasm/wasmd:v0.12.1 wasmd \
182+
cosmwasm/wasmd:v0.14.0 wasmd \
182183
tx gov submit-proposal software-upgrade musselnet-v2 \
183184
--upgrade-height=500 --deposit=10000000ustake \
184185
--title="Upgrade" --description="Upgrade to musselnet-v2" \
@@ -188,22 +189,22 @@ docker run --rm -it \
188189
docker run --rm -it \
189190
--mount type=volume,source=musselnet_client,target=/root \
190191
--network=host \
191-
cosmwasm/wasmd:v0.12.1 wasmd \
192+
cosmwasm/wasmd:v0.14.0 wasmd \
192193
query gov proposal 1
193194

194195
# vote for it
195196
docker run --rm -it \
196197
--mount type=volume,source=musselnet_client,target=/root \
197198
--network=host \
198-
cosmwasm/wasmd:v0.12.1 wasmd \
199+
cosmwasm/wasmd:v0.14.0 wasmd \
199200
tx gov vote 1 yes \
200201
--from validator --chain-id testing
201202

202203
# ensure vote was counted
203204
docker run --rm -it \
204205
--mount type=volume,source=musselnet_client,target=/root \
205206
--network=host \
206-
cosmwasm/wasmd:v0.12.1 wasmd \
207+
cosmwasm/wasmd:v0.14.0 wasmd \
207208
query gov votes 1
208209
```
209210

@@ -216,24 +217,24 @@ Now, we just wait about 5 minutes for the vote to pass, and ensure it is passed:
216217
docker run --rm -it \
217218
--mount type=volume,source=musselnet_client,target=/root \
218219
--network=host \
219-
cosmwasm/wasmd:v0.12.1 wasmd \
220+
cosmwasm/wasmd:v0.14.0 wasmd \
220221
query gov proposal 1
221222
```
222223

223224
After this, we just let the chain run and open the terminal so you can see the log files.
224225
It should keep producing blocks until it hits height 500 (or whatever you set there),
225226
when the process will print a huge stacktrace and hang. Immediately before the stack trace, you
226-
should see a line like:
227+
should see a line like this (burried under tons of tendermint logs):
227228

228-
`E[2021-01-07|20:02:20.508] UPGRADE "musselnet-v2" NEEDED at height: 500: module=main `
229+
`8:50PM ERR UPGRADE "musselnet-v2" NEEDED at height: 100:`
229230

230231
Kill it with Ctrl-C, and then try to restart with the pre-upgrade version and it should
231-
immediately fail on startup, with the same error message as above:
232+
immediately fail on startup, with the same error message as above.
232233

233234
```sh
234235
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
235236
--mount type=volume,source=musselnet,target=/root \
236-
cosmwasm/wasmd:v0.12.1 /opt/run_wasmd.sh
237+
cosmwasm/wasmd:v0.14.0 /opt/run_wasmd.sh
237238
```
238239

239240
Then, we start with the post-upgrade version and see it properly update:
@@ -248,39 +249,6 @@ On a real network, operators will have to be awake when the upgrade plan is acti
248249
and manually perform this switch, or use some automated tooling like
249250
[cosmosvisor](https://github.com/cosmos/cosmos-sdk/blob/master/cosmovisor/README.md).
250251

251-
**WARNING** the described path above will fail. There is some breaking changes we do
252-
not handle. Here is the error message when starting the new chain:
253-
254-
```
255-
$ docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
256-
> --mount type=volume,source=musselnet,target=/root \
257-
> wasmd:musselnet-v2 /opt/run_wasmd.sh
258-
259-
8:04PM INF starting ABCI with Tendermint
260-
8:04PM INF Starting multiAppConn service impl={"Logger":{}} module=proxy
261-
8:04PM INF Starting localClient service connection=query impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
262-
8:04PM INF Starting localClient service connection=snapshot impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
263-
8:04PM INF Starting localClient service connection=mempool impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
264-
8:04PM INF Starting localClient service connection=consensus impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
265-
8:04PM INF Starting EventBus service impl={"Logger":{}} module=events
266-
8:04PM INF Starting PubSub service impl={"Logger":{}} module=pubsub
267-
8:04PM INF Starting IndexerService service impl={"Logger":{}} module=txindex
268-
8:04PM INF ABCI Handshake App Info hash=BF31EF7E9B8D1273E338C7C1CF2A21EA878DC9E6195ECE3289C0D35DC5582F03 height=499 module=consensus protocol-version=0 software-version=
269-
8:04PM INF ABCI Replay Blocks appHeight=499 module=consensus stateHeight=499 storeHeight=500
270-
8:04PM INF Replay last block using real app module=consensus
271-
8:04PM INF applying upgrade "musselnet-v2" at height: 500
272-
8:04PM INF minted coins from module account amount=41ustake from=mint module=x/bank
273-
panic: Validator consensus-address wasmvalcons1r0lklmvxkhf7lwcjeeqp5vf68mlvqk2wwmg7l0 not found
274-
275-
goroutine 1 [running]:
276-
github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper.HandleValidatorSignature(0x295c3c0, 0xc0001151f0, 0x2993580, 0xc000694190, 0x298dc20, 0xc00023e480, 0x29810c0, 0xc00018b5c0, 0x297ce00, 0xc000042038, ...)
277-
github.com/cosmos/cosmos-sdk@v0.40.0-rc6/x/slashing/keeper/infractions.go:19 +0x22d7
278-
github.com/cosmos/cosmos-sdk/x/slashing.BeginBlocker(0x297ce00, 0xc000042038, 0x2992f00, 0xc0011320c0, 0xb, 0x0, 0xc0004dec58, 0x7, 0x1f4, 0x1a385af2, ...)
279-
github.com/cosmos/cosmos-sdk@v0.40.0-rc6/x/slashing/abci.go:23 +0x287
280-
github.com/cosmos/cosmos-sdk/x/slashing.AppModule.BeginBlock(...)
281-
github.com/cosmos/cosmos-sdk@v0.40.0-rc6/x/slashing/module.go:164
282-
```
283-
284252
## Check final state
285253

286254
Now that we have upgraded, we can use the new client version. Let's do a brief

0 commit comments

Comments
 (0)