Skip to content

Commit ef1cf05

Browse files
authored
fix: revert removing wasm configs (#249)
* Revert "Apply Finschia/finschia-sdk@a642968ccb" This reverts commit fdd41c1. * Update CHANGELOG.md
1 parent ea69550 commit ef1cf05

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4747

4848
### Bug Fixes
4949
* (build) [\#236](https://github.com/Finschia/finschia/pull/236) fix compile error when the build_tags is multiple.
50+
* (wasm) [\#249](https://github.com/Finschia/finschia/pull/249) revert removing wasm configs
5051

5152
### Breaking Changes
5253
* (ostracon) [\#240](https://github.com/Finschia/finschia/pull/240) remove `libsodium` vrf library

cmd/fnsad/cmd/root.go

+22-1
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,19 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
9696
func initAppConfig() (string, interface{}) {
9797
// The following code snippet is just for reference.
9898

99+
// WASMConfig defines configuration for the wasm module.
100+
type WASMConfig struct {
101+
// This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
102+
QueryGasLimit uint64 `mapstructure:"query_gas_limit"`
103+
104+
// Address defines the gRPC-web server to listen on
105+
LruSize uint64 `mapstructure:"lru_size"`
106+
}
107+
99108
type CustomAppConfig struct {
100109
serverconfig.Config
110+
111+
WASM WASMConfig `mapstructure:"wasm"`
101112
}
102113

103114
// Optionally allow the chain developer to overwrite the SDK's default
@@ -120,9 +131,19 @@ func initAppConfig() (string, interface{}) {
120131

121132
customAppConfig := CustomAppConfig{
122133
Config: *srvCfg,
134+
WASM: WASMConfig{
135+
LruSize: 1,
136+
QueryGasLimit: 300000,
137+
},
123138
}
124139

125-
customAppTemplate := serverconfig.DefaultConfigTemplate
140+
customAppTemplate := serverconfig.DefaultConfigTemplate + `
141+
[wasm]
142+
# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
143+
query_gas_limit = 300000
144+
# This is the number of wasm vm instances we keep cached in memory for speed-up
145+
# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
146+
lru_size = 0`
126147

127148
return customAppTemplate, customAppConfig
128149
}

0 commit comments

Comments
 (0)