-
Notifications
You must be signed in to change notification settings - Fork 8
WASM: Run a WASM binary on Wasmtime running in SGX #5
Comments
I watched a youtube video https://youtu.be/8IvWPeavjiQ?t=1957 . They have wasmi in SGX back in 2018.May I ask what the benefit is to run wasmtime (rather than wasmi) in SGX? |
@kevingzhang wasmi is an interpreter (slow). wasmtime is a JIT (fast). |
Thank you @npmccallum for your super quick response. I never expect an answer so soon. |
@kevingzhang Can you explain that situation in greater detail? |
Sure. This is similar to cloud computing but a prepaid model. This model can protect the miners from DDoS or Infinity Loop attack. If there is not such a gas system, the attacker simply submits an infinity loop in function to exhaust all miners' computing power to stop the blockchain. In Etherium, code is running inside EVM, a special virtual machine. All opcode is measured with a predefined price. When code is running inside the EVM, the gas meter calculates how much gas remains. The gas limit runs out, EVM will throw a gas-run-out exception then exit. In this case, the state of blockchain will roll back to the original state without any change, as if the function is never run. From the business point of view, likely our Knarx will be run as a cloud / edge / blockchain computing platform, metering is an important part. Have you already designed something on metering wasm execution? |
We'd like to build out a series of demos for our progress on Enarx's WASM support.
This one is the most advanced: running WASM through Wasmtime running on top of SGX. This is the closest representation of the eventual use case we envision for WASM in Enarx.
Some additional possibilities include building out architecture for an eventual end-user, and setting this up in a client-server setting.
The text was updated successfully, but these errors were encountered: