Skip to content

Commit

Permalink
chore: update module to gaia v11 (#2515)
Browse files Browse the repository at this point in the history
* update module to gaia v11

* update go.mod

* update globalfee.md

* fix: provider keeper

* fix: upgrade test in CI

* revert to ics v1.1.1

* tidy CI upgrade test scripts

* chore: add v10 upgrades

* fix: lint

* fix: version in app.go

* test: improve test
  • Loading branch information
yaruwangway authored May 26, 2023
1 parent 62a283d commit fde8b73
Show file tree
Hide file tree
Showing 57 changed files with 281 additions and 93 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,41 +124,37 @@ jobs:
go.sum
- uses: actions/setup-go@v4
with:
go-version: 1.18
- name: Install GaiaV9
go-version: 1.20.x
- name: Install GaiaV10
run: |
git checkout v9.1.0
git checkout v10.0.0
make build
cp ./build/gaiad ./build/gaiad9
cp ./build/gaiad ./build/gaiad10
go clean -modcache
if: env.GIT_DIFF
- uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Install GaiaV10
- name: Install GaiaV11
run: |
git checkout -
make build
cp ./build/gaiad ./build/gaiad10
cp ./build/gaiad ./build/gaiad11
if: env.GIT_DIFF
- name: Install Cosmovisor
run: |
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
if: env.GIT_DIFF
- name: Start GaiaV9
- name: Start GaiaV10
run: |
go env GOPATH
./contrib/scripts/run-gaia-v9.sh
./contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh
if: env.GIT_DIFF
- name: Submit Upgrade Commands
run: |
./contrib/scripts/run-upgrade-commands-v10.sh 15
./contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh 15
if: env.GIT_DIFF
- name: Check for successful upgrade
run: |
./contrib/scripts/test_upgrade.sh 20 5 16 localhost
./contrib/scripts/upgrade_test_scripts/test_upgrade.sh 20 5 16 localhost
if: env.GIT_DIFF
- name: Check for successful migration
run: |
./contrib/scripts/test_migration.sh localhost
if: env.GIT_DIFF
./contrib/scripts/upgrade_test_scripts/v11/test_migration_v11.sh localhost
2 changes: 1 addition & 1 deletion ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

gaiafeeante "github.com/cosmos/gaia/v10/x/globalfee/ante"
gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
6 changes: 3 additions & 3 deletions ante/gov_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
tmrand "github.com/tendermint/tendermint/libs/rand"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/gaia/v10/ante"
gaiahelpers "github.com/cosmos/gaia/v10/app/helpers"
"github.com/cosmos/gaia/v11/ante"
gaiahelpers "github.com/cosmos/gaia/v11/app/helpers"

gaiaapp "github.com/cosmos/gaia/v10/app"
gaiaapp "github.com/cosmos/gaia/v11/app"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

gaiaante "github.com/cosmos/gaia/v10/ante"
"github.com/cosmos/gaia/v10/app/keepers"
gaiaappparams "github.com/cosmos/gaia/v10/app/params"
"github.com/cosmos/gaia/v10/app/upgrades"
v10 "github.com/cosmos/gaia/v10/app/upgrades/v10"
"github.com/cosmos/gaia/v10/x/globalfee"
gaiaante "github.com/cosmos/gaia/v11/ante"
"github.com/cosmos/gaia/v11/app/keepers"
gaiaappparams "github.com/cosmos/gaia/v11/app/params"
"github.com/cosmos/gaia/v11/app/upgrades"
v11 "github.com/cosmos/gaia/v11/app/upgrades/v11"
"github.com/cosmos/gaia/v11/x/globalfee"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
Expand All @@ -53,7 +53,7 @@ var (
// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string

Upgrades = []upgrades.Upgrade{v10.Upgrade}
Upgrades = []upgrades.Upgrade{v11.Upgrade}
)

var (
Expand Down
4 changes: 2 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"

gaia "github.com/cosmos/gaia/v10/app"
gaiahelpers "github.com/cosmos/gaia/v10/app/helpers"
gaia "github.com/cosmos/gaia/v11/app"
gaiahelpers "github.com/cosmos/gaia/v11/app/helpers"
)

type EmptyAppOptions struct{}
Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gaia
import (
"github.com/cosmos/cosmos-sdk/std"

"github.com/cosmos/gaia/v10/app/params"
"github.com/cosmos/gaia/v11/app/params"
)

// MakeTestEncodingConfig creates an EncodingConfig for testing. This function
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

gaiaapp "github.com/cosmos/gaia/v10/app"
gaiaapp "github.com/cosmos/gaia/v11/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import (
routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v4/router/keeper"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"

"github.com/cosmos/gaia/v10/x/globalfee"
"github.com/cosmos/gaia/v11/x/globalfee"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
Expand Down
4 changes: 2 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ import (
"github.com/strangelove-ventures/packet-forward-middleware/v4/router"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"

gaiaappparams "github.com/cosmos/gaia/v10/app/params"
"github.com/cosmos/gaia/v10/x/globalfee"
gaiaappparams "github.com/cosmos/gaia/v11/app/params"
"github.com/cosmos/gaia/v11/x/globalfee"
)

var maccPerms = map[string][]string{
Expand Down
2 changes: 1 addition & 1 deletion app/sim/sim_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"

gaia "github.com/cosmos/gaia/v10/app"
gaia "github.com/cosmos/gaia/v11/app"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
Expand Down
2 changes: 1 addition & 1 deletion app/sim/sim_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

gaia "github.com/cosmos/gaia/v10/app"
gaia "github.com/cosmos/gaia/v11/app"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp/helpers"
Expand Down
8 changes: 4 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

gaia "github.com/cosmos/gaia/v10/app"
"github.com/cosmos/gaia/v10/app/helpers"
"github.com/cosmos/gaia/v10/app/params"
"github.com/cosmos/gaia/v10/app/sim"
gaia "github.com/cosmos/gaia/v11/app"
"github.com/cosmos/gaia/v11/app/helpers"
"github.com/cosmos/gaia/v11/app/params"
"github.com/cosmos/gaia/v11/app/sim"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/cosmos/gaia/v10/app/keepers"
"github.com/cosmos/gaia/v11/app/keepers"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v10/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v10

import (
"github.com/cosmos/gaia/v10/app/upgrades"
"github.com/cosmos/gaia/v11/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v10/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/cosmos/gaia/v10/app/keepers"
"github.com/cosmos/gaia/v11/app/keepers"
)

func CreateUpgradeHandler(
Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/v11/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v11

import (
"github.com/cosmos/gaia/v11/app/upgrades"
)

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v11"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
}
27 changes: 27 additions & 0 deletions app/upgrades/v11/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package v11

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/cosmos/gaia/v11/app/keepers"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Starting module migrations...")

vm, err := mm.RunMigrations(ctx, configurator, vm)
if err != nil {
return vm, err
}

ctx.Logger().Info("Upgrade complete")
return vm, err
}
}
2 changes: 1 addition & 1 deletion app/upgrades/v7/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
store "github.com/cosmos/cosmos-sdk/store/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"

