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

fix dependencies #11

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ lint: format-tools
format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./x/vendor*" -not -path "./contracts*" -not -path "./packages*" -not -path "./docs*"| xargs gofumpt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/babylonchain/babylon-sdk)" --custom-order
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/babylonlabs-io/babylon-sdk)" --custom-order


###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Babylon SDK

Cosmos module for Babylon consumer chains. Please see the official project [repo](https://github.com/babylonchain/babylon) for specs and wasm contracts.
Cosmos module for Babylon consumer chains. Please see the official project [repo](https://github.com/babylonlabs-io/babylon) for specs and wasm contracts.

The code is forked from https://github.com/osmosis-labs/mesh-security-sdk.
## Project Structure
Expand Down
2 changes: 1 addition & 1 deletion demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ldflags := -X github.com/cosmos/cosmos-sdk/version.Name=$(NAME) \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/babylonchain/babylon-sdk/demo/app.Bech32Prefix=$(PREFIX) \
-X github.com/babylonlabs-io/babylon-sdk/demo/app.Bech32Prefix=$(PREFIX) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq ($(WITH_CLEVELDB),yes)
Expand Down
162 changes: 82 additions & 80 deletions demo/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
appparams "github.com/babylonchain/babylon-sdk/demo/app/params"
appparams "github.com/babylonlabs-io/babylon-sdk/demo/app/params"
abci "github.com/cometbft/cometbft/abci/types"
tmos "github.com/cometbft/cometbft/libs/os"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/std"
simsutils "github.com/cosmos/cosmos-sdk/testutil/sims"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"

// ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
// icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller"
// icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
// icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
// icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
// icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
// icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
// icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee"
Copy link
Contributor

Choose a reason for hiding this comment

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

Put a TODO / FIXME / comment here?

I wonder why the ica stuff worked before btw.

And finally, perhaps the ica disabling stuff should be done in a different PR. So that it can ve reverted cleanly, by example.

ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
Expand Down Expand Up @@ -118,9 +119,9 @@ import (
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"

babylon "github.com/babylonchain/babylon-sdk/x/babylon"
bbnkeeper "github.com/babylonchain/babylon-sdk/x/babylon/keeper"
bbntypes "github.com/babylonchain/babylon-sdk/x/babylon/types"
babylon "github.com/babylonlabs-io/babylon-sdk/x/babylon"
bbnkeeper "github.com/babylonlabs-io/babylon-sdk/x/babylon/keeper"
bbntypes "github.com/babylonlabs-io/babylon-sdk/x/babylon/types"
)

const appName = "ConsumerApp"
Expand Down Expand Up @@ -148,9 +149,9 @@ var maccPerms = map[string][]string{
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibcfeetypes.ModuleName: nil,
icatypes.ModuleName: nil,
wasmtypes.ModuleName: {authtypes.Burner},
bbntypes.ModuleName: {authtypes.Minter, authtypes.Burner},
// icatypes.ModuleName: nil,
wasmtypes.ModuleName: {authtypes.Burner},
bbntypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}

var (
Expand Down Expand Up @@ -188,20 +189,20 @@ type ConsumerApp struct {
FeeGrantKeeper feegrantkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper

IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
BabylonKeeper *bbnkeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper
// ICAControllerKeeper icacontrollerkeeper.Keeper
// ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
BabylonKeeper *bbnkeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
// ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
// ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

// the module manager
ModuleManager *module.Manager
Expand Down Expand Up @@ -240,8 +241,9 @@ func NewConsumerApp(
authzkeeper.StoreKey,
// non sdk store keys
ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey,
icacontrollertypes.StoreKey,
wasmtypes.StoreKey,
// icahosttypes.StoreKey,
// icacontrollertypes.StoreKey,
bbntypes.StoreKey,
)

Expand Down Expand Up @@ -294,8 +296,8 @@ func NewConsumerApp(
)

scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
// scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
// scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
app.CapabilityKeeper.Seal()
Expand Down Expand Up @@ -489,29 +491,29 @@ func NewConsumerApp(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec,
keys[icahosttypes.StoreKey],
app.GetSubspace(icahosttypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
app.AccountKeeper,
scopedICAHostKeeper,
app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec,
keys[icacontrollertypes.StoreKey],
app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.PortKeeper,
scopedICAControllerKeeper,
app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
// app.ICAHostKeeper = icahostkeeper.NewKeeper(
// appCodec,
// keys[icahosttypes.StoreKey],
// app.GetSubspace(icahosttypes.SubModuleName),
// app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
// app.IBCKeeper.ChannelKeeper,
// app.IBCKeeper.PortKeeper,
// app.AccountKeeper,
// scopedICAHostKeeper,
// app.MsgServiceRouter(),
// authtypes.NewModuleAddress(govtypes.ModuleName).String(),
// )
// app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
// appCodec,
// keys[icacontrollertypes.StoreKey],
// app.GetSubspace(icacontrollertypes.SubModuleName),
// app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
// app.IBCKeeper.ChannelKeeper,
// app.IBCKeeper.PortKeeper,
// scopedICAControllerKeeper,
// app.MsgServiceRouter(),
// authtypes.NewModuleAddress(govtypes.ModuleName).String(),
// )

wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
Expand Down Expand Up @@ -564,21 +566,21 @@ func NewConsumerApp(
transferStack = transfer.NewIBCModule(app.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper)

// Create Interchain Accounts Stack
// SendPacket, since it is originating from the application to core IBC:
// icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> channel.SendPacket
var icaControllerStack porttypes.IBCModule
// integration point for custom authentication modules
// see https://medium.com/the-interchain-foundation/ibc-go-v6-changes-to-interchain-accounts-and-how-it-impacts-your-chain-806c185300d7
var noAuthzModule porttypes.IBCModule
icaControllerStack = icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper)
icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper)

// RecvPacket, message that originates from core IBC and goes down to app, the flow is:
// channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket
var icaHostStack porttypes.IBCModule
icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper)
icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, app.IBCFeeKeeper)
// // Create Interchain Accounts Stack
Copy link
Contributor

Choose a reason for hiding this comment

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

Double comments are not nice.

// // SendPacket, since it is originating from the application to core IBC:
// // icaAuthModuleKeeper.SendTx -> icaController.SendPacket -> fee.SendPacket -> channel.SendPacket
// var icaControllerStack porttypes.IBCModule
// // integration point for custom authentication modules
// // see https://medium.com/the-interchain-foundation/ibc-go-v6-changes-to-interchain-accounts-and-how-it-impacts-your-chain-806c185300d7
// var noAuthzModule porttypes.IBCModule
// icaControllerStack = icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper)
// icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper)

// // RecvPacket, message that originates from core IBC and goes down to app, the flow is:
// // channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket
// var icaHostStack porttypes.IBCModule
// icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper)
// icaHostStack = ibcfee.NewIBCMiddleware(icaHostStack, app.IBCFeeKeeper)

// Create fee enabled wasm ibc Stack
var wasmStack porttypes.IBCModule
Expand All @@ -588,9 +590,9 @@ func NewConsumerApp(
// Create static IBC router, add app routes, then set and seal it
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(wasmtypes.ModuleName, wasmStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
AddRoute(wasmtypes.ModuleName, wasmStack) //.
// AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
// AddRoute(icahosttypes.SubModuleName, icaHostStack)
app.IBCKeeper.SetRouter(ibcRouter)

/**** Module Options ****/
Expand Down Expand Up @@ -628,7 +630,7 @@ func NewConsumerApp(
transfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
ibctm.AppModule{},
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
// ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
babylon.NewAppModule(appCodec, app.BabylonKeeper),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
)
Expand Down Expand Up @@ -669,7 +671,7 @@ func NewConsumerApp(
// additional non simd modules
ibctransfertypes.ModuleName,
ibcexported.ModuleName,
icatypes.ModuleName,
// icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
bbntypes.ModuleName,
Expand All @@ -685,7 +687,7 @@ func NewConsumerApp(
// additional non simd modules
ibctransfertypes.ModuleName,
ibcexported.ModuleName,
icatypes.ModuleName,
// icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasmtypes.ModuleName,
bbntypes.ModuleName, // last to capture all chain events
Expand All @@ -708,7 +710,7 @@ func NewConsumerApp(
// additional non simd modules
ibctransfertypes.ModuleName,
ibcexported.ModuleName,
icatypes.ModuleName,
// icatypes.ModuleName,
ibcfeetypes.ModuleName,
// wasm after ibc transfer
wasmtypes.ModuleName,
Expand Down Expand Up @@ -775,8 +777,8 @@ func NewConsumerApp(
app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
app.ScopedWasmKeeper = scopedWasmKeeper
app.ScopedICAHostKeeper = scopedICAHostKeeper
app.ScopedICAControllerKeeper = scopedICAControllerKeeper
// app.ScopedICAHostKeeper = scopedICAHostKeeper
// app.ScopedICAControllerKeeper = scopedICAControllerKeeper

// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
// antehandlers, but are run _after_ the `runMsgs` execution. They are also
Expand Down
2 changes: 1 addition & 1 deletion demo/cmd/bcd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"

"cosmossdk.io/log"
"github.com/babylonchain/babylon-sdk/demo/app"
"github.com/babylonlabs-io/babylon-sdk/demo/app"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
)

Expand Down
4 changes: 2 additions & 2 deletions demo/cmd/bcd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/babylonchain/babylon-sdk/demo/app"
"github.com/babylonchain/babylon-sdk/demo/app/params"
"github.com/babylonlabs-io/babylon-sdk/demo/app"
"github.com/babylonlabs-io/babylon-sdk/demo/app/params"
tmcfg "github.com/cometbft/cometbft/config"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/client"
Expand Down
14 changes: 7 additions & 7 deletions demo/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/babylonchain/babylon-sdk/demo
module github.com/babylonlabs-io/babylon-sdk/demo

go 1.21

Expand All @@ -7,11 +7,11 @@ toolchain go1.21.4
require (
github.com/CosmWasm/wasmd v0.51.0
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/cosmos-sdk v0.50.6
github.com/cosmos/cosmos-sdk v0.50.7
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.4.12
github.com/cosmos/iavl v1.1.2 // indirect
github.com/cosmos/ibc-go/v8 v8.0.0
github.com/cosmos/ibc-go/v8 v8.3.2
github.com/cosmos/ics23/go v0.10.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this broke the ica stuff? 🤷🏼

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried v8.0.0 and it does not make any difference, weird

Copy link
Contributor

Choose a reason for hiding this comment

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

Likely v8.3.x is being pulled through the dependency tree.

Copy link
Contributor

Choose a reason for hiding this comment

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

That, or the change comes from somewhere else (cosmos-sdk).

github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand All @@ -31,7 +31,7 @@ require (
)

require (
cosmossdk.io/api v0.7.4
cosmossdk.io/api v0.7.5
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.3.0
Expand All @@ -41,8 +41,8 @@ require (
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/tx v0.13.3
cosmossdk.io/x/upgrade v0.1.2
github.com/babylonchain/babylon-sdk/x v0.0.0-00010101000000-000000000000
github.com/cometbft/cometbft v0.38.6
github.com/babylonlabs-io/babylon-sdk/x v0.0.0-00010101000000-000000000000
github.com/cometbft/cometbft v0.38.7
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/spf13/viper v1.18.2
Expand Down Expand Up @@ -211,7 +211,7 @@ replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

// local work dir
github.com/babylonchain/babylon-sdk/x => ../x
github.com/babylonlabs-io/babylon-sdk/x => ../x
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
// See: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down
Loading
Loading