-
Notifications
You must be signed in to change notification settings - Fork 636
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
deps: bump wasmvm v2.0.0 #5909
deps: bump wasmvm v2.0.0 #5909
Changes from all commits
ca50268
0a94230
9c84888
0bd148c
3f0cab8
d094d59
af87253
5175e64
b3724c3
912add4
8d149ee
09f97a9
7862cfa
03d5252
9be52a7
9c118a7
2481603
b3cbc37
52232dc
cb7ad15
98f5f31
52d1575
5905c02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,9 @@ When it comes to instantiating `08-wasm`'s keeper there are two recommended ways | |
|
||
### If `x/wasm` is present | ||
|
||
If the chain where the module is integrated uses `x/wasm` then we recommend that both `08-wasm` and `x/wasm` share the same Wasm VM instance. Having two separate Wasm VM instances is still possible, but care should be taken to make sure that both instances do not share the directory when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happen. | ||
If the chain where the module is integrated uses `x/wasm` then we recommend that both `08-wasm` and `x/wasm` share the same Wasm VM instance. Having two separate Wasm VM instances is still possible, but care should be taken to make sure that both instances do not share the directory when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happen (from `x/wasm` v0.51 and `08-wasm` v0.2.0.0+ibc-go-v8.2-wasmvm-v2.0 this will be forbidden anyway, since wasmvm v2.0.0 and above will not allow two different Wasm VM instances to shared the same data folder). | ||
|
||
In order to share the Wasm VM instance please follow the guideline below. Please note that this requires `x/wasm`v0.41 or above. | ||
In order to share the Wasm VM instance please follow the guideline below. Please note that this requires `x/wasm` v0.41 or above. | ||
|
||
- Instantiate the Wasm VM in `app.go` with the parameters of your choice. | ||
- [Create an `Option` with this Wasm VM instance](https://github.com/CosmWasm/wasmd/blob/db93d7b6c7bb6f4a340d74b96a02cec885729b59/x/wasm/keeper/options.go#L21-L25). | ||
Comment on lines
129
to
137
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The term "setup" when used as a verb should be two words. Consider changing it to "set up". - required to setup the `08-wasm` module
+ required to set up the `08-wasm` module |
||
|
@@ -146,7 +146,7 @@ import ( | |
... | ||
"github.com/cosmos/cosmos-sdk/runtime" | ||
|
||
wasmvm "github.com/CosmWasm/wasmvm" | ||
wasmvm "github.com/CosmWasm/wasmvm/v2" | ||
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" | ||
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" | ||
|
||
Comment on lines
146
to
152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The term "setup" when used as a verb should be two words. Consider changing it to "set up". - required to setup the `08-wasm` module
+ required to set up the `08-wasm` module
The word "otherwise" is used in a way that might confuse readers. Consider breaking the sentence for better readability and to adhere to American English spelling conventions. - otherwise unexpected behaviour is likely to happen.
+ otherwise, unexpected behavior is likely to happen. |
||
|
@@ -214,10 +214,10 @@ app.WasmClientKeeper = ibcwasmkeeper.NewKeeperWithVM( | |
If the chain does not use [`x/wasm`](https://github.com/CosmWasm/wasmd/tree/main/x/wasm), even though it is still possible to use the method above from the previous section | ||
(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [`NewKeeperWithVM` constructor function](https://github.com/cosmos/ibc-go/blob/57fcdb9a9a9db9b206f7df2f955866dc4e10fef4/modules/light-clients/08-wasm/keeper/keeper.go#L39-L47), since there would be no need in this case to share the Wasm VM instance with another module, you can use the [`NewKeeperWithConfig` constructor function](https://github.com/cosmos/ibc-go/blob/57fcdb9a9a9db9b206f7df2f955866dc4e10fef4/modules/light-clients/08-wasm/keeper/keeper.go#L88-L96) and provide the Wasm VM configuration parameters of your choice instead. A Wasm VM instance will be created in `NewKeeperWithConfig`. The parameters that can set are: | ||
|
||
- `DataDir` is the [directory for Wasm blobs and various caches](https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/lib.go#L25). In `wasmd` this is set to the [`wasm` folder under the home directory](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L578). | ||
- `SupportedCapabilities` is a comma separated [list of capabilities supported by the chain](https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/lib.go#L26). [`wasmd` sets this to all the available capabilities](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L586), but 08-wasm only requires `iterator`. | ||
- `MemoryCacheSize` sets [the size in MiB of an in-memory cache for e.g. module caching](https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/lib.go#L29C16-L29C104). It is not consensus-critical and should be defined on a per-node basis, often in the range 100 to 1000 MB. [`wasmd` reads this value of](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L579). Default value is 256. | ||
- `ContractDebugMode` is a [flag to enable/disable printing debug logs from the contract to STDOUT](https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/lib.go#L28). This should be false in production environments. Default value is false. | ||
- `DataDir` is the [directory for Wasm blobs and various caches](https://github.com/CosmWasm/wasmvm/blob/v2.0.0/lib.go#L25). As an example, in `wasmd` this is set to the [`wasm` folder under the home directory](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L578). In the code snippet below we set this field to the `ibc_08-wasm_client_data` folder under the home directory. | ||
- `SupportedCapabilities` is a [list of capabilities supported by the chain](https://github.com/CosmWasm/wasmvm/blob/v2.0.0/lib.go#L26). [`wasmd` sets this to all the available capabilities](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L586), but 08-wasm only requires `iterator`. | ||
- `MemoryCacheSize` sets [the size in MiB of an in-memory cache for e.g. module caching](https://github.com/CosmWasm/wasmvm/blob/v2.0.0/lib.go#L29C16-L29C104). It is not consensus-critical and should be defined on a per-node basis, often in the range 100 to 1000 MB. [`wasmd` reads this value of](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/app/app.go#L579). Default value is 256. | ||
- `ContractDebugMode` is a [flag to enable/disable printing debug logs from the contract to STDOUT](https://github.com/CosmWasm/wasmvm/blob/v2.0.0/lib.go#L28). This should be false in production environments. Default value is false. | ||
|
||
Another configuration parameter of the Wasm VM is the contract memory limit (in MiB), which is [set to 32](https://github.com/cosmos/ibc-go/blob/57fcdb9a9a9db9b206f7df2f955866dc4e10fef4/modules/light-clients/08-wasm/types/config.go#L8), [following the example of `wasmd`](https://github.com/CosmWasm/wasmd/blob/36416def20effe47fb77f29f5ba35a003970fdba/x/wasm/keeper/keeper.go#L32-L34). This parameter is not configurable by users of `08-wasm`. | ||
|
||
|
@@ -240,7 +240,7 @@ import ( | |
// directory for Wasm blobs and caches will be created | ||
wasmConfig := ibcwasmtypes.WasmConfig{ | ||
DataDir: filepath.Join(homePath, "ibc_08-wasm_client_data"), | ||
SupportedCapabilities: "iterator", | ||
SupportedCapabilities: []string{"iterator"}, | ||
ContractDebugMode: false, | ||
} | ||
app.WasmClientKeeper = ibcwasmkeeper.NewKeeperWithConfig( | ||
Comment on lines
240
to
246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The term "setup" in "required to setup the - required to setup the `08-wasm` module
+ required to set up the `08-wasm` module
The phrase "otherwise unexpected behaviour is likely to happen" could be improved for clarity and to adhere to American English spelling conventions. Also, consider breaking the sentence for better readability. - otherwise unexpected behaviour is likely to happen.
+ otherwise, unexpected behavior is likely to happen. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "otherwise" is used in a way that might confuse readers. Consider breaking the sentence for better readability and to adhere to American English spelling conventions.
Committable suggestion