diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 642d868d0a0..3517d086b7c 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -33,7 +33,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - downtimedetector "github.com/osmosis-labs/osmosis/v14/x/downtime-detector" downtimetypes "github.com/osmosis-labs/osmosis/v14/x/downtime-detector/types" "github.com/osmosis-labs/osmosis/v14/x/gamm" @@ -45,6 +44,8 @@ import ( ibchooks "github.com/osmosis-labs/osmosis/x/ibc-hooks" ibchookskeeper "github.com/osmosis-labs/osmosis/x/ibc-hooks/keeper" ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types" + icq "github.com/strangelove-ventures/async-icq" + icqtypes "github.com/strangelove-ventures/async-icq/types" icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host" icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper" @@ -56,6 +57,7 @@ import ( porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + icqkeeper "github.com/strangelove-ventures/async-icq/keeper" // IBC Transfer: Defines the "transfer" IBC port transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer" @@ -106,6 +108,7 @@ type AppKeepers struct { ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper + ScopedICQKeeper capabilitykeeper.ScopedKeeper // "Normal" keepers AccountKeeper *authkeeper.AccountKeeper @@ -118,6 +121,7 @@ type AppKeepers struct { IBCKeeper *ibckeeper.Keeper IBCHooksKeeper *ibchookskeeper.Keeper ICAHostKeeper *icahostkeeper.Keeper + ICQKeeper *icqkeeper.Keeper TransferKeeper *ibctransferkeeper.Keeper EvidenceKeeper *evidencekeeper.Keeper GAMMKeeper *gammkeeper.Keeper @@ -257,6 +261,26 @@ func (appKeepers *AppKeepers) InitNormalKeepers( AddRoute(ibctransfertypes.ModuleName, appKeepers.TransferStack) // Note: the sealing is done after creating wasmd and wiring that up + // ICQ Keeper + icqKeeper := icqkeeper.NewKeeper( + appCodec, + appKeepers.keys[icqtypes.StoreKey], + appKeepers.GetSubspace(icqtypes.ModuleName), + appKeepers.IBCKeeper.ChannelKeeper, // may be replaced with middleware + appKeepers.IBCKeeper.ChannelKeeper, + &appKeepers.IBCKeeper.PortKeeper, + appKeepers.ScopedICQKeeper, + NewQuerierWrapper(bApp), + ) + appKeepers.ICQKeeper = &icqKeeper + + // Create Async ICQ module + icqModule := icq.NewIBCModule(*appKeepers.ICQKeeper) + + // Add icq modules to IBC router + ibcRouter.AddRoute(icqtypes.ModuleName, icqModule) + // Note: the sealing is done after creating wasmd and wiring that up + // create evidence keeper with router // If evidence needs to be handled for the app, set routes in router here and seal appKeepers.EvidenceKeeper = evidencekeeper.NewKeeper( @@ -416,6 +440,8 @@ func (appKeepers *AppKeepers) InitNormalKeepers( // wire up x/wasm to IBC ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(appKeepers.WasmKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.IBCKeeper.ChannelKeeper)) + + // Seal the router appKeepers.IBCKeeper.SetRouter(ibcRouter) // register the proposal types @@ -526,6 +552,7 @@ func (appKeepers *AppKeepers) InitSpecialKeepers( appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) appKeepers.ScopedWasmKeeper = appKeepers.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + appKeepers.ScopedICQKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icqtypes.ModuleName) appKeepers.CapabilityKeeper.Seal() // TODO: Make a SetInvCheckPeriod fn on CrisisKeeper. @@ -572,6 +599,7 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac paramsKeeper.Subspace(twaptypes.ModuleName) paramsKeeper.Subspace(ibcratelimittypes.ModuleName) paramsKeeper.Subspace(concentratedliquiditytypes.ModuleName) + paramsKeeper.Subspace(icqtypes.ModuleName) return paramsKeeper } @@ -672,5 +700,6 @@ func KVStoreKeys() []string { valsetpreftypes.StoreKey, protorevtypes.StoreKey, ibchookstypes.StoreKey, + icqtypes.StoreKey, } } diff --git a/app/keepers/modules.go b/app/keepers/modules.go index c5e5813f0ee..1550bcd9bd3 100644 --- a/app/keepers/modules.go +++ b/app/keepers/modules.go @@ -26,6 +26,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" + icq "github.com/strangelove-ventures/async-icq" _ "github.com/osmosis-labs/osmosis/v14/client/docs/statik" concentratedliquidity "github.com/osmosis-labs/osmosis/v14/x/concentrated-liquidity/clmodule" @@ -98,6 +99,7 @@ var AppModuleBasics = []module.AppModuleBasic{ tokenfactory.AppModuleBasic{}, valsetprefmodule.AppModuleBasic{}, wasm.AppModuleBasic{}, + icq.AppModuleBasic{}, ica.AppModuleBasic{}, ibc_hooks.AppModuleBasic{}, ibc_rate_limit.AppModuleBasic{}, diff --git a/app/keepers/querier.go b/app/keepers/querier.go new file mode 100644 index 00000000000..2f4ba318327 --- /dev/null +++ b/app/keepers/querier.go @@ -0,0 +1,22 @@ +package keepers + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" +) + +// QuerierWrapper is a local wrapper around BaseApp that exports only the Queryable interface. +// This is used to pass the baseApp to Async ICQ without exposing all methods +type QuerierWrapper struct { + querier sdk.Queryable +} + +var _ sdk.Queryable = QuerierWrapper{} + +func NewQuerierWrapper(querier sdk.Queryable) QuerierWrapper { + return QuerierWrapper{querier: querier} +} + +func (q QuerierWrapper) Query(req abci.RequestQuery) abci.ResponseQuery { + return q.querier.Query(req) +} diff --git a/app/modules.go b/app/modules.go index aa0e294c619..26c0e46ef2c 100644 --- a/app/modules.go +++ b/app/modules.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + icq "github.com/strangelove-ventures/async-icq" ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v4/modules/core" @@ -16,6 +17,8 @@ import ( ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" + icqtypes "github.com/strangelove-ventures/async-icq/types" + downtimemodule "github.com/osmosis-labs/osmosis/v14/x/downtime-detector/module" downtimetypes "github.com/osmosis-labs/osmosis/v14/x/downtime-detector/types" @@ -92,6 +95,7 @@ var moduleAccountPermissions = map[string][]string{ distrtypes.ModuleName: nil, ibchookstypes.ModuleName: nil, icatypes.ModuleName: nil, + icqtypes.ModuleName: nil, minttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, minttypes.DeveloperVestingModuleAcctName: nil, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, @@ -167,6 +171,7 @@ func appModules( tokenfactory.NewAppModule(*app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), valsetprefmodule.NewAppModule(appCodec, *app.ValidatorSetPreferenceKeeper), ibc_hooks.NewAppModule(app.AccountKeeper), + icq.NewAppModule(*app.AppKeepers.ICQKeeper), } } @@ -250,6 +255,7 @@ func OrderInitGenesis(allModuleNames []string) []string { wasm.ModuleName, // ibc_hooks after auth keeper ibchookstypes.ModuleName, + icqtypes.ModuleName, } } diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go index b263b735e00..c62a43e7eaf 100644 --- a/app/upgrades/v15/constants.go +++ b/app/upgrades/v15/constants.go @@ -2,6 +2,7 @@ package v15 import ( store "github.com/cosmos/cosmos-sdk/store/types" + icqtypes "github.com/strangelove-ventures/async-icq/types" "github.com/osmosis-labs/osmosis/v14/app/upgrades" cltypes "github.com/osmosis-labs/osmosis/v14/x/concentrated-liquidity/types" @@ -17,7 +18,7 @@ var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, CreateUpgradeHandler: CreateUpgradeHandler, StoreUpgrades: store.StoreUpgrades{ - Added: []string{poolmanagertypes.StoreKey, cltypes.StoreKey, valsetpreftypes.StoreKey, protorevtypes.StoreKey}, + Added: []string{poolmanagertypes.StoreKey, cltypes.StoreKey, valsetpreftypes.StoreKey, protorevtypes.StoreKey, icqtypes.StoreKey}, Deleted: []string{}, }, } diff --git a/go.mod b/go.mod index 1be26a723de..8aa66cf6e11 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,8 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.15.0 + // Async ICQ branch: ibc-v4 + github.com/strangelove-ventures/async-icq v0.0.0-20230116084035-5609e84dd443 github.com/stretchr/testify v1.8.1 github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.8-0.20220506192307-f628bb5dc95b @@ -67,7 +69,7 @@ require ( require ( 4d63.com/gochecknoglobals v0.1.0 // indirect - filippo.io/edwards25519 v1.0.0-beta.2 // indirect + filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/Antonboom/errname v0.1.7 // indirect @@ -83,7 +85,7 @@ require ( github.com/OpenPeeDeeP/depguard v1.1.1 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/ashanbrown/forbidigo v1.3.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -174,9 +176,9 @@ require ( github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect + github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect diff --git a/go.sum b/go.sum index 31ab3445ee6..f4436b4dba0 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= @@ -119,8 +119,8 @@ github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1: github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/ashanbrown/forbidigo v1.3.0 h1:VkYIwb/xxdireGAdJNZoo24O4lmnEWkactplBlWTShc= @@ -591,16 +591,17 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= @@ -1057,6 +1058,8 @@ github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/strangelove-ventures/async-icq v0.0.0-20230116084035-5609e84dd443 h1:nRkSfj9IhUrGF+0MRQHs4f8mtHFPe+0li7/k3Y4k0cs= +github.com/strangelove-ventures/async-icq v0.0.0-20230116084035-5609e84dd443/go.mod h1:9dxdEF3Lo8WvLYx1e2knGkz3tmiPVX0ohODzUjGl9G4= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=