"github.com/cosmos/gaia/v10/app/upgrades"
"github.com/cosmos/gaia/v11/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"

"github.com/cosmos/gaia/v10/app/keepers"
"github.com/cosmos/gaia/v11/app/keepers"
)

func CreateUpgradeHandler(
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v8/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package v8
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/cosmos/gaia/v10/app/upgrades"
"github.com/cosmos/gaia/v10/x/globalfee"
"github.com/cosmos/gaia/v11/app/upgrades"
"github.com/cosmos/gaia/v11/x/globalfee"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"

"github.com/cosmos/gaia/v10/app/keepers"
"github.com/cosmos/gaia/v11/app/keepers"
)

func FixBankMetadata(ctx sdk.Context, keepers *keepers.AppKeepers) error {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
store "github.com/cosmos/cosmos-sdk/store/types"
ccvprovider "github.com/cosmos/interchain-security/x/ccv/provider/types"

"github.com/cosmos/gaia/v10/app/upgrades"
"github.com/cosmos/gaia/v11/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/cosmos/gaia/v10/app/keepers"
"github.com/cosmos/gaia/v11/app/keepers"
)

func CreateUpgradeHandler(
Expand Down
2 changes: 1 addition & 1 deletion cmd/gaiad/cmd/bech32_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

addressutil "github.com/cosmos/gaia/v10/pkg/address"
addressutil "github.com/cosmos/gaia/v11/pkg/address"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

gaia "github.com/cosmos/gaia/v10/app"
"github.com/cosmos/gaia/v10/app/params"
gaia "github.com/cosmos/gaia/v11/app"
"github.com/cosmos/gaia/v11/app/params"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
4 changes: 2 additions & 2 deletions cmd/gaiad/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/stretchr/testify/require"

app "github.com/cosmos/gaia/v10/app"
"github.com/cosmos/gaia/v10/cmd/gaiad/cmd"
app "github.com/cosmos/gaia/v11/app"
"github.com/cosmos/gaia/v11/cmd/gaiad/cmd"
)

func TestRootCmdConfig(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gaiad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

app "github.com/cosmos/gaia/v10/app"
"github.com/cosmos/gaia/v10/cmd/gaiad/cmd"
app "github.com/cosmos/gaia/v11/app"
"github.com/cosmos/gaia/v11/cmd/gaiad/cmd"
)

func main() {
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion contrib/scripts/run-gaia-v9.sh → ...s/upgrade_test_scripts/v10/run_gaia_v9.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ pwd
ls $NODE_HOME

$COSMOVISOR run start --home $NODE_HOME --x-crisis-skip-assert-invariants > v9.out 2>&1 &

Loading

0 comments on commit fde8b73

Please sign in to comment.