near / wasmtime

Standalone JIT-style runtime for WebAssembly, using Cranelift
https://wasmtime.dev/
Apache License 2.0
3 stars 4 forks source link

Make the zkasm backend an externally loadable backend #16

Open aborg-dev opened 11 months ago

aborg-dev commented 11 months ago

This is a tracking bug for all things that we will need to submit https://github.com/near/wasmtime to upstream https://github.com/bytecodealliance/wasmtime.

The wasmtime guidelines can be found in https://docs.wasmtime.dev/stability-tiers.html

- [x] Add "zkasm" compile feature to Cargo
nagisa commented 10 months ago

FWIW, our discussions with wasmtime folks upstream have concluded in the direction that we probably aren’t going to be upstreaming this work straight away. There were some concerns from upstream about zkasm not being a "real hardware", it having low use and that having it upstream would affect the velocity of developing cranelift for people who have little interaction with the research on zero-knowledge; instead they have suggested that we might want to go in the direction of building an externally loadable backend and that they are very open to changes in cranelift proper to support an usecase like this.

aborg-dev commented 10 months ago

FWIW, our discussions with wasmtime folks upstream have concluded in the direction that we probably aren’t going to be upstreaming this work straight away. There were some concerns from upstream about zkasm not being a "real hardware", it having low use and that having it upstream would affect the velocity of developing cranelift for people who have little interaction with the research on zero-knowledge; instead they have suggested that we might want to go in the direction of building an externally loadable backend and that they are very open to changes in cranelift proper to support an usecase like this.

Yes, that's my understanding as well. Can you please link here the feature request on cranelift side to make external backends implementable?

nagisa commented 10 months ago

We do not have any issue(s) over at the upstream quite yet. As far as I know the infrastructure already exists, its just a question of finding out if there's anything missing that should be exposed over there.

aborg-dev commented 9 months ago

We discussed a related topic of reusing filetests infrastructure on the recent zkwasm dev meeting.

The conclusion was that supporting filetests for ZK ASM brings the following benefits:

The downsides are:

The ultimate decision was to not do this for now, as we already have a decent coverage with WASM Spec tests, and come back to this decision later when we need to support Cranelift instructions that are not tested through WASM codepath.