Implement WASM instance restart to handle out of memory error (#81)

* Test case for wasm out of memory error

* Restart wasm instance after N blocks

* Handle out of memory error and re instantiate WASM

* Remove old instance from map before reinstantiating WASM
This commit is contained in:
2021-12-28 16:08:05 +05:30
committed by nabarun
parent 68bc1c00db
commit 198e49e5a0
29 changed files with 181 additions and 63 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
"scripts": {
"lint": "eslint .",
"build": "tsc",
"asbuild:debug": "asc assembly/index.ts --lib ./node_modules --exportRuntime --target debug --runPasses asyncify",
"asbuild:debug": "asc assembly/index.ts --lib ./node_modules --exportRuntime --target debug --runPasses asyncify --runtime stub --maximumMemory 10",
"asbuild:release": "asc assembly/index.ts --lib ./node_modules --exportRuntime --target release --runPasses asyncify",
"asbuild": "yarn asbuild:debug && yarn asbuild:release",
"test": "yarn asbuild:debug && DEBUG=vulcanize:* mocha src/**/*.test.ts",