@@ -21,8 +21,7 @@ We need to have two different versions of `wasmd` which depend on state-compatib
21
21
versions of the Cosmos SDK. We only focus on upgrade starting with stargate. You will
22
22
have to use the "dump state and restart" approach to move from launchpad to stargate.
23
23
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.
26
25
27
26
### Handler
28
27
@@ -42,7 +41,9 @@ Let's get the two binaries we want to test, the pre-upgrade and the post-upgrade
42
41
binaries. In this case the pre-release is already a published to docker hub and
43
42
can be downloaded simply via:
44
43
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)
46
47
47
48
The post-release is not published, so we can build it ourselves. Check out this
48
49
` wasmd ` repo, and the proper ` musselnet ` branch:
@@ -56,7 +57,7 @@ docker build . -t wasmd:musselnet-v2
56
57
Verify they are both working for you locally:
57
58
58
59
```
59
- docker run cosmwasm/wasmd:v0.12.1 wasmd version
60
+ docker run cosmwasm/wasmd:v0.14.0 wasmd version
60
61
docker run wasmd:musselnet-v2 wasmd version
61
62
```
62
63
@@ -74,12 +75,12 @@ docker volume rm -f musselnet_client
74
75
docker run --rm -it \
75
76
-e PASSWORD=1234567890 \
76
77
--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
78
79
79
80
# enter "1234567890" when prompted
80
81
docker run --rm -it \
81
82
--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
83
84
# use the address returned above here
84
85
CLIENT=wasm1anavj4eyxkdljp27sedrdlt9dm26c8a7a8p44l
85
86
```
@@ -92,17 +93,17 @@ docker volume rm -f musselnet
92
93
# add your testing address here, so you can do something with the client
93
94
docker run --rm -it \
94
95
--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
96
97
97
98
# Update the voting times in the genesis file
98
99
docker run --rm -it \
99
100
--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
101
102
102
103
# start up the blockchain and all embedded servers as one process
103
104
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
104
105
--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
106
107
```
107
108
108
109
## Sanity checks
@@ -117,25 +118,25 @@ RCPT=wasm1pypadqklna33nv3gl063rd8z9q8nvauaalz820
117
118
docker run --rm -it \
118
119
--mount type=volume,source=musselnet_client,target=/root \
119
120
--network=host \
120
- cosmwasm/wasmd:v0.12.1 wasmd \
121
+ cosmwasm/wasmd:v0.14.0 wasmd \
121
122
query bank balances $CLIENT
122
123
123
124
docker run --rm -it \
124
125
--mount type=volume,source=musselnet_client,target=/root \
125
126
--network=host \
126
- cosmwasm/wasmd:v0.12.1 wasmd \
127
+ cosmwasm/wasmd:v0.14.0 wasmd \
127
128
query bank balances $RCPT
128
129
129
130
docker run --rm -it \
130
131
--mount type=volume,source=musselnet_client,target=/root \
131
132
--network=host \
132
- cosmwasm/wasmd:v0.12.1 wasmd \
133
+ cosmwasm/wasmd:v0.14.0 wasmd \
133
134
tx send validator $RCPT 500000ucosm,600000ustake --chain-id testing
134
135
135
136
docker run --rm -it \
136
137
--mount type=volume,source=musselnet_client,target=/root \
137
138
--network=host \
138
- cosmwasm/wasmd:v0.12.1 wasmd \
139
+ cosmwasm/wasmd:v0.14.0 wasmd \
139
140
query bank balances $RCPT
140
141
```
141
142
@@ -150,15 +151,15 @@ we have > 67% of the voting power and will pass with the validator not voting.
150
151
docker run --rm -it \
151
152
--mount type=volume,source=musselnet_client,target=/root \
152
153
--network=host \
153
- cosmwasm/wasmd:v0.12.1 wasmd \
154
+ cosmwasm/wasmd:v0.14.0 wasmd \
154
155
query staking validators
155
156
VALIDATOR=......
156
157
157
158
# and stake here
158
159
docker run --rm -it \
159
160
--mount type=volume,source=musselnet_client,target=/root \
160
161
--network=host \
161
- cosmwasm/wasmd:v0.12.1 wasmd \
162
+ cosmwasm/wasmd:v0.14.0 wasmd \
162
163
tx staking delegate $VALIDATOR 750000000ustake \
163
164
--from validator --chain-id testing
164
165
```
@@ -178,7 +179,7 @@ you put in your handler):
178
179
docker run --rm -it \
179
180
--mount type=volume,source=musselnet_client,target=/root \
180
181
--network=host \
181
- cosmwasm/wasmd:v0.12.1 wasmd \
182
+ cosmwasm/wasmd:v0.14.0 wasmd \
182
183
tx gov submit-proposal software-upgrade musselnet-v2 \
183
184
--upgrade-height=500 --deposit=10000000ustake \
184
185
--title=" Upgrade" --description=" Upgrade to musselnet-v2" \
@@ -188,22 +189,22 @@ docker run --rm -it \
188
189
docker run --rm -it \
189
190
--mount type=volume,source=musselnet_client,target=/root \
190
191
--network=host \
191
- cosmwasm/wasmd:v0.12.1 wasmd \
192
+ cosmwasm/wasmd:v0.14.0 wasmd \
192
193
query gov proposal 1
193
194
194
195
# vote for it
195
196
docker run --rm -it \
196
197
--mount type=volume,source=musselnet_client,target=/root \
197
198
--network=host \
198
- cosmwasm/wasmd:v0.12.1 wasmd \
199
+ cosmwasm/wasmd:v0.14.0 wasmd \
199
200
tx gov vote 1 yes \
200
201
--from validator --chain-id testing
201
202
202
203
# ensure vote was counted
203
204
docker run --rm -it \
204
205
--mount type=volume,source=musselnet_client,target=/root \
205
206
--network=host \
206
- cosmwasm/wasmd:v0.12.1 wasmd \
207
+ cosmwasm/wasmd:v0.14.0 wasmd \
207
208
query gov votes 1
208
209
```
209
210
@@ -216,24 +217,24 @@ Now, we just wait about 5 minutes for the vote to pass, and ensure it is passed:
216
217
docker run --rm -it \
217
218
--mount type=volume,source=musselnet_client,target=/root \
218
219
--network=host \
219
- cosmwasm/wasmd:v0.12.1 wasmd \
220
+ cosmwasm/wasmd:v0.14.0 wasmd \
220
221
query gov proposal 1
221
222
```
222
223
223
224
After this, we just let the chain run and open the terminal so you can see the log files.
224
225
It should keep producing blocks until it hits height 500 (or whatever you set there),
225
226
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) :
227
228
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: `
229
230
230
231
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.
232
233
233
234
``` sh
234
235
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
235
236
--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
237
238
```
238
239
239
240
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
248
249
and manually perform this switch, or use some automated tooling like
249
250
[ cosmosvisor] ( https://github.com/cosmos/cosmos-sdk/blob/master/cosmovisor/README.md ) .
250
251
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
-
284
252
## Check final state
285
253
286
254
Now that we have upgraded, we can use the new client version. Let's do a brief
0 commit comments