Skip to content

Commit

Permalink
Merge branch 'main' into damian/update-localhost-migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan authored Sep 27, 2022
2 parents 3338b0b + 875279d commit 11627f6
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:

- name: Build 🔧
run: |
git config --global --add safe.directory /__w/ibc-go/ibc-go
make build-docs LEDGER_ENABLED=false
- name: Deploy 🚀
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking

* (apps/29-fee) [\#2395](https://github.com/cosmos/ibc-go/pull/2395) Remove param space from ics29 NewKeeper function. The field was unused.
* (testing)[\#2028](https://github.com/cosmos/ibc-go/pull/2028) New interface `ibctestingtypes.StakingKeeper` added and set for the testing app `StakingKeeper` setup.
* (core/04-channel) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `NewPacketId` has been renamed to `NewPacketID` to comply with go linting rules.
* (core/ante) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `AnteDecorator` has been renamed to `RedundancyDecorator` to comply with go linting rules and to give more clarity to the purpose of the Decorator.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ The Inter-Blockchain Communication protocol (IBC) allows blockchains to talk to

For an overview of upcoming changes to ibc-go take a look at the [roadmap](./docs/roadmap/roadmap.md).

## Releases

The release lines currently supported are v2, v3 and v4. Please refer to the [Stable Release Policy section of RELEASES.md](https://github.com/cosmos/ibc-go/blob/main/RELEASES.md#stable-release-policy) for more details.

## Ecosystem

Discover the applications, middleware and light clients developed by other awesome teams in the ecosystem:
Expand All @@ -92,10 +96,14 @@ In the table below

We have active, helpful communities on Discord and Telegram.

For questions and support please use the `new-devs-support` channel in the [Cosmos Network Discord server](https://discord.com/channels/669268347736686612/699634178173698108) or join the [IBC Gang Discord server](https://discord.gg/RdpdkaXKpZ). The issue list of this repo is exclusively for bug reports and feature requests.
For questions and support please use the `developers` channel in the [Cosmos Network Discord server](https://discord.com/channels/669268347736686612/1019978171367559208) or join the [IBC Gang Discord server](https://discord.gg/RdpdkaXKpZ). The issue list of this repo is exclusively for bug reports and feature requests.

To receive announcements of new releases or other technical updates, please join the [IBC is expansive Telegram group](https://t.me/ibc_is_expansive).

## Security

To report a security vulnerability, see our [bug bounty program](https://hackerone.com/cosmos).

## Resources

- [IBC Website](https://ibcprotocol.org/)
Expand Down
86 changes: 85 additions & 1 deletion docs/middleware/ics29-fee/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,90 @@ Learn how to configure the Fee Middleware module with IBC applications. The foll
The Fee Middleware module, as the name suggests, plays the role of an IBC middleware and as such must be configured by chain developers to route and handle IBC messages correctly.
For Cosmos SDK chains this setup is done via the `app/app.go` file, where modules are constructed and configured in order to bootstrap the blockchain application.

## Example integration of the Fee Middleware module

```
// app.go
// Register the AppModule for the fee middleware module
ModuleBasics = module.NewBasicManager(
...
ibcfee.AppModuleBasic{},
...
)
...
// Add module account permissions for the fee middleware module
maccPerms = map[string][]string{
...
ibcfeetypes.ModuleName: nil,
}
...
// Add fee middleware Keeper
type App struct {
...
IBCFeeKeeper ibcfeekeeper.Keeper
...
}
...
// Create store keys
keys := sdk.NewKVStoreKeys(
...
ibcfeetypes.StoreKey,
...
)
...
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec, keys[ibcfeetypes.StoreKey],
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
)
// See the section below for configuring an application stack with the fee middleware module
...
// Register fee middleware AppModule
app.moduleManager = module.NewManager(
...
ibcfee.NewAppModule(app.IBCFeeKeeper),
)
...
// Add fee middleware to begin blocker logic
app.mm.SetOrderBeginBlockers(
...
ibcfeetypes.ModuleName,
...
)
// Add fee middleware to end blocker logic
app.mm.SetOrderEndBlockers(
...
ibcfeetypes.ModuleName,
...
)
// Add fee middleware to init genesis logic
app.mm.SetOrderInitGenesis(
...
ibcfeetypes.ModuleName,
...
)
```

## Configuring an application stack with Fee Middleware

As mentioned in [IBC middleware development](../../ibc/middleware/develop.md) an application stack may be composed of many or no middlewares that nest a base application.
Expand Down Expand Up @@ -82,4 +166,4 @@ ibcRouter.
AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerStack) // ica with mock auth module stack route to ica (top level of middleware stack)
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack).
```
```
36 changes: 17 additions & 19 deletions docs/migrations/v4-to-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,6 @@ The `AnteDecorator` was actually renamed twice, but in [this PR](https://github.

## IBC Apps

### ICS27 - Interchain Accounts

An additional parameter, `ics4Wrapper` has been added to the `host` submodule `NewKeeper` function in `modules/apps/27-interchain-accounts/host/keeper`.
This allows the `host` submodule to correctly unwrap the channel version for channel reopening handshakes in the `OnChanOpenTry` callback.

```diff
func NewKeeper(
cdc codec.BinaryCodec,
key storetypes.StoreKey,
paramSpace paramtypes.Subspace,
+ ics4Wrapper icatypes.ICS4Wrapper,
channelKeeper icatypes.ChannelKeeper,
portKeeper icatypes.PortKeeper,
accountKeeper icatypes.AccountKeeper,
scopedKeeper icatypes.ScopedKeeper,
msgRouter icatypes.MessageRouter,
) Keeper
```

### Core

The `key` parameter of the `NewKeeper` function in `modules/core/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
Expand Down Expand Up @@ -198,6 +179,23 @@ type MessageRouter interface {

The `RegisterRESTRoutes` function in `modules/apps/27-interchain-accounts` has been removed.

An additional parameter, `ics4Wrapper` has been added to the `host` submodule `NewKeeper` function in `modules/apps/27-interchain-accounts/host/keeper`.
This allows the `host` submodule to correctly unwrap the channel version for channel reopening handshakes in the `OnChanOpenTry` callback.

```diff
func NewKeeper(
cdc codec.BinaryCodec,
key storetypes.StoreKey,
paramSpace paramtypes.Subspace,
+ ics4Wrapper icatypes.ICS4Wrapper,
channelKeeper icatypes.ChannelKeeper,
portKeeper icatypes.PortKeeper,
accountKeeper icatypes.AccountKeeper,
scopedKeeper icatypes.ScopedKeeper,
msgRouter icatypes.MessageRouter,
) Keeper
```

#### Cosmos SDK message handler responses in packet acknowledgement

The construction of the transaction response of a message execution on the host chain has changed. The `Data` field in the `sdk.TxMsgData` has been deprecated and since Cosmos SDK 0.46 the `MsgResponses` field contains the message handler responses packed into `Any`s.
Expand Down
72 changes: 72 additions & 0 deletions e2e/scripts/test-matricies/main/test-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,90 @@
"test-entry-point": "TestTransferTestSuite",
"chain-binary": "simd",
"tests": [
{
"chain-a-tag": "main",
"chain-b-tag": "v4.1.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v4.0.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v3.3.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v3.2.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v3.1.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v3.0.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v2.4.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v2.3.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v2.2.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v2.1.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v2.0.0"
},
{
"chain-a-tag": "v4.1.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v4.0.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v3.3.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v3.2.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v3.1.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v3.0.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v2.4.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v2.3.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v2.2.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v2.1.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v2.0.0",
"chain-b-tag": "main"
Expand All @@ -33,9 +97,17 @@
"test-entry-point": "TestIncentivizedTransferTestSuite",
"chain-binary": "simd",
"tests": [
{
"chain-a-tag": "main",
"chain-b-tag": "v4.1.0"
},
{
"chain-a-tag": "main",
"chain-b-tag": "v4.0.0"
},
{
"chain-a-tag": "v4.1.0",
"chain-b-tag": "main"
},
{
"chain-a-tag": "v4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/27-interchain-accounts/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func GetQueryCmd() *cobra.Command {
icaQueryCmd := &cobra.Command{
Use: "interchain-accounts",
Aliases: []string{"ica"},
Short: "interchain-accounts subcommands",
Short: "IBC interchain accounts query subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}
Expand All @@ -30,7 +30,7 @@ func NewTxCmd() *cobra.Command {
icaTxCmd := &cobra.Command{
Use: "interchain-accounts",
Aliases: []string{"ica"},
Short: "interchain-accounts tx subcommands",
Short: "IBC interchain accounts transaction subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func GetQueryCmd() *cobra.Command {
queryCmd := &cobra.Command{
Use: "controller",
Short: "interchain-accounts controller subcommands",
Short: "IBC interchain accounts controller query subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}
Expand All @@ -27,7 +27,7 @@ func GetQueryCmd() *cobra.Command {
func NewTxCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "controller",
Short: "ica controller transactions subcommands",
Short: "IBC interchain accounts controller transaction subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/27-interchain-accounts/host/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
func GetQueryCmd() *cobra.Command {
queryCmd := &cobra.Command{
Use: "host",
Short: "interchain-accounts host subcommands",
Short: "IBC interchain accounts host query subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
}
Expand Down
6 changes: 3 additions & 3 deletions modules/apps/29-fee/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/ibc-go/v6/modules/apps/29-fee/types"
Expand Down Expand Up @@ -34,8 +33,9 @@ type Keeper struct {

// NewKeeper creates a new 29-fee Keeper instance
func NewKeeper(
cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace,
ics4Wrapper types.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper,
cdc codec.BinaryCodec, key storetypes.StoreKey,
ics4Wrapper types.ICS4Wrapper, channelKeeper types.ChannelKeeper,
portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper,
) Keeper {
return Keeper{
cdc: cdc,
Expand Down
3 changes: 1 addition & 2 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ type SimApp struct {
// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper
ScopedFeeMockKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -389,7 +388,7 @@ func NewSimApp(

// IBC Fee Module keeper
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec, keys[ibcfeetypes.StoreKey], app.GetSubspace(ibcfeetypes.ModuleName),
appCodec, keys[ibcfeetypes.StoreKey],
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
Expand Down

0 comments on commit 11627f6

Please sign in to comment.