- OpenEthereum
- Setup OpenEthereum
- Beginner Introduction
- Frequently Asked Questions
- Usage and Config
- Technical Documentation
- Pluggable Consensus
- Aura - Authority Round
- Proof-of-Authority Chains
- Demo PoA-Tutorial
- Private Development Chain
- Transaction Queue
- Warp Sync (par)
- Warp Sync Snapshot Format
- Code flow
- Secret Store
- Permissioning
- WebAssembly (Deprecated)
- JSON RPC API
WebAssembly OpenEthereum VM Design
Choosing which VM to run.
OpenEthereum client currently supports 2 VM types - EVM and WebAssembly, with EVM being default. OpenEthereum can choose to run WebAssembly VM for the specific contract if and only if BOTH are true:
- WebAssembly is activated on the chain (
wasmActivationTransition
is present in json chain specification file). - The contract’s code starts with 4 bytes Wasm magic (
00 61 73 6d
, i.e. same as ‘\0asm’).
Running the code
If OpenEthereum chooses WebAssembly VM to run the contract, it’s bytecode should satisfy the constraints of contract’s ABI. If it doesn’t satisfy all constraints such a contract will be rejected and the error returned.
Before the execution of the Wasm contract it’s code will be instrumented with the following modifications:
Each of the steps above can result in error described in the correspondng links, and OpenEthereum MUST stop execution and return the error in this case.
Then OpenEthereum instantiates the module according to the WebAssembly specification. This instantiation code can also result in a trap, in this case OpenEthereum MUST finish execution of the bytecode with the error.
If the instantiation code produced no trap, OpenEthereum executes exported function with a name call
according to WebAssembly Execution specification.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论