Skip to content

Commit

Permalink
chores(deps): bump dependencies cosmos-sdk v0.47.13 (#970)
Browse files Browse the repository at this point in the history
Co-authored-by: james <[email protected]>
  • Loading branch information
spoo-bar and zenzenless committed Jul 17, 2024
1 parent e538ff7 commit 31156de
Show file tree
Hide file tree
Showing 192 changed files with 4,694 additions and 2,908 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

### State Machine Breaking

- (dependencies) [#970](https://github.com/dymensionxyz/dymension/pull/970) Bump dependencies cosmos-sdk to v0.47.12

### Features

- (swagger) [#856](https://github.com/dymensionxyz/dymension/issues/856) Add make command `proto-swagger-gen`
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION ?= $(shell git describe --tags --always)
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
DOCKER := $(shell which docker)
BUILDDIR ?= $(CURDIR)/build

Expand Down Expand Up @@ -65,7 +65,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=dymension \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TM_VERSION)

ifeq (cleveldb,$(findstring cleveldb,$(DYMENSION_BUILD_OPTIONS)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down Expand Up @@ -164,19 +164,16 @@ containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer)
# Link to the cosmos/proto-builder docker images:
# https://github.com/cosmos/cosmos-sdk/pkgs/container/proto-builder
#
protoCosmosVer=0.11.2
protoCosmosVer=0.14.0
protoCosmosName=ghcr.io/cosmos/proto-builder:$(protoCosmosVer)
protoCosmosImage=$(DOCKER) run --network host --rm -v $(CURDIR):/workspace --workdir /workspace $(protoCosmosName)

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi
$(protoCosmosImage) sh ./scripts/protocgen.sh
@go mod tidy

proto-swagger-gen:
@echo "Downloading Protobuf dependencies"
@make proto-download-deps
@echo "Generating Protobuf Swagger"
$(protoCosmosImage) sh ./scripts/protoc-swagger-gen.sh

Expand Down
4 changes: 2 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

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

cometbftlog "github.com/cometbft/cometbft/libs/log"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
tmlog "github.com/tendermint/tendermint/libs/log"

errorsmod "cosmossdk.io/errors"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -63,7 +63,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
}, nil
}

func Recover(logger tmlog.Logger, err *error) {
func Recover(logger cometbftlog.Logger, err *error) {
if r := recover(); r != nil {
*err = errorsmod.Wrapf(errortypes.ErrPanic, "%v", r)

Expand Down
2 changes: 1 addition & 1 deletion app/ante/ante_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
rollappkeeper "github.com/dymensionxyz/dymension/v3/x/rollapp/keeper"
ethante "github.com/evmos/ethermint/app/ante"

Expand Down
4 changes: 2 additions & 2 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/ethereum/go-ethereum/signer/core/apitypes"
"github.com/stretchr/testify/suite"

cometbftproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand All @@ -22,7 +23,6 @@ import (
"github.com/evmos/ethermint/ethereum/eip712"
"github.com/evmos/ethermint/testutil"
ethermint "github.com/evmos/ethermint/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/dymensionxyz/dymension/v3/app"
"github.com/dymensionxyz/dymension/v3/app/ante"
Expand All @@ -47,7 +47,7 @@ func TestAnteTestSuite(t *testing.T) {
// SetupTest setups a new test, with new app, context, and anteHandler.
func (s *AnteTestSuite) SetupTest(isCheckTx bool) {
s.app = apptesting.Setup(s.T(), isCheckTx)
s.ctx = s.app.BaseApp.NewContext(isCheckTx, tmproto.Header{}).WithBlockHeight(1).WithChainID(apptesting.TestChainID)
s.ctx = s.app.BaseApp.NewContext(isCheckTx, cometbftproto.Header{}).WithBlockHeight(1).WithChainID(apptesting.TestChainID)

txConfig := s.app.GetTxConfig()
s.clientCtx = client.Context{}.
Expand Down
2 changes: 1 addition & 1 deletion app/ante/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/dymensionxyz/dymension/v3/x/rollapp/transfergenesis"
ethante "github.com/evmos/ethermint/app/ante"
txfeesante "github.com/osmosis-labs/osmosis/v15/x/txfees/ante"
Expand Down
72 changes: 46 additions & 26 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ import (
"os"
"path/filepath"

"github.com/cosmos/cosmos-sdk/store/streaming"
"github.com/gorilla/mux"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"

simappparams "cosmossdk.io/simapp/params"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/x/auth/posthandler"
"github.com/dymensionxyz/dymension/v3/app/keepers"
"github.com/dymensionxyz/dymension/v3/app/upgrades"
v3 "github.com/dymensionxyz/dymension/v3/app/upgrades/v3"
v4 "github.com/dymensionxyz/dymension/v3/app/upgrades/v4"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
cometbftjson "github.com/cometbft/cometbft/libs/json"
"github.com/cometbft/cometbft/libs/log"
cometbftos "github.com/cometbft/cometbft/libs/os"

"github.com/gorilla/mux"
"github.com/spf13/cast"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
Expand All @@ -32,25 +39,28 @@ import (
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store/streaming"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/version"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"

"github.com/cosmos/cosmos-sdk/x/crisis"

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

"github.com/dymensionxyz/dymension/v3/docs"

simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
ibctesting "github.com/cosmos/ibc-go/v6/testing"
ibctesting "github.com/cosmos/ibc-go/v7/testing"

"github.com/dymensionxyz/dymension/v3/app/ante"
appparams "github.com/dymensionxyz/dymension/v3/app/params"

packetforwardmiddleware "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/packetforward/types"
packetforwardmiddleware "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"

/* ------------------------------ ethermint imports ----------------------------- */

Expand All @@ -66,7 +76,7 @@ var (
_ = packetforwardtypes.ErrIntOverflowGenesis

_ servertypes.Application = (*App)(nil)
_ simapp.App = (*App)(nil)
_ runtime.AppI = (*App)(nil)
_ ibctesting.TestingApp = (*App)(nil)

// DefaultNodeHome default home directories for the application daemon
Expand Down Expand Up @@ -145,7 +155,7 @@ func New(
app.GenerateKeys()

// load state streaming if enabled
if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, keepers.KVStoreKeys); err != nil {
if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keepers.KVStoreKeys); err != nil {
panic("failed to load state streaming services: " + err.Error())
}

Expand Down Expand Up @@ -179,8 +189,8 @@ func New(
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
app.mm.SetOrderInitGenesis(keepers.InitGenesis...)
app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.mm.RegisterInvariants(app.CrisisKeeper)

app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
app.mm.RegisterServices(app.configurator)

Expand Down Expand Up @@ -210,14 +220,29 @@ func New(
if err != nil {
panic(err)
}
postHandler, err := posthandler.NewPostHandler(
posthandler.HandlerOptions{},
)
if err != nil {
panic(fmt.Errorf("failed to create PostHandler: %w", err))
}

app.SetAnteHandler(anteHandler)
app.SetEndBlocker(app.EndBlocker)
app.SetPostHandler(postHandler)
app.setupUpgradeHandlers()

autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules))

reflectionSvc, err := runtimeservices.NewReflectionService()
if err != nil {
panic(err)
}
reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc)

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
cometbftos.Exit(err.Error())
}
}

Expand All @@ -243,7 +268,7 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo
// InitChainer application update at chain initialization
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
if err := cometbftjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
Expand Down Expand Up @@ -336,7 +361,7 @@ func (app *App) SimulationManager() *module.SimulationManager {

// GetTxConfig implements ibctesting.TestingApp
func (app *App) GetTxConfig() client.TxConfig {
return simappparams.MakeTestEncodingConfig().TxConfig
return moduletestutil.MakeTestEncodingConfig().TxConfig
}

func (app *App) ExportState(ctx sdk.Context) map[string]json.RawMessage {
Expand All @@ -360,17 +385,12 @@ func (app *App) setupUpgradeHandler(upgrade upgrades.Upgrade) {
),
)

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
// This will read that value, and execute the preparations for the upgrade.
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(fmt.Errorf("failed to read upgrade info from disk: %w", err))
}

// Pre upgrade handler
switch upgradeInfo.Name {
// do nothing
}

if upgradeInfo.Name == upgrade.Name && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
Expand Down
2 changes: 1 addition & 1 deletion app/apptesting/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
return attrs
}
for _, a := range event.Attributes {
attrs[string(a.Key)] = string(a.Value)
attrs[a.Key] = a.Value
}
return attrs
}
Expand Down
Loading

0 comments on commit 31156de

Please sign in to comment.