-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: upgrade ibc-go from v2 to v4.3.0 (with cosmos-sdk v0.45.12) #630
Conversation
Reference: CosmWasm/wasmd#837 https://ibc.cosmos.network/main/migrations/v2-to-v3.html#upgrade-proposal https://github.com/cosmos/gaia/blob/6742b7158a9b7abf28e3615143620e759cb8307d/app/upgrades/v7/upgrades.go#L15 https://github.com/cosmos/gaia/blob/a4e9d1171d6ab82c95e96bd65c7366d6dee87a49/app/upgrades/v8/upgrades.go#L119
…om v0.45.9 to v0.45.12 Reference: CosmWasm/wasmd#1088
7e672f9
to
006a9cb
Compare
be95e2a
to
f9ee85f
Compare
@@ -62,7 +62,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { | |||
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), | |||
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), | |||
ante.NewIncrementSequenceDecorator(options.AccountKeeper), | |||
ibcante.NewAnteDecorator(options.IBCChannelkeeper), | |||
ibcante.NewAnteDecorator(options.IBCKeeper), |
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.
@@ -492,8 +492,8 @@ func New( | |||
|
|||
// Create static IBC router, add transfer route, then set and seal it | |||
ibcRouter := porttypes.NewRouter() | |||
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) | |||
ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper)) | |||
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transfer.NewIBCModule(app.TransferKeeper)) |
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.
Regarding the use of transfer.NewIBCModule(...)
instead of transferModule
(that was created by transfer.NewAppModule(...)
), https://ibc.cosmos.network/main/migrations/v2-to-v3.html#ibc-application-callbacks-moved-from-appmodule-to-ibcmodule
@@ -3,72 +3,75 @@ module github.com/medibloc/panacea-core/v2 | |||
go 1.19 | |||
|
|||
require ( | |||
github.com/CosmWasm/wasmd v0.24.0 | |||
github.com/btcsuite/btcd v0.22.1 | |||
github.com/CosmWasm/wasmd v0.30.0 |
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.
For IBC v4, wasmd
must be also upgraded to v0.30.0 that is the first version based on IBC v4. This also requires us to upgrade cosmos-sdk to v0.45.11+.
https://github.com/CosmWasm/wasmd/blob/main/CHANGELOG.md#v0300-2022-12-02
Anyway, we have to upgrade cosmos-sdk to v0.45.12, as ibc-go v4.3.0 requires it.
https://github.com/cosmos/ibc-go/blob/main/RELEASES.md#version-matrix
// Create Transfer Keepers | ||
app.TransferKeeper = ibctransferkeeper.NewKeeper( | ||
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), | ||
app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee | ||
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, | ||
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, | ||
) |
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.
Since IBC v3, IBC middleware has been introduced.
As above, if we don't want to use any middleware for now, we can just pass the app.IBCKeeper.ChannelKeeer
as a ICS4Wrapper
parameter. It's explained in the IBC v2->v3 migration guide. Also, I referenced the ibc-go simapp.
Later, when we want to use any IBC middleware such as IBC Fee middleware, we can modify this code to pass a IBCFeeKeeper
, as ibc-go simapp did.
Still, both Cosmos Hub and Osmosis don't use IBC Fee middleware yet.
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) | ||
ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper)) | ||
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transfer.NewIBCModule(app.TransferKeeper)) | ||
ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper)) |
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.
Regarding the last new parameter of wasm.NewIBCHandler(...)
, https://github.com/osmosis-labs/osmosis/pull/3838/files#diff-1ac782d2fab1d48ad7f7ef06cf2d58b37c99b6b4c98879a5ad86a985b73fad58R403
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.
LGTM
Thank you for your hard working!
It seems to have applied well when I saw the migration documentation
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.
lgtm.
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
nhooyr.io/websocket v1.8.6 // indirect | ||
) | ||
|
||
replace ( | ||
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 |
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.
This replace directive can be deleted as described in the release note of cosmos-sdk v0.45.12. https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12
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.
we don't need this redirection anymore 👍
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.
nice
Motivation
What I did
app.go
. I put reference links as PR comments below.Tests
Future work