Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to SDK 0.46.14, ibc-go 6.2.0, latest gravity #237

Merged
merged 31 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9b75390
WIP - gravity mod update
EricBolten Dec 10, 2023
3d99161
Remove rest clients
EricBolten Dec 10, 2023
d785a6b
mod tidy and extraneous rest reference in auction
EricBolten Dec 10, 2023
af79c29
WIP - axelar fixes, upgrade stuff, SDK bump
EricBolten Dec 11, 2023
3d6c9ab
Fix cork mocks for updated staking API
EricBolten Dec 11, 2023
d852531
Fix no-longer compiling v6 upgrade
EricBolten Dec 11, 2023
6108d73
Fix cork keeper mocks package
EricBolten Dec 11, 2023
bfaa499
update cmd
EricBolten Dec 11, 2023
d36af6f
x/auction compiles
EricBolten Dec 11, 2023
efedcf5
x/axelarcork mostly compiles
EricBolten Dec 11, 2023
5b5f875
remove RegisterRESTRoutes
EricBolten Dec 11, 2023
b8ee146
x/cellarfees compiles
EricBolten Dec 11, 2023
d71e9dc
x/incentives compiles
EricBolten Dec 11, 2023
e1bc31f
x/pubsub compiles, fix proposal init()
EricBolten Dec 11, 2023
3161573
x/cork mostly compiles
EricBolten Dec 11, 2023
e83c42c
Fix staking mocks in x/cork
EricBolten Dec 11, 2023
71ba357
Fix axelarcork mocks
EricBolten Dec 12, 2023
2242515
Fix return type for SendPacket in test mock
EricBolten Dec 12, 2023
d1f102a
integration tests compile
EricBolten Dec 12, 2023
e245f7e
remove strconv and extraneous tests from cork cli
EricBolten Dec 12, 2023
3b66e7f
fix erroneous use of sdkerrors.New
EricBolten Dec 12, 2023
4d6667b
add missing expected mock in axelarcork
EricBolten Dec 12, 2023
e75e176
Update gravity deps to latest
EricBolten Dec 12, 2023
a811bb6
Update orchestrator image, TODO in v7 upgrade
EricBolten Dec 12, 2023
70ade73
Try latest version of golangci-lint
EricBolten Dec 12, 2023
7cebb4e
fix scheduled cork integration test
EricBolten Dec 12, 2023
1b66fb9
update sdkerrors wrap/register calls to errorsmod
EricBolten Dec 12, 2023
16291e9
more lint errors fixes in integration tests
EricBolten Dec 12, 2023
7fa41f6
remove deprecated functionality from cork test env
EricBolten Dec 12, 2023
807887b
fix old references to sdk.Int
EricBolten Dec 12, 2023
ca2486c
ioutil -> os
EricBolten Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
packages: write
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- name: checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
Expand Down Expand Up @@ -127,10 +127,10 @@ jobs:
"Incentives",
]
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19
- name: checkout
uses: actions/checkout@v2
- name: go-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: '1.18'
go-version: '1.19'

- run: echo ":rocket::rocket::rocket:" > ../release_notes.md
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.18]
go-version: [1.19]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ tools-clean:
# Integration tests #
#####################

ORCHESTRATOR_IMAGE := "ghcr.io/peggyjv/gravity-bridge-orchestrator:v2.0.4"
ORCHESTRATOR_IMAGE := "ghcr.io/peggyjv/gravity-bridge-orchestrator:main"

e2e_build_images: e2e_clean_slate
@docker pull $(ORCHESTRATOR_IMAGE)
Expand Down
150 changes: 78 additions & 72 deletions app/app.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v3/x/gravity/types"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v4/x/gravity/types"
cellarfeestypes "github.com/peggyjv/sommelier/v7/x/cellarfees/types"
corktypes "github.com/peggyjv/sommelier/v7/x/cork/types"
)
Expand Down
16 changes: 8 additions & 8 deletions app/upgrades/v6/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ica "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts"
icacontrollertypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
)

