Skip to content

Commit

Permalink
change wasm-vm-memory-cache-size default config set place (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
yys authored Oct 11, 2021
1 parent 5bca395 commit 884d1f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x/wasm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ func NewKeeper(
paramspace = paramspace.WithKeyTable(types.ParamKeyTable())
}

// prevent zero write vm cache
if wasmConfig.WriteVMMemoryCacheSize == 0 {
wasmConfig.WriteVMMemoryCacheSize = config.DefaultWriteVMMemoryCacheSize
}

writeWasmVM, err := wasmvm.NewVM(
filepath.Join(homePath, config.DBDir),
supportedFeatures,
Expand All @@ -87,11 +92,6 @@ func NewKeeper(
wasmConfig.ReadVMMemoryCacheSize = config.DefaultReadVMMemoryCacheSize
}

// prevent zero write vm cache
if wasmConfig.WriteVMMemoryCacheSize == 0 {
wasmConfig.WriteVMMemoryCacheSize = config.DefaultWriteVMMemoryCacheSize
}

numReadVms := wasmConfig.NumReadVMs
wasmReadVMPool := make([]types.WasmerEngine, numReadVms)
for i := uint32(0); i < numReadVms; i++ {
Expand Down

0 comments on commit 884d1f3

Please sign in to comment.