From 3e42db3875ccd9df5d81ce8dc88487704d9b411a Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 5 Mar 2024 11:42:36 +0100 Subject: [PATCH] docs: add documentation on default accept list in stargate wasm querier (#5921) * docs: add documentation on default accept list in stargate wasm querier * fix: typos * indentation and split lightclient in 2 words --------- Co-authored-by: Carlos Rodriguez Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> --- docs/docs/03-light-clients/04-wasm/03-integration.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/docs/03-light-clients/04-wasm/03-integration.md b/docs/docs/03-light-clients/04-wasm/03-integration.md index 3f8580069c5..7b7f3d7ef2f 100644 --- a/docs/docs/03-light-clients/04-wasm/03-integration.md +++ b/docs/docs/03-light-clients/04-wasm/03-integration.md @@ -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. @@ -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: