I believe that’s not true – metering can be implemented safely in the VM layer. That is, rather than instrumenting wasm itself, the wasm runtime can add instrumentation when compiling wasm to native code. That instrumentation can bypass host functions, and be significantly cheaper.
Wasmer already implements it:
I, however, don’t know:
- How production ready is it (Metering features · Issue #890 · wasmerio/wasmer · GitHub seems like a feature we need before this becomes truly usable)?
- How reliable is it?
- How compatible is it? (can we use it as a drop-in replacement for our metering, or do we need a protocol upgrade?)
- How much faster will it be (I do expect order-of-magnitude, but I don’t know)?