From 962524f0332a3efdf3686e034a4e125c42d6f34a Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 4 Mar 2024 15:15:54 +0100 Subject: [PATCH 1/3] docs: add documentation on default accept list in stargate wasm querier --- 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 7cbe7929f13..75fadcf71ea 100644 --- a/docs/docs/03-light-clients/04-wasm/03-integration.md +++ b/docs/docs/03-light-clients/04-wasm/03-integration.md @@ -254,7 +254,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 lightclient 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. @@ -271,6 +271,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 lightclient smart contracts to delegate to parts of their workflows to other lightclients 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: From 4cd82c3f05c3dbec0f8b8d8c45bb9661a63fb8dd Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 4 Mar 2024 15:17:59 +0100 Subject: [PATCH 2/3] fix: typos --- docs/docs/03-light-clients/04-wasm/03-integration.md | 2 +- 1 file changed, 1 insertion(+), 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 75fadcf71ea..b6350fad4cf 100644 --- a/docs/docs/03-light-clients/04-wasm/03-integration.md +++ b/docs/docs/03-light-clients/04-wasm/03-integration.md @@ -272,7 +272,7 @@ 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 lightclient smart contracts to delegate to parts of their workflows to other lightclients for auxiliary proof verification. For example, proof of inclusion of block and tx data by a data availability provider. +The `defaultAcceptList` defines a single query route: `"/ibc.core.client.v1.Query/VerifyMembership"`. This allows for lightclient smart contracts to delegate parts of their workflow to other lightclients 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. From 2e7c2a3874c748f18ffcfdef2531fd06db601e34 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Mon, 4 Mar 2024 21:46:57 +0100 Subject: [PATCH 3/3] indentation and split lightclient in 2 words --- docs/docs/03-light-clients/04-wasm/03-integration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b6350fad4cf..31c069f6dc5 100644 --- a/docs/docs/03-light-clients/04-wasm/03-integration.md +++ b/docs/docs/03-light-clients/04-wasm/03-integration.md @@ -254,7 +254,7 @@ Currently the only option available is the `WithQueryPlugins` option, which allo #### `WithQueryPlugins` -By default, the `08-wasm` module does not configure any querier options for lightclient 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). +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. @@ -272,12 +272,12 @@ 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 lightclient smart contracts to delegate parts of their workflow to other lightclients for auxiliary proof verification. For example, proof of inclusion of block and tx data by a data availability provider. +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", + "/ibc.core.client.v1.Query/VerifyMembership", } ```