eWASM
概要
2018/6月に書いたブログ, スライド
GitHub
[Alexによるテストネットデモ動画 https://www.youtube.com/watch?v=vj6o6UCfyIY
メリット(略、補足)
速い
ハードフォークでprecompileを追加する必要がない
標準的
CPUのインストラクションによく対応するので、gasの見積もりがしやすい
参考 gitter
終わっていること
Precompiled Contractの実装
AlexによるRustでの実装 GitHub Repo
テストネット開始
Hera
GitHub Repo
Hera: ewasm virtual machine conforming to the EVMC API
C++によるeWASM VMの実装
EVMからeWASMへのトランスパイルはevm2wasmを使っている(?)
nrryuya.icon > いや古いかもこれ
WASMバックエンドに関しては、インタプリタ、AOT/JITをサポートする(予定)
Binaryenをcomplete support, wabtとWAVMはlimited support
テストネット
GitHub Repo
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
ewasm.ethereum.org
testnetのブロックエクスプローラ, eWASM Studio(ブラウザIDE), Faucet
milestone
gas cost
まだ決まっていないが、computational opcodes (not state I/O) は下がる見込み
2018年10月時点ではup in the air right now gitter
2016年頃のAlexの試算
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で良いのでは
今テストネットで使われていると思われる(適当な)gas cost table defaultCostTable.json
Greg Colvin氏
https://ethresear.ch/t/evm-performance/2791/10
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
https://arxiv.org/pdf/2012.01032.pdf