-
Notifications
You must be signed in to change notification settings - Fork 586
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 #1703
Merged
Merged
Simplify SendPacket API #1703
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
05e1d86
fix compile issues and channel keeper tests
AdityaSripal 99db505
add back deleted code
AdityaSripal a146b33
fix merge
AdityaSripal 3d4a0eb
CHANGELOG
AdityaSripal 3cbbef6
fix var naming and remove unnecessary test cases
AdityaSripal 847fd98
add sequence to return argument of SendPacket
AdityaSripal 3527aed
fix merge
AdityaSripal 7a94343
Merge branch 'main' into aditya/send-packet-api
AdityaSripal 8386d5d
remove print
AdityaSripal 302d32a
Remove unnecessary diffs
AdityaSripal 8dc0c4a
update changelog
AdityaSripal 60c740b
Merge branch 'aditya/send-packet-api' of github.com:cosmos/ibc-go int…
AdityaSripal c6d9861
Apply suggestions from code review
colin-axner 36742b0
Apply suggestions from code review
colin-axner e8b8a33
chore: remove unnecessary test
colin-axner c348aa4
chore: add migration docs
colin-axner c30f011
revert breaking telemetry
colin-axner 079c3a1
fix: migration docs was in wrong location
colin-axner 90e5e08
Update docs/migrations/v5-to-v6.md
colin-axner 827529a
update 'SendPacket' godoc
colin-axner e48d77e
Merge branch 'main' of github.com:cosmos/ibc-go into aditya/send-pack…
colin-axner acaf109
Merge branch 'aditya/send-packet-api' of github.com:cosmos/ibc-go int…
colin-axner 9a7737e
chore: update changelog entry to include packet seq return
colin-axner 6ad76d1
update documentation
crodriguezvega 2faf51e
Merge branch 'main' into aditya/send-packet-api
crodriguezvega 17882e6
chore: fix test case to increase code coverage
colin-axner d9eb17f
Merge branch 'aditya/send-packet-api' of github.com:cosmos/ibc-go int…
colin-axner 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import ( | |
genesistypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/genesis/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" | ||
) | ||
|
||
|
@@ -25,7 +26,7 @@ type Keeper struct { | |
cdc codec.BinaryCodec | ||
paramSpace paramtypes.Subspace | ||
|
||
ics4Wrapper icatypes.ICS4Wrapper | ||
ics4Wrapper porttypes.ICS4Wrapper | ||
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. No reason for us to duplicate ICS4Wrapper in the expected keepers. the interface already exists in port types. This also prevents accidentally missing a function. Done for all apps |
||
channelKeeper icatypes.ChannelKeeper | ||
portKeeper icatypes.PortKeeper | ||
|
||
|
@@ -37,7 +38,7 @@ type Keeper struct { | |
// NewKeeper creates a new interchain accounts controller 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, | ||
scopedKeeper icatypes.ScopedKeeper, msgRouter icatypes.MessageRouter, | ||
) Keeper { | ||
// set KeyTable if it has not already been 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
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
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.
I realized that this file is actually not used in the docs website, so could probably be removed...
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 see, looks like we took this info and split it up into separate files? Lets open an issue whose task is to see if any info in here should be moved before deleting the file
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.
#2480