-
Notifications
You must be signed in to change notification settings - Fork 608
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
Integrate Async ICQ #4207
Integrate Async ICQ #4207
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ 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" | ||
icq "github.com/strangelove-ventures/async-icq" | ||
icqtypes "github.com/strangelove-ventures/async-icq/types" | ||
|
||
downtimedetector "github.com/osmosis-labs/osmosis/v14/x/downtime-detector" | ||
downtimetypes "github.com/osmosis-labs/osmosis/v14/x/downtime-detector/types" | ||
|
@@ -56,6 +58,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 +109,7 @@ type AppKeepers struct { | |
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper | ||
ScopedTransferKeeper capabilitykeeper.ScopedKeeper | ||
ScopedWasmKeeper capabilitykeeper.ScopedKeeper | ||
ScopedICQKeeper capabilitykeeper.ScopedKeeper | ||
|
||
// "Normal" keepers | ||
AccountKeeper *authkeeper.AccountKeeper | ||
|
@@ -118,6 +122,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 +262,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, | ||
bApp, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhhhh, why does this take in baseApp -- we may have to audit this and all dep updates carefully then. Its not safe to just give base app access to modules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it needs a Querier. I was wondering if there was a something more restrictive that we could pass there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interface ensures only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha, I think its worth making a wrapper struct on our side for now then |
||
) | ||
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 +441,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 +553,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 +600,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 +701,6 @@ func KVStoreKeys() []string { | |
valsetpreftypes.StoreKey, | ||
protorevtypes.StoreKey, | ||
ibchookstypes.StoreKey, | ||
icqtypes.StoreKey, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM, can we add a release blocking TODO / issue for this to be replaced with a tag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added #4218. I'll ping them to add a tag There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, how do I make a ticket release blocking? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add it to the tracker issue for now |
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment for what these args are supposed to be? (Confused why theres two)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing it twice is common on IBC modules where you want one with the default implementation and one that is being used to actually route packages through (if there's a middleware, you want to route packets through the middleware but may still need access to the default IBC implementation).
In this case, I don't think the second one is being used. So not sure why it's needed. And the first one is only being used to return the correct app version when implementing
GetAppVersion
(which is required by the interface)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, I imagine this API / standard could be improved, but for another day (and potentially requires IBC changes). SGTM!