Skip to content
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: ics29 packet callbacks #331

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c623ad7
Bump codecov/codecov-action from 1.5.2 to 2.0.1 (#273)
dependabot[bot] Jul 20, 2021
0afa15a
remove ChanCloseInit function from transfer keeper (#275)
colin-axner Jul 20, 2021
6f10a68
Bump codecov/codecov-action from 2.0.1 to 2.0.2 (#296)
dependabot[bot] Jul 26, 2021
da40d55
Bump github.com/spf13/cast from 1.3.1 to 1.4.0 (#301)
dependabot[bot] Jul 27, 2021
11da3d7
Bump technote-space/get-diff-action from 4.2 to 5 (#306)
dependabot[bot] Aug 2, 2021
7b51ebd
do handshake logic, create test file
AdityaSripal Aug 3, 2021
bf508c6
bump to SDK v0.43.0-rc3 (#308)
colin-axner Aug 5, 2021
150211d
do cap logic and fix build
AdityaSripal Aug 5, 2021
3642983
add @seantking as codeowner to interchain accounts (#309)
colin-axner Aug 5, 2021
bb9063b
Merge remote-tracking branch 'upstream/main' into ics29-fee-middleware
charleenfei Aug 6, 2021
6c3b582
Bump google.golang.org/grpc from 1.39.0 to 1.39.1 (#320)
dependabot[bot] Aug 9, 2021
1160f56
Bump github.com/cosmos/cosmos-sdk from 0.43.0-rc3 to 0.43.0 (#325)
dependabot[bot] Aug 10, 2021
3dade92
module: improve 04-channel logging (#323)
alexanderbez Aug 10, 2021
632d71f
update changelog (#326)
colin-axner Aug 11, 2021
c561377
Merge remote-tracking branch 'upstream/main' into feat/ics29_packet_c…
charleenfei Aug 11, 2021
e4e0339
Merge branch 'aditya/handshake' into feat/ics29_packet_callbacks
charleenfei Aug 11, 2021
fc6ed02
initial scaffolding
charleenfei Aug 12, 2021
2c5ea11
Bump google.golang.org/grpc from 1.39.1 to 1.40.0 (#332)
dependabot[bot] Aug 12, 2021
647e74e
Merge branch 'ics29-fee-middleware' into feat/ics29_packet_callbacks
charleenfei Aug 12, 2021
830fb20
added ics4 callbacks
charleenfei Aug 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

* @colin-axner @fedekunze @AdityaSripal

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies 27-interchain-accounts files, only the interchain account owners
# and not the global owner(s) will be requested for a review.

# CODEOWNERS for interchain-accounts module

/modules/apps/27-interchain-accounts/ @seantking @colin-axner @AdityaSripal
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/[email protected]
with:
go-version: 1.15
- uses: technote-space/get-diff-action@v4.2
- uses: technote-space/get-diff-action@v5
id: git_diff
with:
PATTERNS: |
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/[email protected]
with:
go-version: 1.15
- uses: technote-space/get-diff-action@v4.2
- uses: technote-space/get-diff-action@v5
with:
PATTERNS: |
**/**.go
Expand All @@ -113,7 +113,7 @@ jobs:
needs: tests
steps:
- uses: actions/[email protected]
- uses: technote-space/get-diff-action@v4.2
- uses: technote-space/get-diff-action@v5
with:
PATTERNS: |
**/**.go
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: env.GIT_DIFF
- uses: codecov/codecov-action@v1.5.2
- uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.txt
if: env.GIT_DIFF
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]

* (core) [\#227](https://github.com/cosmos/ibc-go/pull/227) Remove sdk.Result from application callbacks
* (core) [\#268](https://github.com/cosmos/ibc-go/pull/268) Perform a no-op on redundant relay messages. Previous behaviour returned an error. Now no state change will occur and no error will be returned.


## [v1.0.0-rc0](https://github.com/cosmos/ibc-go/releases/tag/v1.0.0-rc0) - 2021-07-07
## [v1.0.0](https://github.com/cosmos/ibc-go/releases/tag/v1.0.0) - 2021-08-10

### Bug Fixes

Expand Down Expand Up @@ -69,6 +68,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/core) [\#109](https://github.com/cosmos/ibc-go/pull/109) Remove connection and channel handshake CLI commands.
* (modules) [\#107](https://github.com/cosmos/ibc-go/pull/107) Modify OnRecvPacket callback to return an acknowledgement which indicates if it is successful or not. Callback state changes are discarded for unsuccessful acknowledgements only.
* (modules) [\#108](https://github.com/cosmos/ibc-go/pull/108) All message constructors take the signer as a string to prevent upstream bugs. The `String()` function for an SDK Acc Address relies on external context.
* (transfer) [\#275](https://github.com/cosmos/ibc-go/pull/275) Remove 'ChanCloseInit' function from transfer keeper. ICS20 does not close channels.

### State Machine Breaking

Expand All @@ -78,6 +78,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/core/02-client) [\#8405](https://github.com/cosmos/cosmos-sdk/pull/8405) Refactor IBC client update governance proposals to use a substitute client to update a frozen or expired client.
* (modules/core/02-client) [\#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added.
* (modules/core/03-connection) [\#171](https://github.com/cosmos/ibc-go/pull/171) Introduces a new parameter `MaxExpectedTimePerBlock` to allow connections to calculate and enforce a block delay that is proportional to time delay set by connection.
* (core) [\#268](https://github.com/cosmos/ibc-go/pull/268) Perform a no-op on redundant relay messages. Previous behaviour returned an error. Now no state change will occur and no error will be returned.

### Improvements

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp
require (
github.com/armon/go-metrics v0.3.9
github.com/confio/ics23/go v0.6.6
github.com/cosmos/cosmos-sdk v0.43.0-rc2
github.com/cosmos/cosmos-sdk v0.43.0
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.3.1
github.com/spf13/cast v1.4.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.11
github.com/tendermint/tm-db v0.6.4
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
google.golang.org/grpc v1.39.0
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
)
11 changes: 6 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/cosmos-sdk v0.43.0-rc2 h1:9xww4vDnsNyZyF1p9U4zpc8tc5Ctx763WQWLccddP8A=
github.com/cosmos/cosmos-sdk v0.43.0-rc2/go.mod h1:ctcrTEAhei9s8O3KSNvL0dxe+fVQGp07QyRb/7H9JYE=
github.com/cosmos/cosmos-sdk v0.43.0 h1:l2GXJMDVtJyHb35pDUCw+uyr6eZtBo8vt+7PSsq+Fjo=
github.com/cosmos/cosmos-sdk v0.43.0/go.mod h1:ctcrTEAhei9s8O3KSNvL0dxe+fVQGp07QyRb/7H9JYE=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand Down Expand Up @@ -714,8 +714,9 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.4.0 h1:WhlbjwB9EGCc8W5Rxdkus+wmH2ASRwwTJk6tgHKwdqQ=
github.com/spf13/cast v1.4.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
Expand Down Expand Up @@ -1230,8 +1231,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI=
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q=
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
36 changes: 36 additions & 0 deletions modules/apps/29-fee/keeper/ics4_callbacks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/cosmos/ibc-go/modules/core/exported"
)

// SendPacket is called by a module in order to send an IBC packet on a channel
// end owned by the calling module to the corresponding module on the counterparty
// chain.
func (k Keeper) SendPacket(
ctx sdk.Context,
channelCap *capabilitytypes.Capability,
packet exported.PacketI,
) error {
// will this work this ics20? SendTransfer
// if channelKeeper === ics20 then sendTransfer, otherwise SendPacket
return k.channelKeeper.SendPacket(ctx, channelCap, packet)
}

// WriteAcknowledgement writes the packet execution acknowledgement to the state,
// which will be verified by the counterparty chain using AcknowledgePacket. This is for asynchronous acks

func (k Keeper) WriteAcknowledgement(
ctx sdk.Context,
chanCap *capabilitytypes.Capability,
packet exported.PacketI,
acknowledgement []byte,
) error {
// retrieve the forward relayer that was stored in `onRecvPacket`
// relayer = privateStore.get(forwardRelayerPath(packet))
// ack = constructIncentivizedAck(acknowledgment, relayer)
// ack_bytes marshal(ack)
return k.channelKeeper.WriteAcknowledgement(ctx, chanCap, packet, acknowledgement)
}
1 change: 1 addition & 0 deletions modules/apps/29-fee/keeper/ics4_callbacks_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package keeper_test
17 changes: 1 addition & 16 deletions modules/apps/29-fee/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package keeper

/*
import (
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/ibc-go/modules/apps/transfer/types"
host "github.com/cosmos/ibc-go/modules/core/24-host"
Expand All @@ -25,7 +23,6 @@ type Keeper struct {
scopedKeeper capabilitykeeper.ScopedKeeper
}


// NewKeeper creates a new 29-fee Keeper instance
func NewKeeper(
cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace,
Expand Down Expand Up @@ -59,7 +56,7 @@ func (k Keeper) IsBound(ctx sdk.Context, portID string) bool {
// order to expose it to module's InitGenesis function
func (k Keeper) BindPort(ctx sdk.Context, portID string) error {
cap := k.portKeeper.BindPort(ctx, portID)
return k.ClaimCapability(ctx, cap, host.PortPath(portID))
return k.scopedKeeper.ClaimCapability(ctx, cap, host.PortPath(portID))
}

// GetPort returns the portID for the transfer module. Used in ExportGenesis
Expand All @@ -73,15 +70,3 @@ func (k Keeper) SetPort(ctx sdk.Context, portID string) {
store := ctx.KVStore(k.storeKey)
store.Set(types.PortKey, []byte(portID))
}

// AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function
func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool {
return k.scopedKeeper.AuthenticateCapability(ctx, cap, name)
}

// ClaimCapability allows the transfer module that can claim a capability that IBC module
// passes to it
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error {
return k.scopedKeeper.ClaimCapability(ctx, cap, name)
}
*/
Loading