Skip to content

Commit

Permalink
relocate audit reports + add migration handler for 08-wasm (cosmos#5423)
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega authored Dec 18, 2023
1 parent 87611b4 commit a047fa5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ To report a security vulnerability, see our [Coordinated Vulnerability Disclosur

The following audits have been performed on the `ibc-go` source code:

- [ICS27 Interchain Accounts](https://github.com/cosmos/ibc-go/blob/main/docs/audits/Trail%20of%20Bits%20audit%20-%20Final%20Report.pdf) by Trail of Bits.
- [ICS27 Interchain Accounts](https://github.com/cosmos/ibc-go/blob/main/docs/audits/27-interchain-accounts/Trail%20of%20Bits%20audit%20-%20Final%20Report.pdf) by Trail of Bits.
- [ICS08 Wasm Clients](https://github.com/cosmos/ibc-go/blob/main/docs/audits/08-wasm/Ethan%20Frey%20-%20Wasm%20Client%20Review.pdf) by Ethan Frey/Confio.

## Quick Navigation

Expand Down
26 changes: 23 additions & 3 deletions docs/docs/03-light-clients/04-wasm/03-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,29 @@ app.WasmClientKeeper = wasmkeeper.NewKeeperWithVM(
In order to use the `08-wasm` module chains must update the [`AllowedClients` parameter in the 02-client submodule](https://github.com/cosmos/ibc-go/blob/main/proto/ibc/core/client/v1/client.proto#L103) of core IBC. This can be configured directly in the application upgrade handler with the sample code below:

```go
params := clientKeeper.GetParams(ctx)
params.AllowedClients = append(params.AllowedClients, exported.Wasm)
clientKeeper.SetParams(ctx, params)
import (
...
wasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
...
)

...

func CreateWasmUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
clientKeeper clientkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
// explicitly update the IBC 02-client params, adding the wasm client type
params := clientKeeper.GetParams(ctx)
params.AllowedClients = append(params.AllowedClients, wasmtypes.Wasm)
clientKeeper.SetParams(ctx, params)

return mm.RunMigrations(ctx, configurator, vm)
}
}
```

Or alternatively the parameter can be updated via a governance proposal (see at the bottom of section [`Creating clients`](../01-developer-guide/09-setup.md#creating-clients) for an example of how to do this).
Expand Down

0 comments on commit a047fa5

Please sign in to comment.