Skip to content

Commit

Permalink
feat: changes app version and imports to v11 (#256)
Browse files Browse the repository at this point in the history
* changes app version and imports to v11

* add v11 upgrade folder and route to main app

* update interchain test upgrade

* fix: remove ictest-haltfork from the CI

---------

Co-authored-by: Max <[email protected]>
  • Loading branch information
puneet2019 and Max authored Nov 28, 2023
1 parent 78140b1 commit 0b67723
Show file tree
Hide file tree
Showing 39 changed files with 84 additions and 71 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ jobs:
- "ictest-ibchooks"
- "ictest-pfm"
- "ictest-lsm"
- "ictest-haltfork"
fail-fast: false

steps:
Expand Down
35 changes: 6 additions & 29 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ import (
pobabci "github.com/skip-mev/pob/abci"
"github.com/skip-mev/pob/mempool"

"github.com/persistenceOne/persistenceCore/v10/app/keepers"
"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
v10 "github.com/persistenceOne/persistenceCore/v10/app/upgrades/v10"
v9_2_0 "github.com/persistenceOne/persistenceCore/v10/app/upgrades/v9.2.0"
"github.com/persistenceOne/persistenceCore/v11/app/keepers"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
v11 "github.com/persistenceOne/persistenceCore/v11/app/upgrades/v11"
)

var (
DefaultNodeHome string
UpgradesMainnet = []upgrades.Upgrade{v10.Upgrade}
UpgradesTestnet = []upgrades.Upgrade{v10.Upgrade}
Upgrades = []upgrades.Upgrade{v11.Upgrade}
ModuleBasics = module.NewBasicManager(keepers.AppModuleBasics...)
)

Expand Down Expand Up @@ -218,16 +216,8 @@ func NewApplication(

// setup postHandler in this method
// app.setupPostHandler()
if app.ChainID() == "test-core-2" {
app.setupUpgradeHandlers(UpgradesTestnet)
app.setupUpgradeStoreLoaders(UpgradesTestnet)
} else if app.ChainID() == "core-1" {
app.setupUpgradeHandlers(UpgradesMainnet)
app.setupUpgradeStoreLoaders(UpgradesMainnet)
} else {
app.setupUpgradeHandlers(UpgradesTestnet)
app.setupUpgradeStoreLoaders(UpgradesTestnet)
}
app.setupUpgradeHandlers(Upgrades)
app.setupUpgradeStoreLoaders(Upgrades)

// must be before Loading version
// requires the snapshot store to be created and registered as a BaseAppOption
Expand Down Expand Up @@ -376,19 +366,6 @@ func (app *Application) LegacyAmino() *codec.LegacyAmino {
}

func (app *Application) BeginBlocker(ctx sdk.Context, req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock {
if ctx.ChainID() == "core-1" && ctx.BlockHeight() == 13263217 {
v9_2_0.Fork(ctx, app.StakingKeeper)
v9_2_0.RemoveMainnetV9_2Prop(ctx, app.UpgradeKeeper)
}

if ctx.ChainID() == "test-core-2" && ctx.BlockHeight() == 1728710 {
v9_2_0.Fork(ctx, app.StakingKeeper)
}

if ctx.ChainID() == "ictest-core-1" {
v9_2_0.Fork(ctx, app.StakingKeeper)
}

return app.moduleManager.BeginBlock(ctx, req)
}

Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
sdkslashing "github.com/cosmos/cosmos-sdk/x/slashing"
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking"

"github.com/persistenceOne/persistenceCore/v10/app/params"
"github.com/persistenceOne/persistenceCore/v11/app/params"
)

// MakeEncodingConfig creates an EncodingConfig for testing
Expand Down
2 changes: 1 addition & 1 deletion app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package app
import (
"encoding/json"

"github.com/persistenceOne/persistenceCore/v10/app/params"
"github.com/persistenceOne/persistenceCore/v11/app/params"
)

// GenesisState of the blockchain is represented here as a map of raw json
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import (
builderkeeper "github.com/skip-mev/pob/x/builder/keeper"
buildertypes "github.com/skip-mev/pob/x/builder/types"

"github.com/persistenceOne/persistenceCore/v10/wasmbindings"
"github.com/persistenceOne/persistenceCore/v11/wasmbindings"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
Expand Down
2 changes: 1 addition & 1 deletion app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import (
"github.com/skip-mev/pob/x/builder"
buildertypes "github.com/skip-mev/pob/x/builder/types"

appparams "github.com/persistenceOne/persistenceCore/v10/app/params"
appparams "github.com/persistenceOne/persistenceCore/v11/app/params"
)

var ModuleAccountPermissions = map[string][]string{
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/persistenceOne/persistenceCore/v10/app/keepers"
"github.com/persistenceOne/persistenceCore/v11/app/keepers"
)

type UpgradeHandlerArgs struct {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v10/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v10
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/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/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
20 changes: 20 additions & 0 deletions app/upgrades/v11/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package v11

import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

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

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{},
},
}
17 changes: 17 additions & 0 deletions app/upgrades/v11/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("running upgrade handler")

return args.ModuleManager.RunMigrations(ctx, args.Configurator, vm)
}
}
2 changes: 1 addition & 1 deletion app/upgrades/v7/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v7
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/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 @@ -5,7 +5,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8.1.0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v8_1_0
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8.1.0/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/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v8/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
liquidstakeibctypes "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"
buildertypes "github.com/skip-mev/pob/x/builder/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v8/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
lscosmostypes "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"
buildertypes "github.com/skip-mev/pob/x/builder/types"

