Skip to content

Commit

Permalink
feat(statemachine)!: Add allow all client wildcard to AllowedClients …
Browse files Browse the repository at this point in the history
…param (#5429)

* add wildcard allow all client

* minor

* fix lint

* minor and doc update

* review comments

* if allow all clients is present, no other client types should be in the allow list

* clean up code to allow wasm client type

* remove unused variable

* Fix build failures, tweak err message.

* modify allow clients list in genesis with feature releases

* chore: adding v8.1 to minor versions in e2e feat releases struct

* update docs

* chore: doc lint fixes

---------

Co-authored-by: GnaD <[email protected]>
Co-authored-by: Du Nguyen <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: Đỗ Việt Hoàng <[email protected]>
Co-authored-by: Charly <[email protected]>
(cherry picked from commit d5949b1)

# Conflicts:
#	docs/docs/03-light-clients/04-wasm/03-integration.md
#	e2e/tests/wasm/grandpa_test.go
#	e2e/testsuite/testconfig.go
#	e2e/testvalues/values.go
#	modules/core/02-client/types/params.go
#	modules/core/02-client/types/params_test.go
#	modules/light-clients/08-wasm/keeper/keeper_test.go
#	modules/light-clients/08-wasm/testing/wasm_endpoint.go
#	modules/light-clients/08-wasm/types/types_test.go
  • Loading branch information
sontrinh16 authored and mergify[bot] committed Jan 15, 2024
1 parent 3833f1e commit f44b60c
Show file tree
Hide file tree
Showing 14 changed files with 2,523 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/docs/01-ibc/11-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ slug: /ibc/troubleshooting
If it is being reported that a client state is unauthorized, this is due to the client type not being present
in the [`AllowedClients`](https://github.com/cosmos/ibc-go/blob/v6.0.0/modules/core/02-client/types/client.pb.go#L345) array.

Unless the client type is present in this array, all usage of clients of this type will be prevented.
Unless the client type is present in this array or the `AllowAllClients` wildcard (`"*"`) is used, all usage of clients of this type will be prevented.
2 changes: 2 additions & 0 deletions docs/docs/03-light-clients/01-developer-guide/09-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,5 @@ where `proposal.json` contains:
"deposit": "100stake"
}
```

If the `AllowedClients` list contains a single element that is equal to the wildcard `"*"`, then all client types are allowed and it is thus not necessary to submit a governance proposal to update the parameter.
9 changes: 4 additions & 5 deletions docs/docs/03-light-clients/02-localhost/02-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ slug: /ibc/light-clients/localhost/integration

The 09-localhost light client module registers codec types within the core IBC module. This differs from other light client module implementations which are expected to register codec types using the `AppModuleBasic` interface.

The localhost client is added to the 02-client submodule param [`allowed_clients`](https://github.com/cosmos/ibc-go/blob/v7.0.0/proto/ibc/core/client/v1/client.proto#L102) by default in ibc-go.
The localhost client is implicitly enabled by using the `AllowAllClients` wildcard (`"*"`) in the 02-client submodule default value for param [`allowed_clients`](https://github.com/cosmos/ibc-go/blob/v7.0.0/proto/ibc/core/client/v1/client.proto#L102).

```go
var (
// DefaultAllowedClients are the default clients for the AllowedClients parameter.
DefaultAllowedClients = []string{exported.Solomachine, exported.Tendermint, exported.Localhost}
)
// DefaultAllowedClients are the default clients for the AllowedClients parameter.
// By default it allows all client types.
var DefaultAllowedClients = []string{AllowAllClients}
```
368 changes: 368 additions & 0 deletions docs/docs/03-light-clients/04-wasm/03-integration.md

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions docs/params/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ slug: /params.md

The 02-client submodule contains the following parameters:

| Key | Type | Default Value |
| ---------------- | -------- | ------------------------------------------------- |
| `AllowedClients` | []string | `"06-solomachine","07-tendermint","09-localhost"` |
| Key | Type | Default Value |
| ---------------- | -------- | ------------- |
| `AllowedClients` | []string | `"*"` |

### AllowedClients

The allowed clients parameter defines an allowlist of client types supported by the chain. A client
that is not registered on this list will fail upon creation or on genesis validation. Note that,
since the client type is an arbitrary string, chains they must not register two light clients which
return the same value for the `ClientType()` function, otherwise the allowlist check can be
The allowed clients parameter defines an allow list of client types supported by the chain. The
default value is a single-element list containing the `AllowAllClients` wildcard (`"*"`). When the
wilcard is used, then all client types are supported by default. Alternatively, the parameter
may be set with a list of client types (e.g. `"06-solomachine","07-tendermint","09-localhost"`).
A client type that is not registered on this list will fail upon creation or on genesis validation.
Note that, since the client type is an arbitrary string, chains must not register two light clients
which return the same value for the `ClientType()` function, otherwise the allow list check can be
bypassed.
Loading

0 comments on commit f44b60c

Please sign in to comment.