华盛顿举办的#B1June活动宣布了关于EOSIO的一系列计划，其焦点是提高平台的性能和安全性。其中包括和WebAuthehn等Web标准集成、EOS虚拟机（EOS VM）、EOSIO的下一代版本EOSIO 2，它们都能进一步实现大规模使用区块链应用这一目标。EOS VM 开发者预览版还在开发阶段，还不会被用在生产环境中。我们即将发布EOS VM稳定版之际，我们很高兴地发布专为区块链设计的高性能WebAssembly解释器。
EOSIO 1.0最初是在2018年6月利用Binaryen解释器发布的。到了九月我们就发布了支持WABT的EOSIO1.3，这个版本带来了两倍的性能提高。今年晚些时候我会发布EOSIO 2，我们希望EOS VM能够把性能提高到6倍以上，这样就让EOSIO 2中的WebAssembly的执行比一年前EOSIO刚上线时提高了12倍。尽管我们很高兴能看到这样的性能提高，但是因为这是开发者预览版，我们的内部基准还不能完全反映现实场景，我们也还在进行进一步研发。
- C++/ Header Only集成
轻松集成的C++/ Header Only集成
EOS VM可以没有外部或者预编依赖关系存在；它仅需要标头就可以存在。这就意味着构成EOS VM库的所有宏函数和类对头文件中的编译器都是可见的。这就让编译器能够更好地实现在集成代码基础的背景下让EOS VM最优化，因为它能调用所有函数/方法定义。这个设置中，集成到项目就像把EOS VM目录添加到项目的包含路径一样简单。
In Washington, DC at the #B1June event, announcements related to EOSIO™ focused on improved performance and security of the platform. From integration with web standards like WebAuthn, to the announcement of the EOS Virtual Machine (EOS VM), EOSIO 2, the next major version of EOSIO, will further our goal of the mass adoption of blockchain applications. The EOS VM Developer Preview release is still in development and not intended for use in production environments. As we progress toward releasing EOS VM stable, we are excited to be delivering a highly performant WebAssembly interpreter purpose-built for blockchains.
Built By Blockchain Engineers for Blockchain Applications
With the ever growing popularity of EOSIO blockchain technology, the performance needed to support the secure deterministic execution of blockchain applications has surpassed the capacity of conventional WebAssembly engines designed to interface with browsers. Over the past year, we tested the performance of existing interpreters like Binaryen and WABT which are well suited for their purpose, but when applied to blockchains have issues with unbounded memory allocation, extended loading time, and stack overflows which lead to decreased overall performance and reliability. Single threaded performance, shared resource tracking, and low-overhead calls to native code are critical to blockchain performance. With these tenets in mind, EOS VM has been engineered from the ground up to meet the specific demands of blockchain applications.
EOSIO 1.0 was originally released with the Binaryen interpreter in June 2018, by September we released EOSIO 1.3 with support for WABT seeing 2X performance gains. With the release of EOSIO 2 planned for later this year, we expect EOS VM to increase performance up to 6X more making WebAssembly execution in EOSIO 2 up to 12X faster than when EOSIO was released just one year ago. While we are excited for this improvement in performance, as this is a Developer Preview release, our internal benchmarks are not yet indicative of real world scenarios and further development is ongoing.
We built EOS VM to be a high performance interpreter specialized for blockchain applications, but its focus on low latency and other performance efficiencies will make it a competitive alternative for many WebAssembly use cases.
High Performance Attributes of the EOS Virtual Machine
EOS VM is designed with the following attributes in mind:
- Extremely Fast Execution
- Extremely Fast Parsing/Loading
- Efficient Time Bound Execution
- Deterministic Execution
- C++ / Header Only Integration
- Highly Extensible Design
Deterministic Execution to Avoid Consensus Failures
Blockchain applications require deterministic execution to properly run; given inputs must always produce the same outputs. In using traditional WebAssembly interpreters, non-deterministic actions, those whose values change from state to state, run the risk of delaying consensus affecting all users and applications built on it. With EOS VM, we have engineered an environment that allows for both hardware supported floating point operations and software based floating point operations. The use of the software-based floating point (“softfloat”), allows for true deterministic execution of floating point operations. Since these are built into the system, the overhead for the “softfloat” operations is mitigated as much as possible. For use cases where bit level determinism is not needed, then the library can be configured to use the hardware floating point unit of the host processor.
Efficient Time Bounded Execution to Manage Resources
Effective resource management is key to building performant blockchain applications. Parties of a blockchain network have a finite set of resources that are shared among users of the network. This makes it even more important for blockchain applications to run efficiently within their allotted specifications.
EOS VM implements two new tools that allow developers to better manage resource allocation by tracking the WebAssembly runtime execution. The first is a built-in check for the number of WebAssembly instructions that have executed and halt at a preset threshold. This creates a check for processes that start execution but fail to complete gracefully within a set timeframe. The second is an external “watcher” that will halt execution after a preset amount of time, stopping processes that may be hung up and fail to exit gracefully.
Securely Built for Real World Blockchain Development
WebAssembly was designed to run untrusted code in a browser environment where the worst that can happen is a hung browser tab. In the case of blockchain, a hung transaction can bring the chain to a halt so the overall consequences are much more severe.
Development is an error prone, break-fix process that requires debugging and constant thinking around corners. As a result, there are times when programmers may run into issues with checks and validations. EOS VM’s fundamental data types include built-in protections that trigger and automatically kill execution if many of these corner-cases are hit.
To protect memory, we built a guard paging mechanism that utilizes CPU and core OS security to sandbox memory operations. This mechanism allows for more versatile deployment of native code functions without the risk of crashing the machine due to memory overruns related to common programming errors such as unbounded recursion and array access.
Built in allocators in EOS VM are modular enough to serve application specific needs without creating memory intensive structures to support them because the allocators don’t “own” the memory they use. Synchronizing the lifetime of such allocators does away with the need to replicate them, allowing for context-independent integration of the WebAssembly modules as needed without any performance loss.
C++ / Header Only Integration for Effortless Integration
EOS-VM can be used in a way that it has no external or pre-compiled dependencies; it is a header only implementation. This means that all macro functions and classes that make up the EOS VM library are visible to the compiler in header files. This allows the compiler to more aggressively optimize EOS VM within the context of the integrating code base, as it has all of the function/method definitions available to it. In this configuration, integration into a project can be as simple as adding the EOS VM directory to the include path of a project.
Highly Extensible Component Based Design
Compartmentalizing EOS VM and creating self-contained components allows the system to be highly adaptable to custom backend tools that use newly defined logic alongside previously defined components. In addition, new extensions can be constructed with relative ease by following simple coding procedures, allowing for a robust series of tools capable of profiling, debugging, etc. to arise as necessity dictates.
Scaling the Future of Blockchain Technology
Over the past year growing EOSIO, our focus, along with the community, has been to continue creating more robust toolkits and libraries for EOSIO keeping it one of the most performant and utilized blockchain platforms in the world. Ultimately, the adoption of blockchain technology will be driven by applications which expose the benefits of blockchain to end users and businesses. With the performance advancements of EOS VM, as with all releases of EOSIO, we strive to create tools that will aid developers as they build towards that greater goal. We will continue to work with the community to improve and develop EOSIO to support these endeavors.
The EOS VM Developer Preview is not yet released open source. Please refer to the LICENSE for full copyright notice. If interested in contributing to EOS VM please review the Contribution Guide and Code of Conductnoted in the release notes on Github.
If you are interested in providing feedback and working more closely with our team to improve EOSIO for developers, you can send our developer relations team an email at firstname.lastname@example.org.
You can also keep up to date with future announcements by subscribing to our mailing list below. We are excited to be regularly improving the usability of the software for EOSIO developers as we continue to lay a foundation for the mass adoption of blockchain technology.
Important: All material is provided subject to this important notice and you must familiarize yourself with its terms. The notice contains important information, limitations and restrictions relating to our software, publications, trademarks, third-party resources and forward-looking statements. By accessing any of our material, you accept and agree to the terms of the notice.