func CreateUpgradeHandler(
Expand All @@ -38,8 +38,8 @@ func CreateUpgradeHandler(
sdk.MsgTypeURL(&distrtypes.MsgWithdrawDelegatorReward{}),
sdk.MsgTypeURL(&distrtypes.MsgWithdrawValidatorCommission{}),
sdk.MsgTypeURL(&distrtypes.MsgFundCommunityPool{}),
sdk.MsgTypeURL(&govtypes.MsgVote{}),
sdk.MsgTypeURL(&govtypes.MsgVoteWeighted{}),
sdk.MsgTypeURL(&govtypesv1beta1.MsgVote{}),
sdk.MsgTypeURL(&govtypesv1beta1.MsgVoteWeighted{}),
sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgUndelegate{}),
sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}),
Expand Down
12 changes: 12 additions & 0 deletions app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icahostkeeper "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types"
auctionkeeper "github.com/peggyjv/sommelier/v7/x/auction/keeper"
auctiontypes "github.com/peggyjv/sommelier/v7/x/auction/types"
cellarfeeskeeper "github.com/peggyjv/sommelier/v7/x/cellarfees/keeper"
Expand All @@ -17,11 +19,18 @@ func CreateUpgradeHandler(
configurator module.Configurator,
auctionKeeper auctionkeeper.Keeper,
cellarfeesKeeper cellarfeeskeeper.Keeper,
icaHostKeeper icahostkeeper.Keeper,
pubsubKeeper pubsubkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("v7 upgrade: entering handler")

// TODO(bolten): get a sanity check on this
// Now that we're on IBC V6, we can update the ICA host module to allow all message types rather than
// the list we specified in the v6 upgrade -- a default of HostEnabled: true and the string "*" for messages
icaParams := icahosttypes.DefaultParams()
icaHostKeeper.SetParams(ctx, icaParams)
EricBolten marked this conversation as resolved.
Show resolved Hide resolved

// We must manually run InitGenesis for pubsub and auctions so we can adjust their values
// during the upgrade process. RunMigrations will migrate to the new cork version. Setting the consensus
// version to 1 prevents RunMigrations from running InitGenesis itself.
Expand All @@ -33,12 +42,15 @@ func CreateUpgradeHandler(
ctx.Logger().Info("v7 upgrading: setting cellarfees default params")
cellarfeesKeeper.SetParams(ctx, cellarfeestypes.DefaultParams())

//TODO(bolten): verify that the default params are fine or if we need to customize them for auction and pubsub
ctx.Logger().Info("v7 upgrade: initializing auction genesis state")
auctionInitGenesis(ctx, auctionKeeper)

ctx.Logger().Info("v7 upgrade: initializing pubsub genesis state")
pubsubInitGenesis(ctx, pubsubKeeper)

//TODO(bolten): axelarcork module initialization

ctx.Logger().Info("v7 upgrade: running migrations and exiting handler")
return mm.RunMigrations(ctx, configurator, fromVM)
}
Expand Down
49 changes: 12 additions & 37 deletions cmd/sommelier/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package cmd
import (
"io"
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/debug"
Expand All @@ -15,8 +13,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"github.com/cosmos/cosmos-sdk/x/auth/types"
Expand All @@ -26,11 +22,12 @@ import (
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/spf13/cast"
"github.com/spf13/cobra"
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

bridgecmd "github.com/peggyjv/gravity-bridge/module/v3/cmd/gravity/cmd"
bridgecmd "github.com/peggyjv/gravity-bridge/module/v4/cmd/gravity/cmd"
"github.com/peggyjv/sommelier/v7/app"
"github.com/peggyjv/sommelier/v7/app/params"
)
Expand Down Expand Up @@ -72,7 +69,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return err
}

return server.InterceptConfigsPreRunHandler(cmd, "", nil)
return server.InterceptConfigsPreRunHandler(cmd, "", nil, tmcfg.DefaultConfig())
},
}

Expand Down Expand Up @@ -178,49 +175,27 @@ func txCommand() *cobra.Command {
}

func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application {
var cache sdk.MultiStorePersistentCache

if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) {
cache = store.NewCommitKVStoreCacheManager()
}

skipUpgradeHeights := make(map[int64]bool)
for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
skipUpgradeHeights[int64(h)] = true
}

pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts)
if err != nil {
panic(err)
}

snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
if err != nil {
panic(err)
}
snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir)
if err != nil {
panic(err)
}
// TODO(bolten): sanity check this update
// appears to do exactly the same things we were manually doing before, and also
// includes new baseapp options:
//
// baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(FlagIAVLCacheSize))),
// baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(FlagDisableIAVLFastNode))),
// baseapp.SetIAVLLazyLoading(cast.ToBool(appOpts.Get(FlagIAVLLazyLoading))),
baseappOptions := server.DefaultBaseappOptions(appOpts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only one I couldn't find (in this file) a mapping for was SetQueryGasLimit, which is in the new defaults, but other than that it seems correct to me.


return app.NewSommelierApp(
logger, db, traceStore, true, skipUpgradeHeights,
cast.ToString(appOpts.Get(flags.FlagHome)),
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
app.MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd.
appOpts,
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))),
baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))),
baseapp.SetInterBlockCache(cache),
baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))),
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
baseapp.SetSnapshotStore(snapshotStore),
baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))),
baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))),
baseappOptions...,
)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/sommelier/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func InitTestnet(
memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip)
genFiles = append(genFiles, nodeConfig.GenesisFile())

kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf)
kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf, clientCtx.Codec)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/sommelier/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func main() {
rootCmd, _ := cmd.NewRootCmd()
if err := scmd.Execute(rootCmd, app.DefaultNodeHome); err != nil {
if err := scmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
switch e := err.(type) {
case server.ErrorCode:
os.Exit(e.Code)
Expand Down
Loading
Loading