"github.com/persistenceOne/persistenceCore/v10/app/keepers"
"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/keepers"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func setInitialMinCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) error {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9.1.0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v9_1_0
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9.1.0/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/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9.2.0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v9_2_0
import (
store "github.com/cosmos/cosmos-sdk/store/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

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

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v9.2.0/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"testing"

v9_2_0 "github.com/persistenceOne/persistenceCore/v10/app/upgrades/v9.2.0"
v9_2_0 "github.com/persistenceOne/persistenceCore/v11/app/upgrades/v9.2.0"

sdk "github.com/cosmos/cosmos-sdk/types"

Expand All @@ -27,7 +27,7 @@ import (
oracletypes "github.com/persistenceOne/persistence-sdk/v2/x/oracle/types"
"github.com/stretchr/testify/suite"

"github.com/persistenceOne/persistenceCore/v10/app"
"github.com/persistenceOne/persistenceCore/v11/app"
)

type KeeperTestHelper struct {
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"
lscosmostypes "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"

"github.com/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/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/persistenceOne/persistenceCore/v10/app/upgrades"
"github.com/persistenceOne/persistenceCore/v11/app/upgrades"
)

func CreateUpgradeHandler(args upgrades.UpgradeHandlerArgs) upgradetypes.UpgradeHandler {
Expand Down
4 changes: 2 additions & 2 deletions cmd/persistenceCore/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"github.com/spf13/cast"
"github.com/spf13/cobra"

"github.com/persistenceOne/persistenceCore/v10/app"
"github.com/persistenceOne/persistenceCore/v10/app/params"
"github.com/persistenceOne/persistenceCore/v11/app"
"github.com/persistenceOne/persistenceCore/v11/app/params"
)

const flagInvalidCheckPeriod = "invalid-check-period"
Expand Down
2 changes: 1 addition & 1 deletion cmd/persistenceCore/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/persistenceOne/persistenceCore/v10/app"
"github.com/persistenceOne/persistenceCore/v11/app"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/persistenceCore/cmd/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/staking"

"github.com/persistenceOne/persistenceCore/v10/app"
"github.com/persistenceOne/persistenceCore/v11/app"
)

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

"github.com/persistenceOne/persistenceCore/v10/app"
"github.com/persistenceOne/persistenceCore/v10/cmd/persistenceCore/cmd"
"github.com/persistenceOne/persistenceCore/v11/app"
"github.com/persistenceOne/persistenceCore/v11/cmd/persistenceCore/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/persistenceOne/persistenceCore/v10
module github.com/persistenceOne/persistenceCore/v11

go 1.21

Expand Down
6 changes: 3 additions & 3 deletions interchaintest/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

"github.com/persistenceOne/persistenceCore/v10/interchaintest/helpers"
"github.com/persistenceOne/persistenceCore/v11/interchaintest/helpers"
)

const (
Expand All @@ -30,9 +30,9 @@ func TestPersistenceUpgradeBasic(t *testing.T) {
var (
chainName = "persistence"
upgradeRepo = PersistenceCoreImage.Repository
initialVersion = "v9.2.0"
initialVersion = "v10.0.0"
upgradeBranchVersion = PersistenceCoreImage.Version
upgradeName = "v10"
upgradeName = "v11"
)

CosmosChainUpgradeTest(
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/persistenceOne/persistenceCore/v10/interchaintest
module github.com/persistenceOne/persistenceCore/v11/interchaintest

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion interchaintest/lsm_bond_tokenize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"

"github.com/persistenceOne/persistenceCore/v10/interchaintest/helpers"
"github.com/persistenceOne/persistenceCore/v11/interchaintest/helpers"
)

// TestBondTokenize executes scenario of bonding and tokenizing.
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/lsm_halt_fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

"github.com/persistenceOne/persistenceCore/v10/interchaintest/helpers"
"github.com/persistenceOne/persistenceCore/v11/interchaintest/helpers"
)

func TestPersistenceLSMHaltFork(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/lsm_multi_tokenize_vote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/stretchr/testify/require"

"github.com/persistenceOne/persistenceCore/v10/interchaintest/helpers"
"github.com/persistenceOne/persistenceCore/v11/interchaintest/helpers"
)

// TestMultiTokenizeVote case checks what happens with a voting tally when two
Expand Down
Loading

0 comments on commit 0b67723

Please sign in to comment.