-
ContextAs a part of ZK WASM compiler (https://github.com/near/wasmtime) written in Rust we are compiling WASM code (tests like this one) to zkAsm and want to execute the resulting zkAsm code. At the moment, we use a nodejs interpreter to run each zkAsm file using this script. This provides the necessary functionality, but the startup time of One of the ideas was to use https://deno.com/ runtime to run the JS code. This way it could be possible to embed Deno runtime into Rust binary which would remove the overheads of starting a subprocess. I did a quick prototype but it would require some changes to zkAsm codebase. See https://near.zulipchat.com/#narrow/stream/295306-pagoda.2Fcontract-runtime/topic/Running.20zkAsm.20code.20from.20Rust for full discussion. Questions
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello and good question! |
Beta Was this translation helpful? Give feedback.
-
I will explain how we run There must be a startup phase where all
The startup phase should be very fast. The testing phase depend pretty much on the test you are running and the machine CPUs |
Beta Was this translation helpful? Give feedback.
I will explain how we run
zkasm
test in parallel.We use the well know framework
mocha
to run the tests. This framework allows you to run test in parallel by just adding--parallel
and you can define--jobs $NUM_CPUS
to use.There must be a startup phase where all
*.js
mocha files are generated:Then, we just run all of them in parallel:
The startup phase should be very fast. The testing phase depend pretty much on the test you are running and the…