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

docs: fix migration/docs for ICA controller middleware (backport #2737) #2763

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
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
docs: fix migration/docs for ICA controller middleware (#2737)
* update docs/migration with the change to middleware for ICA controller

* improve variable naming

* alignment

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 1b7745f)
crodriguezvega authored and mergify[bot] committed Nov 15, 2022
commit ccdd8bb2beb5fe6ae3a53d6a6d921727843d4df1
20 changes: 11 additions & 9 deletions docs/apps/interchain-accounts/integration.md
Original file line number Diff line number Diff line change
@@ -96,14 +96,15 @@ icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper)
// ICA auth IBC Module
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)

// Create host and controller IBC Modules as desired
icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
// Create controller IBC application stack and host IBC module as desired
icaControllerStack := icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)

// Register host and authentication routes
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
AddRoute(icaauthtypes.ModuleName, icaControllerIBCModule) // Note, the authentication module is routed to the top level of the middleware stack
ibcRouter.
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
AddRoute(icaauthtypes.ModuleName, icaControllerStack) // Note, the authentication module is routed to the top level of the middleware stack

...

@@ -177,10 +178,11 @@ app.ICAAuthKeeper = icaauthkeeper.NewKeeper(appCodec, keys[icaauthtypes.StoreKey
icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper)
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)

// Create controller IBC Module
icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
// Create controller IBC application stack
icaControllerStack := icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)

// Register controller and authentication routes
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule)
ibcRouter.AddRoute(icaauthtypes.ModuleName, icaControllerIBCModule) // Note, the authentication module is routed to the top level of the middleware stack
ibcRouter.
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icaauthtypes.ModuleName, icaControllerStack) // Note, the authentication module is routed to the top level of the middleware stack
```
2 changes: 1 addition & 1 deletion docs/middleware/ics29-fee/integration.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ For Cosmos SDK chains this setup is done via the `app/app.go` file, where module

## Example integration of the Fee Middleware module

```
```go
// app.go

// Register the AppModule for the fee middleware module
13 changes: 12 additions & 1 deletion docs/migrations/v3-to-v4.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,18 @@ No genesis or in-place migrations required when upgrading from v1 or v2 of ibc-g

## Chains

### Fee Middleware
### ICS27 - Interchain Accounts

The controller submodule implements now the 05-port `Middleware` interface instead of the 05-port `IBCModule` interface. Chains that integrate the controller submodule, need to create it with the `NewIBCMiddleware` constructor function. For example:

```diff
- icacontroller.NewIBCModule(app.ICAControllerKeeper, icaAuthIBCModule)
+ icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
```

where `icaAuthIBCModule` is the Interchain Accounts authentication IBC Module.

### ICS29 - Fee Middleware

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.