Skip to content

Commit aed1de9

Browse files
Merge branch 'main' into tuan/formatting-enum
2 parents 07f6f13 + 0834229 commit aed1de9

File tree

8 files changed

+114
-6
lines changed

8 files changed

+114
-6
lines changed

.github/workflows/callbacks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
steps:
5757
- name: sonarcloud
5858
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
59-
uses: SonarSource/sonarcloud-github-action@v2.1.1
59+
uses: SonarSource/sonarcloud-github-action@v2.2.0
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/capability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
steps:
4343
- name: sonarcloud
4444
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
45-
uses: SonarSource/sonarcloud-github-action@v2.1.1
45+
uses: SonarSource/sonarcloud-github-action@v2.2.0
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
name: '${{ github.sha }}-03-coverage'
143143
- name: sonarcloud
144144
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
145-
uses: SonarSource/sonarcloud-github-action@v2.1.1
145+
uses: SonarSource/sonarcloud-github-action@v2.2.0
146146
env:
147147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148148
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/wasm-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
steps:
6464
- name: sonarcloud
6565
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
66-
uses: SonarSource/sonarcloud-github-action@v2.1.1
66+
uses: SonarSource/sonarcloud-github-action@v2.2.0
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6969
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

docs/docs/03-light-clients/04-wasm/03-integration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The following table shows the compatibility matrix between the `08-wasm` module,
2121

2222
| **Version** | **Git commit to import** |
2323
|:--------------------------------:|:----------------------------------------:|
24+
| `v0.2.0+ibc-go-v8.3-wasmvm-v2.0` | 4b45d1822fb6a0698e7621112b92c13679061c40 |
2425
| `v0.1.1+ibc-go-v7.3-wasmvm-v1.5` | 7ee2a2452b79d0bc8316dc622a1243afa058e8cb |
2526
| `v0.1.0+ibc-go-v8.0-wasmvm-v1.5` | 57fcdb9a9a9db9b206f7df2f955866dc4e10fef4 |
2627
| `v0.1.0+ibc-go-v7.3-wasmvm-v1.5` | b306e7a706e1f84a5e11af0540987bd68de9bae5 |
@@ -283,7 +284,7 @@ Currently the only option available is the `WithQueryPlugins` option, which allo
283284

284285
#### `WithQueryPlugins`
285286

286-
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).
287+
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/v2.0.1/packages/std/src/query/mod.rs#L48) and [`QueryRequest::Stargate`](https://github.com/CosmWasm/cosmwasm/blob/v2.0.1/packages/std/src/query/mod.rs#L57-L65).
287288

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

docs/versioned_docs/version-v8.3.x/03-light-clients/04-wasm/03-integration.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Currently the only option available is the `WithQueryPlugins` option, which allo
272272

273273
#### `WithQueryPlugins`
274274

275-
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).
275+
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/v2.0.1/packages/std/src/query/mod.rs#L48) and [`QueryRequest::Stargate`](https://github.com/CosmWasm/cosmwasm/blob/v2.0.1/packages/std/src/query/mod.rs#L57-L65).
276276

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

