Skip to content

Commit c0722dc

Browse files
committed
feat(upgrade): setup upgrade info for v2.0.0
Signed-off-by: Artur Troian <[email protected]>
1 parent e566877 commit c0722dc

File tree

14 files changed

+258
-200
lines changed

14 files changed

+258
-200
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ require (
4747
google.golang.org/grpc v1.75.0
4848
gopkg.in/yaml.v3 v3.0.1
4949
gotest.tools/v3 v3.5.2
50-
pkg.akt.dev/go v0.1.6-rc1
51-
pkg.akt.dev/go/cli v0.1.5-rc1
50+
pkg.akt.dev/go v0.1.6-rc3
51+
pkg.akt.dev/go/cli v0.1.5-rc3
5252
pkg.akt.dev/go/sdl v0.1.1
5353
)
5454

@@ -61,7 +61,7 @@ replace (
6161
// use akash fork of cometbft
6262
github.com/cometbft/cometbft => github.com/akash-network/cometbft v0.38.19-akash.1
6363
// use akash fork of cosmos sdk
64-
github.com/cosmos/cosmos-sdk => github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10
64+
github.com/cosmos/cosmos-sdk => github.com/akash-network/cosmos-sdk v0.53.4-akash.10
6565

6666
github.com/cosmos/gogoproto => github.com/akash-network/gogoproto v1.7.0-akash.2
6767

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,8 @@ github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3
12851285
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
12861286
github.com/akash-network/cometbft v0.38.19-akash.1 h1:am45M/0vjs1FEwh1WiLv/cp92Yskj2Dls997phjnxso=
12871287
github.com/akash-network/cometbft v0.38.19-akash.1/go.mod h1:UCu8dlHqvkAsmAFmWDRWNZJPlu6ya2fTWZlDrWsivwo=
1288-
github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10 h1:zPQVFSuBQKE3orKGgePPLU6eWn7kTAMCfuqFFa1Gc3Y=
1289-
github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10/go.mod h1:gZcyUJu6h94FfxgJbuBpiW7RPCFEV/+GJdy4UAJ3Y1Q=
1288+
github.com/akash-network/cosmos-sdk v0.53.4-akash.10 h1:8XyxL+VfqkdVYaDudk4lrNX9vH/n3JxRizcLQlUiC/o=
1289+
github.com/akash-network/cosmos-sdk v0.53.4-akash.10/go.mod h1:gZcyUJu6h94FfxgJbuBpiW7RPCFEV/+GJdy4UAJ3Y1Q=
12901290
github.com/akash-network/gogoproto v1.7.0-akash.2 h1:zY5seM6kBOLMBWn15t8vrY1ao4J1HjrhNaEeO/Soro0=
12911291
github.com/akash-network/gogoproto v1.7.0-akash.2/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
12921292
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -3282,10 +3282,10 @@ nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y=
32823282
nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
32833283
pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA=
32843284
pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
3285-
pkg.akt.dev/go v0.1.6-rc1 h1:Bl1/tSPAyUnpPl/rv13pZqAZYp/a5ZNRbIOk6eSFRlw=
3286-
pkg.akt.dev/go v0.1.6-rc1/go.mod h1:lKU6b+hR+LAWslGemTYg8raiBHru4K1jolk+LDUU57Y=
3287-
pkg.akt.dev/go/cli v0.1.5-rc1 h1:g6AuRfwPZA0FpHo02tSeQvdLhvszRHoGb3VUdpgpoak=
3288-
pkg.akt.dev/go/cli v0.1.5-rc1/go.mod h1:G2PaN/gYDVDUuTF0TzQcQgx9Tn1iIx3Ca3kIF61sY2M=
3285+
pkg.akt.dev/go v0.1.6-rc3 h1:7w0TyrMLAJH7hOWTHOjCH69Ofh93DYWoSSeZWs1uG7E=
3286+
pkg.akt.dev/go v0.1.6-rc3/go.mod h1:XAwgUugjjoSqiUNM3Ph/jZMZxDbo6fhJpZlEk5XRmOk=
3287+
pkg.akt.dev/go/cli v0.1.5-rc3 h1:82X7H8LuSTftog1N70Zw4duwLMCGhUZHUsD19LhYcVE=
3288+
pkg.akt.dev/go/cli v0.1.5-rc3/go.mod h1:AJinKcxEzo/YTxvEcvQOnCoHeGXQh8FfZePy8Q3aJnc=
32893289
pkg.akt.dev/go/sdl v0.1.1 h1:3CcAqWeKouFlvUSjQMktWLDqftOjn4cBX37TRFT7BRM=
32903290
pkg.akt.dev/go/sdl v0.1.1/go.mod h1:ADsH8/kh61tWTax8nV0utelOaKWfU3qbG+OT3v9nmeY=
32913291
pkg.akt.dev/specs v0.0.1 h1:OP0zil3Fr4kcCuybFqQ8LWgSlSP2Yn7306meWpu6/S4=

make/test-upgrade.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ UPGRADE_FROM := $(shell cat $(ROOT_DIR)/meta.json | jq -r --arg name
2121
GENESIS_BINARY_VERSION := $(shell cat $(ROOT_DIR)/meta.json | jq -r --arg name $(UPGRADE_TO) '.upgrades[$$name].from_binary' | tr -d '\n')
2222
UPGRADE_BINARY_VERSION ?= local
2323

24-
SNAPSHOT_SOURCE ?= sandbox1
24+
SNAPSHOT_SOURCE ?= sandbox
2525

2626
ifeq ($(SNAPSHOT_SOURCE),mainnet)
2727
SNAPSHOT_NETWORK := akashnet-2
2828
CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/mainnet/meta.json
2929
else ifeq ($(SNAPSHOT_SOURCE),sandbox)
3030
SNAPSHOT_NETWORK := sandbox-2
3131
CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/sandbox-2/meta.json
32-
else ifeq ($(SNAPSHOT_SOURCE),sandbox1)
33-
SNAPSHOT_NETWORK := sandbox-01
34-
CHAIN_METADATA_URL := https://raw.githubusercontent.com/akash-network/net/master/sandbox/meta.json
3532
else
3633
$(error "invalid snapshot source $(SNAPSHOT_SOURCE)")
3734
endif
@@ -67,6 +64,7 @@ test: init
6764
$(GO_TEST) -run "^\QTestUpgrade\E$$" -tags e2e.upgrade -timeout 180m -v -args \
6865
-cosmovisor=$(COSMOVISOR) \
6966
-workdir=$(AP_RUN_DIR)/validators \
67+
-sourcesdir=$(AKASH_ROOT) \
7068
-config=$(TEST_CONFIG) \
7169
-upgrade-name=$(UPGRADE_TO) \
7270
-upgrade-version="$(UPGRADE_BINARY_VERSION)" \
@@ -75,7 +73,7 @@ test: init
7573
.PHONY: test-reset
7674
test-reset:
7775
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) clean
78-
#$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins
76+
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --gbv=$(GENESIS_BINARY_VERSION) --chain-meta=$(CHAIN_METADATA_URL) bins
7977
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --uto=$(UPGRADE_TO) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) keys
8078
$(ROOT_DIR)/script/upgrades.sh --workdir=$(AP_RUN_DIR) --config="$(PWD)/config.json" --state-config=$(STATE_CONFIG) --snapshot-url=$(SNAPSHOT_URL) --chain-meta=$(CHAIN_METADATA_URL) --max-validators=$(MAX_VALIDATORS) prepare-state
8179

meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
"skipped": false,
4545
"from_binary": "v0.38.6-rc2",
4646
"from_version": "v0.38.0"
47+
},
48+
"v2.0.0": {
49+
"skipped": false,
50+
"from_binary": "v1.0.3-rc4",
51+
"from_version": "v1.0.0"
4752
}
4853
}
4954
}

script/upgrades.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ function prepare_state() {
548548
valjson=$(cat "$valdir/validator.json")
549549
if [[ $cnt -gt 0 ]]; then
550550
if [[ $($semver compare "$akashversion" v1.0.0-rc0) -ge 0 ]]; then
551-
$AKASH tx staking create-validator "$valjson" --home="$rvaldir" --from="validator$cnt" --yes
551+
$AKASH tx staking create-validator "$valdir/validator.json" --home="$rvaldir" --from="validator$cnt" --yes
552552
else
553553
$AKASH tx staking create-validator \
554554
--home="$rvaldir" \

tests/upgrade/config-v0.24.0.tmpl.json

Lines changed: 0 additions & 41 deletions
This file was deleted.

tests/upgrade/sdktypes.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package upgrade
2+
3+
import (
4+
"encoding/json"
5+
6+
upgradetypes "cosmossdk.io/x/upgrade/types"
7+
sdk "github.com/cosmos/cosmos-sdk/types"
8+
)
9+
10+
// These files defines sdk specific types necessary to perform upgrade simulation.
11+
// we're not using SDK generated types to prevent import of different types of cosmos sdk
12+
13+
type nodeStatus struct {
14+
SyncInfo struct {
15+
LatestBlockHeight string `json:"latest_block_height"`
16+
CatchingUp bool `json:"catching_up"`
17+
} `json:"sync_info"`
18+
}
19+
20+
type votingParams struct {
21+
VotingPeriod string `json:"voting_period"`
22+
}
23+
24+
type depositParams struct {
25+
MinDeposit sdk.Coins `json:"min_deposit"`
26+
}
27+
28+
type govParams struct {
29+
VotingParams votingParams `json:"voting_params"`
30+
DepositParams depositParams `json:"deposit_params"`
31+
}
32+
33+
type proposalResp struct {
34+
ID string `json:"id"`
35+
Title string `json:"title"`
36+
}
37+
38+
type proposalsResp struct {
39+
Proposals []proposalResp `json:"proposals"`
40+
}
41+
42+
type SoftwareUpgradeProposal struct {
43+
Type string `json:"@type"`
44+
Authority string `json:"authority"`
45+
Plan upgradetypes.Plan `json:"plan"`
46+
}
47+
48+
type ProposalMsg struct {
49+
// Msgs defines an array of sdk.Msgs proto-JSON-encoded as Anys.
50+
Messages []json.RawMessage `json:"messages,omitempty"`
51+
Metadata string `json:"metadata"`
52+
Deposit string `json:"deposit"`
53+
Title string `json:"title"`
54+
Summary string `json:"summary"`
55+
Expedited bool `json:"expedited"`
56+
}

tests/upgrade/test-cases.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2+
"v2.0.0": {
3+
"modules": {
4+
"added": [
5+
"wasm",
6+
"awasm"
7+
]
8+
}
9+
},
210
"v1.0.0": {
311
"modules": {
412
"added": [

tests/upgrade/test-config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"chain-id": "localakash",
33
"validators": [
4-
".akash0",
5-
".akash1"
4+
".akash0"
65
],
76
"work": {
87
"home": ".akash0",
176 KB
Binary file not shown.

0 commit comments

Comments
 (0)