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
Wasm-metering achieves result based persistence between wasm invocations by storing all available fields of the instance (code, memory etc.) after execution.
What is not possible yet is creating snapshots of (and thus comparing) running programs (as in truebit) and restoring the full program state in another instance.
The wasm-metering/Dfinity approach only stores modified memories after/between calls (inter-call). If an execution traps, it is not possible to capture the full VM state and resume the execution.
Achieving full state snapshots
Future Wasm features may allow at least partial implementation (through continuations/exceptions) of this.
At the moment, it may be possible to transform .wasm sources into programs that
mirror their state to memory
halt execution when resource limits are reached (wasm-metering achieves this)
extract and serialize their state when this happens
Unfortunately, Wasm has many limitations when it comes to accessing program state, due to optimization:
the stack of the enclosing blocks cannot be accessed
there is only one memory, which would require interleaving the mirrored program state representation with normal state while keeping the latter intact
as far as I know it's not possible to restore the stack state from scratch (especially call frames) without reexecution
The text was updated successfully, but these errors were encountered:
void4
changed the title
Intra-call persistence for WebAssembly
Extending WebAssembly to be a Resource Aware Recursive Virtual Machine (RARVM)
Aug 8, 2018
I love the idea of programs jumping between systems.
Why WebAssembly
Advantages:
Disadvantages:
Intra-call persistence
ewasm/wasm-metering#20
Wasm-metering achieves result based persistence between wasm invocations by storing all available fields of the instance (code, memory etc.) after execution.
What is not possible yet is creating snapshots of (and thus comparing) running programs (as in truebit) and restoring the full program state in another instance.
The wasm-metering/Dfinity approach only stores modified memories after/between calls (inter-call). If an execution traps, it is not possible to capture the full VM state and resume the execution.
Achieving full state snapshots
Future Wasm features may allow at least partial implementation (through continuations/exceptions) of this.
At the moment, it may be possible to transform .wasm sources into programs that
Unfortunately, Wasm has many limitations when it comes to accessing program state, due to optimization:
There seem to be three ways of solving this:
Due to the stack access issue, I pursue option 3 right now.
VM implementations that allow extension in reasonable time
warpy
https://github.com/kanaka/warpy/
I managed to extend the https://github.com/kanaka/warpy RPython Wasm JIT VM and extracted full state snapshots.
RPython
Advantages:
Disadvantages:
kanaka/warpy#2
webassemblyjs
https://github.com/xtuc/webassemblyjs/
Advantages:
Disadvantages:
xtuc/webassemblyjs#432
The text was updated successfully, but these errors were encountered: