You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As 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 npm run is around 700ms which would likely be too slow when we have more than 100 tests. We want to find a way to run these tests faster. We can't easily batch the execution into a single invocation of npm run as zkAsm files are generated on the fly by Rust tests that run in parallel.
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.
Discussed in https://github.com/orgs/0xPolygonHermez/discussions/66
Originally posted by akashin February 7, 2024
Context
As 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
npm run
is around 700ms which would likely be too slow when we have more than 100 tests. We want to find a way to run these tests faster. We can't easily batch the execution into a single invocation ofnpm run
as zkAsm files are generated on the fly by Rust tests that run in parallel.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.
Next steps
bun
nodejs runnerThe text was updated successfully, but these errors were encountered: