-
Notifications
You must be signed in to change notification settings - Fork 672
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
Simplify SendPacket API (backport #1703) #2482
Merged
colin-axner
merged 8 commits into
release/v6.0.x
from
mergify/bp/release/v6.0.x/pr-1703
Oct 11, 2022
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ec3b725
Simplify SendPacket API (#1703)
AdityaSripal 5090c78
fix conflicts
crodriguezvega f05942f
Update develop.md
crodriguezvega 3de94cf
Merge branch 'release/v6.0.x' into mergify/bp/release/v6.0.x/pr-1703
crodriguezvega 02c4010
Merge branch 'release/v6.0.x' into mergify/bp/release/v6.0.x/pr-1703
crodriguezvega 94956c0
remove test that was added for 02-client refactor (and therefore befo…
crodriguezvega 62ffa28
Merge branch 'release/v6.0.x' into mergify/bp/release/v6.0.x/pr-1703
colin-axner 2c2b18d
Merge branch 'release/v6.0.x' into mergify/bp/release/v6.0.x/pr-1703
crodriguezvega File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
# Migrating from ibc-go v5 to v6 | ||
|
||
This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG. | ||
Any changes that must be done by a user of ibc-go should be documented here. | ||
|
||
There are four sections based on the four potential user groups of this document: | ||
- Chains | ||
- IBC Apps | ||
- Relayers | ||
- IBC Light Clients | ||
|
||
**Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated to bump the version number on major releases. | ||
|
||
## Chains | ||
|
||
## IBC Apps | ||
|
||
### ICS04 - `SendPacket` API change | ||
|
||
The `SendPacket` API has been simplified: | ||
|
||
```diff | ||
// SendPacket is called by a module in order to send an IBC packet on a channel | ||
func (k Keeper) SendPacket( | ||
ctx sdk.Context, | ||
channelCap *capabilitytypes.Capability, | ||
- packet exported.PacketI, | ||
-) error { | ||
+ sourcePort string, | ||
+ sourceChannel string, | ||
+ timeoutHeight clienttypes.Height, | ||
+ timeoutTimestamp uint64, | ||
+ data []byte, | ||
+) (uint64, error) { | ||
``` | ||
|
||
Callers no longer need to pass in a pre-constructed packet. | ||
The destination port/channel identifiers and the packet sequence will be determined by core IBC. | ||
`SendPacket` will return the packet sequence. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import ( | |
"github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types" | ||
icatypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/types" | ||
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" | ||
porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" | ||
host "github.com/cosmos/ibc-go/v6/modules/core/24-host" | ||
) | ||
|
||
|
@@ -24,7 +25,7 @@ type Keeper struct { | |
cdc codec.BinaryCodec | ||
paramSpace paramtypes.Subspace | ||
|
||
ics4Wrapper icatypes.ICS4Wrapper | ||
ics4Wrapper porttypes.ICS4Wrapper | ||
channelKeeper icatypes.ChannelKeeper | ||
portKeeper icatypes.PortKeeper | ||
accountKeeper icatypes.AccountKeeper | ||
|
@@ -37,7 +38,7 @@ type Keeper struct { | |
// NewKeeper creates a new interchain accounts host Keeper instance | ||
func NewKeeper( | ||
cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, | ||
ics4Wrapper icatypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper, | ||
ics4Wrapper porttypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper, | ||
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. Add this change to migration docs as well. |
||
accountKeeper icatypes.AccountKeeper, scopedKeeper icatypes.ScopedKeeper, msgRouter icatypes.MessageRouter, | ||
) Keeper { | ||
// ensure ibc interchain accounts module account is set | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note: I think we need to document this API breaking change in the migration docs as well.
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.
I guess we can. It shouldn't come up as an issue unless the provided module didn't entirely fulfill the ICS4Wrapper interface as defined by 05-port