@@ -289,6 +289,16 @@ queryPlugins := ibcwasmtypes.QueryPlugins {
289289
}
290290
```
291291

292+
Note that the `Stargate` querier appends the user defined accept list of query routes to a default list defined by the `08-wasm` module.
293+
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.
294+
295+
```go
296+
// defaultAcceptList defines a set of default allowed queries made available to the Querier.
297+
var defaultAcceptList = []string{
298+
"/ibc.core.client.v1.Query/VerifyMembership",
299+
}
300+
```
301+
292302
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.
293303

294304
Then, we pass the `QueryPlugins` object to the `WithQueryPlugins` option:

docs/versioned_docs/version-v8.3.x/03-light-clients/04-wasm/08-client.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ simd tx ibc-wasm store-code [path/to/wasm-file] [flags]
2929

3030
`path/to/wasm-file` is the path to the `.wasm` or `.wasm.gz` file.
3131

32+
#### `migrate-contract`
33+
34+
The `migrate-contract` command allows users to broadcast a transaction with a `MsgMigrateContract` to migrate the contract for a given light client to a new byte code denoted by the given checksum.
35+
36+
```shell
37+
simd tx ibc-wasm migrate-contract [client-id] [checksum] [migrate-msg]
38+
```
39+
40+
The migrate message must not be empty and is expected to be a JSON-encoded string.
41+
3242
### Query
3343

3444
The `query` commands allow users to query `08-wasm` state.

docs/versioned_docs/version-v8.3.x/03-light-clients/04-wasm/09-migrations.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,90 @@ This guide provides instructions for migrating 08-wasm versions.
1414
## Chains
1515

1616
In the 08-wasm versions compatible with ibc-go v7.3.x and above from the v7 release line, the checksums of the uploaded Wasm bytecodes are all stored under a single key. From ibc-go v8.0.x the checksums are stored using [`collections.KeySet`](https://docs.cosmos.network/v0.50/build/packages/collections#keyset), whose full functionality became available in Cosmos SDK v0.50. There is therefore an [automatic migration handler](https://github.com/cosmos/ibc-go/blob/57fcdb9a9a9db9b206f7df2f955866dc4e10fef4/modules/light-clients/08-wasm/module.go#L115-L118) configured in the 08-wasm module to migrate the stored checksums to `collections.KeySet`.
17+
18+
## From v0.1.0+ibc-go-v8.0-wasmvm-v1.5 to v0.2.0-ibc-go-v8.3-wasmvm-v2.0
19+
20+
The `WasmEngine` interface has been updated to reflect changes in the function signatures of Wasm VM:
21+
22+
```diff
23+
type WasmEngine interface {
24+
- StoreCode(code wasmvm.WasmCode) (wasmvm.Checksum, error)
25+
+ StoreCode(code wasmvm.WasmCode, gasLimit uint64) (wasmvmtypes.Checksum, uint64, error)
26+
27+
StoreCodeUnchecked(code wasmvm.WasmCode) (wasmvm.Checksum, error)
28+
29+
Instantiate(
30+
checksum wasmvm.Checksum,
31+
env wasmvmtypes.Env,
32+
info wasmvmtypes.MessageInfo,
33+
initMsg []byte,
34+
store wasmvm.KVStore,
35+
goapi wasmvm.GoAPI,
36+
querier wasmvm.Querier,
37+
gasMeter wasmvm.GasMeter,
38+
gasLimit uint64,
39+
deserCost wasmvmtypes.UFraction,
40+
- ) (*wasmvmtypes.Response, uint64, error)
41+
+ ) (*wasmvmtypes.ContractResult, uint64, error)
42+
43+
Query(
44+
checksum wasmvm.Checksum,
45+
env wasmvmtypes.Env,
46+
queryMsg []byte,
47+
store wasmvm.KVStore,
48+
goapi wasmvm.GoAPI,
49+
querier wasmvm.Querier,
50+
gasMeter wasmvm.GasMeter,
51+
gasLimit uint64,
52+
deserCost wasmvmtypes.UFraction,
53+
- ) ([]byte, uint64, error)
54+
+ ) (*wasmvmtypes.QueryResult, uint64, error)
55+
56+
Migrate(
57+
checksum wasmvm.Checksum,
58+
env wasmvmtypes.Env,
59+
migrateMsg []byte,
60+
store wasmvm.KVStore,
61+
goapi wasmvm.GoAPI,
62+
querier wasmvm.Querier,
63+
gasMeter wasmvm.GasMeter,
64+
gasLimit uint64,
65+
deserCost wasmvmtypes.UFraction,
66+
- ) (*wasmvmtypes.Response, uint64, error)
67+
+ ) (*wasmvmtypes.ContractResult, uint64, error)
68+
69+
Sudo(
70+
checksum wasmvm.Checksum,
71+
env wasmvmtypes.Env,
72+
sudoMsg []byte,
73+
store wasmvm.KVStore,
74+
goapi wasmvm.GoAPI,
75+
querier wasmvm.Querier,
76+
gasMeter wasmvm.GasMeter,
77+
gasLimit uint64,
78+
deserCost wasmvmtypes.UFraction,
79+
- ) (*wasmvmtypes.Response, uint64, error)
80+
+ ) (*wasmvmtypes.ContractResult, uint64, error)
81+
82+
GetCode(checksum wasmvm.Checksum) (wasmvm.WasmCode, error)
83+
84+
Pin(checksum wasmvm.Checksum) error
85+
86+
Unpin(checksum wasmvm.Checksum) error
87+
}
88+
```
89+
90+
Similar changes were required in the functions of the `MockWasmEngine` interface.
91+
92+
### Chains
93+
94+
The `SupportedCapabilities` field of `WasmConfig` is now of type `[]string`:
95+
96+
```diff
97+
type WasmConfig struct {
98+
DataDir string
99+
- SupportedCapabilities string
100+
+ SupportedCapabilities []string
101+
ContractDebugMode bool
102+
}
103+
```

0 commit comments

Comments
 (0)