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: add documentation on default accept list in stargate wasm querier #5921

Merged
merged 4 commits into from
Mar 5, 2024
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
12 changes: 11 additions & 1 deletion docs/docs/03-light-clients/04-wasm/03-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Currently the only option available is the `WithQueryPlugins` option, which allo

#### `WithQueryPlugins`

By default, the `08-wasm` module does not support any queries. However, it is possible to register custom query plugins for [`QueryRequest::Custom`](https://github.com/CosmWasm/cosmwasm/blob/v1.5.0/packages/std/src/query/mod.rs#L45) and [`QueryRequest::Stargate`](https://github.com/CosmWasm/cosmwasm/blob/v1.5.0/packages/std/src/query/mod.rs#L54-L61).
By default, the `08-wasm` module does not configure any querier options for light client contracts. However, it is possible to register custom query plugins for [`QueryRequest::Custom`](https://github.com/CosmWasm/cosmwasm/blob/v1.5.0/packages/std/src/query/mod.rs#L45) and [`QueryRequest::Stargate`](https://github.com/CosmWasm/cosmwasm/blob/v1.5.0/packages/std/src/query/mod.rs#L54-L61).

Assuming that the keeper is not yet instantiated, the following sample code shows how to register query plugins for the `08-wasm` module.

Expand All @@ -279,6 +279,16 @@ queryPlugins := ibcwasmtypes.QueryPlugins {
}
```

Note that the `Stargate` querier appends the user defined accept list of query routes to a default list defined by the `08-wasm` module.
The `defaultAcceptList` defines a single query route: `"/ibc.core.client.v1.Query/VerifyMembership"`. This allows for light client smart contracts to delegate parts of their workflow to other light clients for auxiliary proof verification. For example, proof of inclusion of block and tx data by a data availability provider.

```go
// defaultAcceptList defines a set of default allowed queries made available to the Querier.
var defaultAcceptList = []string{
"/ibc.core.client.v1.Query/VerifyMembership",
}
```

You may leave any of the fields in the `QueryPlugins` object as `nil` if you do not want to register a query plugin for that query type.

Then, we pass the `QueryPlugins` object to the `WithQueryPlugins` option:
Expand Down
Loading