Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

VM Matters: A Comparison of WASM VMs and EVMs in the Performance of Blockchain Smart Contracts

Published: 18 March 2024 Publication History
  • Get Citation Alerts
  • Abstract

    Beyond an emerging popular web applications runtime supported in almost all commodity browsers, WebAssembly (WASM) is further regarded to be the next-generation execution environment for blockchain-based applications. Indeed, many popular blockchain platforms such as EOSIO and NEAR have adopted WASM-based execution engines. Most recently, WASM has been favored by Ethereum, the largest smart contract platform, to replace the state-of-the-art EVM. However, whether and how well current WASM outperforms EVM on blockchain clients is still unknown. This article conducts the first measurement study to understand the performance on WASM VMs and EVM for executing smart contracts for blockchain-based applications. To our surprise, the current WASM VM does not provide expected satisfactory performance. The overhead introduced by WASM is really non-trivial. Our results shed the light on challenges when deploying WASM in practice, and provide insightful implications for improvement space.

    References

    [1]
    2016. EVM Yellow Paper. Retrieved from http://gavwood.com/Paper.pdf
    [3]
    2021. Binaryen: Compiler Infrastructure and Toolchain Library for WebAssembly. Retrieved from https://github.com/webassembly/binaryen
    [4]
    2021. A Curated List of Languages that Compile Directly to or have their VMs in WebAssembly. Retrieved from https://github.com/appcypher/awesome-wasm-langs
    [5]
    2021. EOS VM - A Low-Latency, High Performance and Extensible WebAssembly Engine. Retrieved from https://github.com/EOSIO/eos-vm
    [6]
    2021. EOSIO. Retrieved from https://eos.io
    [7]
    2021. Ethereum Consensus Tests. Retrieved from https://github.com/ethereum/tests
    [8]
    2021. Ethereum Whitepaper. Retrieved from https://ethereum.org/en/whitepaper/
    [9]
    2021. Etherscan: The Ethereum Blockchain Explorer. Retrieved from https://etherscan.io/
    [10]
    2021. eWASM Design Overview and Specification. Retrieved from https://github.com/ewasm/design
    [11]
    2021. Go Ethereum: Official Golang Implementation of the Ethereum Protocol. Retrieved from https://github.com/ethereum/go-ethereum
    [12]
    2021. Hera: eWASM Virtual Machine Conforming to the EVMC API. Retrieved from https://github.com/ewasm/hera
    [13]
    2021. Life - A Secure WebAssembly VM Catered for Decentralized Applications. Retrieved from https://github.com/perlin-network/life
    [14]
    2021. NEAR. Retrieved from https://near.org
    [15]
    2021. OpenEthereum: The Fast, Light, and Robust Client for Ethereum-Like Networks. Retrieved from https://github.com/openethereum/openethereum
    [16]
    2021. Project Alchemy: Solidity Implementation of BLAKE2b. Retrieved from https://github.com/ConsenSys/Project-Alchemy
    [17]
    2021. Proof-of-Stake (PoS) of Ethereum. Retrieved from https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
    [18]
    2021. Proof-of-Work (PoW) of Ethereum. Retrieved from https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/
    [19]
    2021. SOLL, A New Compiler for Generate eWASM from Solidity and Yul. Retrieved from https://github.com/second-state/SOLL
    [20]
    2021. Solsha1: Pure-Solidity Implementation of the SHA1 Hash Function. Retrieved from https://github.com/ensdomains/solsha1
    [21]
    2021. SSVM - A High Performance, Extensible, and Hardware Optimized WebAssembly Virtual Machine for Cloud, AI, and Blockchain Applications. Retrieved from https://github.com/second-state/SSVM
    [23]
    2021. WABT: The WebAssembly Binary Toolkit. Retrieved from https://github.com/WebAssembly/wabt
    [24]
    2021. Wagon, A WebAssembly-Based Go Interpreter, for Go. Retrieved from https://github.com/go-interpreter/wagon
    [25]
    2021. Wasm3 - A High Performance WebAssembly Interpreter Written in C. Retrieved from https://github.com/wasm3/wasm3
    [26]
    2021. Wasmi: WASM Interpreter in Rust. Retrieved from https://github.com/paritytech/wasmi
    [27]
    2021. Wasmtime: Standalone JIT-Style Runtime for WebAssembly, using Cranelift. Retrieved from https://github.com/bytecodealliance/wasmtime
    [28]
    2021. WebAssembly. Retrieved from https://webassembly.org/
    [29]
    2021. WebAssembly Micro Runtime. Retrieved from https://github.com/bytecodealliance/wasm-micro-runtime
    [30]
    2021. WebAssembly Virtual Machine. Retrieved from https://github.com/WAVM/WAVM
    [32]
    2023. AVALANCHE. Retrieved from https://www.avax.network/
    [33]
    2023. BNB Chain. Retrieved from https://www.bnbchain.org/en
    [34]
    2023. Fantom. Retrieved from https://fantom.foundation/
    [35]
    2023. polygon. Retrieved from https://polygon.technology/
    [36]
    Salem Alqahtani and Murat Demirbas. 2021. Bottlenecks in blockchain consensus protocols. In Proceedings of the 2021 IEEE International Conference on Omni-Layer Intelligent Systems (COINS). IEEE, 1–8.
    [37]
    Weikang Bian, Wei Meng, and Mingxue Zhang. 2020. MineThrottle: Defending against WASM in-browser cryptojacking. In Proceedings of the Web Conference 2020. 3112–3118.
    [38]
    Weimin Chen, Zihan Sun, Haoyu Wang, Xiapu Luo, Haipeng Cai, and Lei Wu. 2022. WASAI: Uncovering vulnerabilities in wasm smart contracts. In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis. 703–715.
    [39]
    Tien Tuan Anh Dinh, Ji Wang, Gang Chen, Rui Liu, Beng Chin Ooi, and Kian-Lee Tan. 2017. Blockbench: A framework for analyzing private blockchains. In Proceedings of the 2017 ACM International Conference on Management of Data. 1085–1100.
    [40]
    Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. 2017. Bringing the web up to speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation. 185–200.
    [41]
    David Herrera, Hangfen Chen, Erick Lavoie, and Laurie Hendren. 2018. WebAssembly and Javascript Challenge: Numerical Program Performance Using Modern Browser Technologies and Devices. University of McGill, Montreal: QC, Technical Report SABLE-TR-2018-2.
    [42]
    Abhinav Jangda, Bobby Powers, Emery D. Berger, and Arjun Guha. 2019. Not so fast: Analyzing the performance of WebAssembly vs. native code. In Proceedings of the 2019 \(\lbrace\) USENIX \(\rbrace\) Annual Technical Conference ( \(\lbrace\) USENIX \(\rbrace\) \(\lbrace\) ATC \(\rbrace\) 19). 107–120.
    [43]
    Pascal Felber Valerio Schiavoni Jämes Ménétrey, Marcelo Pasin. 2021. TWINE: An embedded trusted runtime for webassembly. In Proceedings of the 37th IEEE International Conference on Data Engineering. 205–216.
    [44]
    Manpreet Kaur, Mohammad Zubair Khan, Shikha Gupta, Abdulfattah Noorwali, Chinmay Chakraborty, and Subhendu Kumar Pani. 2021. MBCP: Performance analysis of large scale mainstream blockchain consensus protocols. IEEE Access 9 (2021), 80931–80944.
    [45]
    Murat Kuzlu, Manisa Pipattanasomporn, Levent Gurses, and Saifur Rahman. 2019. Performance analysis of a hyperledger fabric blockchain framework: Throughput, latency and scalability. In Proceedings of the 2019 IEEE International Conference on Blockchain (Blockchain). IEEE, 536–540.
    [46]
    Xi Tong Lee, Arijit Khan, Sourav Sen Gupta, Yu Hann Ong, and Xuan Liu. 2020. Measurements, analyses, and insights on the entire ethereum blockchain network. In Proceedings of the Web Conference 2020. 155–166.
    [47]
    Daniel Lehmann and Michael Pradel. 2019. Wasabi: A framework for dynamically analyzing WebAssembly. In Proceedings of the 24th International Conference on Architectural Support for Programming Languages and Operating Systems. 1045–1058.
    [48]
    Marius Musch, Christian Wressnegger, Martin Johns, and Konrad Rieck. 2019. New Kid on the Web: A study on the prevalence of WebAssembly in the wild. In Proceedings of the International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment. Springer, 23–42.
    [49]
    Satoshi Nakamoto. 2019. Bitcoin: A Peer-to-peer Electronic Cash System. Technical Report. Manubot.
    [50]
    Gabriel Antonio F. Rebello, Gustavo F. Camilo, Lucas C. B. Guimarães, Lucas Airam C. de Souza, and Otto Carlos M. B. Duarte. 2022. Security and performance analysis of quorum-based blockchain consensus protocols. In Proceedings of the 2022 6th Cyber Security in Networking Conference (CSNet). IEEE, 1–7.
    [51]
    Micha Reiser and Luc Bläser. 2017. Accelerate javascript applications by cross-compiling to WebAssembly. In Proceedings of the 9th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages. 10–17.
    [52]
    Alan Romano, Xinyue Liu, Yonghwi Kwon, and Weihang Wang. 2021. An empirical study of bugs in webassembly compilers. In Proceedings of the 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 42–54.
    [53]
    Sara Rouhani and Ralph Deters. 2017. Performance analysis of ethereum transactions in private blockchain. In Proceedings of the 2017 8th IEEE International Conference on Software Engineering and Service Science (ICSESS). IEEE, 70–74.
    [54]
    Jan Rüth, Torsten Zimmermann, Konrad Wolsing, and Oliver Hohlfeld. 2018. Digging into browser-based crypto mining. In Proceedings of the Internet Measurement Conference 2018. 70–76.
    [55]
    Abdurrashid Ibrahim Sanka and Ray C. C. Cheung. 2021. A systematic review of blockchain scalability: Issues, solutions, analysis and future research. Journal of Network and Computer Applications 195 (2021), 103232.
    [56]
    Mattias Scherer. 2017. Performance and Scalability of Blockchain Networks and Smart Contracts.
    [57]
    Luming Wan, David Eyers, and Haibo Zhang. 2019. Evaluating the impact of network latency on the safety of blockchain transactions. In Proceedings of the 2019 IEEE International Conference on Blockchain (Blockchain). IEEE, 194–201.
    [58]
    Weihang Wang. 2021. Empowering web applications with WebAssembly: Are we there yet?. In Proceedings of the 2021 36th IEEE/ACM International Conference on Automated Software Engineering. 1301–1305.
    [59]
    Yang Xiao, Ning Zhang, Wenjing Lou, and Y. Thomas Hou. 2020. A survey of distributed consensus protocols for blockchain networks. IEEE Communications Surveys and Tutorials 22, 2 (2020), 1432–1465.
    [60]
    Xiaoqiong Xu, Gang Sun, Long Luo, Huilong Cao, Hongfang Yu, and Athanasios V. Vasilakos. 2021. Latency performance modeling and analysis for hyperledger fabric blockchain network. Information Processing and Management 58, 1 (2021), 102436.
    [61]
    Di Yang, Chengnian Long, Han Xu, and Shaoliang Peng. 2020. A review on scalability of blockchain. In Proceedings of the 2020 the 2nd International Conference on Blockchain Technology. 1–6.
    [62]
    Yixuan Zhang, Shangtong Cao, Haoyu Wang, Zhenpeng Chen, Xiapu Luo, Dongliang Mu, Yun Ma, Gang Huang, and Xuanzhe Liu. 2023. Characterizing and detecting webassembly runtime bugs. ACM Transactions on Software Engineering and Methodology (2023).
    [63]
    Peilin Zheng, Zibin Zheng, Xiapu Luo, Xiangping Chen, and Xuanzhe Liu. 2018. A detailed and real-time performance monitoring framework for blockchain systems. In Proceedings of the 2018 IEEE/ACM 40th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP). IEEE, 134–143.

    Cited By

    View all

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Modeling and Performance Evaluation of Computing Systems
    ACM Transactions on Modeling and Performance Evaluation of Computing Systems  Volume 9, Issue 2
    June 2024
    103 pages
    ISSN:2376-3639
    EISSN:2376-3647
    DOI:10.1145/3613566
    • Editor:
    • Leana Golubchik
    Issue’s Table of Contents

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 18 March 2024
    Online AM: 27 January 2024
    Accepted: 03 January 2024
    Revised: 07 August 2023
    Received: 28 January 2023
    Published in TOMPECS Volume 9, Issue 2

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. WebAssembly
    2. blockchain
    3. and smart contract

    Qualifiers

    • Research-article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 267
      Total Downloads
    • Downloads (Last 12 months)267
    • Downloads (Last 6 weeks)37
    Reflects downloads up to

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Get Access

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Full Text

    View this article in Full Text.

    Full Text

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media