eWASM
概要
[Alexによるテストネットデモ動画 https://www.youtube.com/watch?v=vj6o6UCfyIY
メリット(略、補足)
速い
ハードフォークでprecompileを追加する必要がない
標準的
CPUのインストラクションによく対応するので、gasの見積もりがしやすい
終わっていること
Precompiled Contractの実装
テストネット開始
Hera
Hera: ewasm virtual machine conforming to the EVMC API
C++によるeWASM VMの実装
nrryuya.icon > いや古いかもこれ
WASMバックエンドに関しては、インタプリタ、AOT/JITをサポートする(予定)
Binaryenをcomplete support, wabtとWAVMはlimited support
テストネット
EVMのコードもeWASMのコードも両方実行できる
メインネットとの違いは、
Spurious Dragon(2016年秋にDoS対策のため2段階で行われたHF)で導入されたcode size limit上限はない
バイトコード中のzero bytesはnon-zero bytesと同じだけコストかかってしまう
現状go-ethereum + Hera (with EVMC)
Aleth (旧称cpp-ethereum) + HeraはWIP
testnetのブロックエクスプローラ, eWASM Studio(ブラウザIDE), Faucet
gas cost
まだ決まっていないが、computational opcodes (not state I/O) は下がる見込み
2018年10月時点ではup in the air right now gitter Ethereumノードの平均的なCPU性能に仮定を設け、前提として1秒のCPU使用を10M gas (1 gasを0.1 us) としている
ここから、0.0045 gas per cycleとして計算している
256bitのEVMで3gasだった算術的opcodeは、最大64bitのeWASMでは1/4でよくて0.75gasで良いのでは
Greg Colvin氏
The desire for a faster VM is to stop the need for writing precompiled contracts. They only exist because the EVM isn’t fast enough, and/or charges too much gas. Secondarily, to let users do similar expensive crypto stuff that we didn’t put into a precompile for them.
Another reason for eWasm is the desire to reuse other work, so far as languages, compilers, VMs, IDEs etc.
VM Matters: A Comparison of WASM VMs and EVMs in the Performance of Blockchain Smart Contracts