perlin-network / life

A secure WebAssembly VM catered for decentralized applications.
MIT License
1.7k stars 122 forks source link

Virtual Machine Snapshots #68

Open void4 opened 5 years ago

void4 commented 5 years ago

I want to take a snapshot of the full virtual machine state so that I can restore it possibly even on another machine (in an external function that was called during the .wasm execution).

It seems necessary to only serialize the VirtualMachine struct for this, is this correct?

losfair commented 5 years ago

Only fields related to the runtime state (including CallStack, CurrentFrame, Globals, Memory, Yielded, NumValueSlots, Gas) need to be serialized. Other fields can be reconstructed from the same WebAssembly file and the same configuration.

void4 commented 5 years ago

Thank you!