EVMTracer: Dynamic Analysis of the Parallelization and Redundancy Potential in the Ethereum Virtual Machine

Ethereum is one of the first blockchains executing smart contracts, i.e., financial applications directly executed on the ledger using a virtual machine. High transaction volumes caused by financial applications, including decentralized finance and non-fungible tokens, slow down the Ethereum Virtual Machine. Hence, there is a need to detail the execution characteristics of the Ethereum Virtual Machine before its performance can be improved. This work introduces an off-line Ethereum virtual machine tracer called EVMTracer that produces runtime data dependence graphs from executed transactions as an alternative program representation. From the runtime dependence graphs, we can deduce valuable metrics about program execution characteristics, including the degree of parallelization and computational redundancies in smart contracts. Our experiments encompass all blocks up to <inline-formula> <tex-math notation="LaTeX">$\mathrm {12~ \text {M} }$ </tex-math></inline-formula> on the Ethereum mainnet. We found a geometric mean of <inline-formula> <tex-math notation="LaTeX">$1.90\times $ </tex-math></inline-formula> theoretical maximum speedup when executing the smart contracts in parallel and identified <inline-formula> <tex-math notation="LaTeX">$\mathrm {34.97~\%}$ </tex-math></inline-formula> of SLOAD instructions as redundant.

[1]  Mathew E. Colgrove,et al.  SPEChpc 2021 Benchmark Suites for Modern HPC Systems , 2022, ICPE.

[2]  K. Passi,et al.  Characterizing the OpenSea NFT Marketplace , 2022, WWW.

[3]  Pasika Sashmal Ranaweera,et al.  Blockchain for the Metaverse: A Review , 2022, Future Gener. Comput. Syst..

[4]  T. Luan,et al.  A Survey on Metaverse: Fundamentals, Security, and Privacy , 2022, IEEE Communications Surveys & Tutorials.

[5]  Dong Zhou,et al.  Utilizing Parallelism in Smart Contracts on Decentralized Blockchains by Taming Application-Inherent Conflicts , 2022, 2022 IEEE/ACM 44th International Conference on Software Engineering (ICSE).

[6]  Q. Lu,et al.  Defining Blockchain Governance Principles: A Comprehensive Framework , 2021, Inf. Syst..

[7]  Lidong Zhou,et al.  Forerunner: Constraint-based Speculative Transaction Execution for Ethereum , 2021, SOSP.

[8]  Lennart Ante The non-fungible token (NFT) market and its relationship with Bitcoin and Ethereum , 2021, SSRN Electronic Journal.

[9]  Shiping Chen,et al.  Non-Fungible Token (NFT): Overview, Evaluation, Opportunities and Challenges , 2021, ArXiv.

[10]  Chengnian Long,et al.  Blockchain-Enabled Trust Management in Service-Oriented Internet of Things: Opportunities and Challenges , 2021, ICBCT.

[11]  K. Devadkar,et al.  Enabling MapReduce based Parallel Computation in Smart Contracts , 2021, 2021 6th International Conference on Inventive Computation Technologies (ICICT).

[12]  Blesson Varghese,et al.  A Survey on Edge Performance Benchmarking , 2020, ACM Comput. Surv..

[13]  Jürgen Cito,et al.  Characterizing Efficiency Optimizations in Solidity Smart Contracts , 2020, 2020 IEEE International Conference on Blockchain (Blockchain).

[14]  Isil Dillig,et al.  Demystifying Loops in Smart Contracts , 2020, 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[15]  M. Shamim Kaiser,et al.  Secure and Transparent KYC for Banking System Using IPFS and Blockchain Technology , 2020, 2020 IEEE Region 10 Symposium (TENSYMP).

[16]  Peter Vangorp,et al.  An empirical analysis of source code metrics and smart contract resource consumption , 2020, J. Softw. Evol. Process..

[17]  Oliver Schilke,et al.  Blockchain Governance — A New Way of Organizing Collaborations? , 2020, Organization Science.

[18]  Athanasios Stratikopoulos,et al.  Running parallel bytecode interpreters on heterogeneous hardware , 2020, Programming.

[19]  Ahmed E. Hassan,et al.  An exploratory study of smart contracts in the Ethereum blockchain platform , 2020, Empirical Software Engineering.

[20]  Fabian Schär Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets , 2020, Review.

[21]  C. Bellavitis,et al.  Blockchain Disruption and Decentralized Finance: The Rise of Decentralized Business Models , 2019, Journal of Business Venturing Insights.

[22]  Bernd Burgstaller,et al.  The Economics of Smart Contracts , 2019, ArXiv.

[23]  T. Gross,et al.  Reflections on the compatibility, performance, and scalability of parallel Python , 2019, DLS.

[24]  Andrea Pinna,et al.  A Massive Analysis of Ethereum Smart Contracts Empirical Study and Code Metrics , 2019, IEEE Access.

[25]  Parwat Singh Anjana,et al.  Efficient Concurrent Execution of Smart Contracts in Blockchains Using Object-Based Transactional Memory , 2019, NETYS.

[26]  Divyakant Agrawal,et al.  ParBlockchain: Leveraging Transaction Parallelism in Permissioned Blockchain Systems , 2019, 2019 IEEE 39th International Conference on Distributed Computing Systems (ICDCS).

[27]  Weidong Shi,et al.  Blockchain in global supply chains and cross border trade: a critical synthesis of the state-of-the-art, challenges and opportunities , 2019, Int. J. Prod. Res..

[28]  Maurice Herlihy,et al.  An Empirical Study of Speculative Concurrency in Ethereum Smart Contracts , 2019, Tokenomics.

[29]  Stacy Patterson,et al.  EdgeBench: Benchmarking Edge Computing Platforms , 2018, 2018 IEEE/ACM International Conference on Utility and Cloud Computing Companion (UCC Companion).

[30]  Hanspeter Mössenböck,et al.  Parallelization of dynamic languages: synchronizing built-in collections , 2018, Proc. ACM Program. Lang..

[31]  Thomas R. Gross,et al.  Virtual machine design for parallel dynamic programming languages , 2018, Proc. ACM Program. Lang..

[32]  Wei Yu,et al.  A Parallel Smart Contract Model , 2018, ICML 2018.

[33]  John Kubiatowicz,et al.  A Hardware Accelerator for Tracing Garbage Collection , 2018, 2018 ACM/IEEE 45th Annual International Symposium on Computer Architecture (ISCA).

[34]  Tiago M. Fernández-Caramés,et al.  A Review on the Use of Blockchain for the Internet of Things , 2018, IEEE Access.

[35]  Péter Hegedűs,et al.  Towards Analyzing the Complexity Landscape of Solidity Based Ethereum Smart Contracts , 2018, 2018 IEEE/ACM 1st International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB).

[36]  Jóakim von Kistowski,et al.  SPEC CPU2017: Next-Generation Compute Benchmark , 2018, ICPE Companion.

[37]  Anders Møller,et al.  Systematic approaches for increasing soundness and precision of static analyzers , 2017, SOAP@PLDI.

[38]  Zibin Zheng,et al.  A Detailed and Real-Time Performance Monitoring Framework for Blockchain Systems , 2017, 2018 IEEE/ACM 40th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP).

[39]  Massimo Bartoletti,et al.  A Survey of Attacks on Ethereum Smart Contracts (SoK) , 2017, POST.

[40]  Nicholas Wakou,et al.  SPEC Cloud™ IaaS 2016 Benchmark , 2017, ICPE.

[41]  Chris Dannen,et al.  Introducing Ethereum and Solidity: Foundations of Cryptocurrency and Blockchain Programming for Beginners , 2017 .

[42]  Maurice Herlihy,et al.  Adding concurrency to smart contracts , 2017, Distributed Computing.

[43]  Xiapu Luo,et al.  Under-optimized smart contracts devour your money , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[44]  Alex Norta,et al.  Designing a Smart-Contract Application Layer for Transacting Decentralized Autonomous Organizations , 2016, ICACDS.

[45]  D. Giusti,et al.  Structured Parallel Programming: patterns for efficient computation , 2015 .

[46]  Gilad Bracha,et al.  The Java Virtual Machine Specification, Java SE 8 Edition , 2013 .

[47]  Sungho Kim,et al.  TinyVM: an energy‐efficient execution infrastructure for sensor networks , 2012, Softw. Pract. Exp..

[48]  John Kubiatowicz,et al.  GPUs as an opportunity for offloading garbage collection , 2012, ISMM '12.

[49]  Bernd Burgstaller,et al.  Treegraph-based Instruction Scheduling for Stack-based Virtual Machines , 2011, Bytecode@ETAPS.

[50]  Nikolai Tillmann,et al.  DyGen: Automatic Generation of High-Coverage Tests via Mining Gigabytes of Dynamic Traces , 2010, TAP@TOOLS.

[51]  Sungho Kim,et al.  TinyVM, an efficient virtual machine infrastructure for sensor networks , 2009, SenSys '09.

[52]  Carl Friedrich Bolz,et al.  Tracing the meta-level: PyPy's tracing JIT compiler , 2009, ICOOOLPS@ECOOP.

[53]  Gustavo Alonso,et al.  A virtual machine for sensor networks , 2007, EuroSys '07.

[54]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[55]  John L. Henning SPEC CPU2006 benchmark descriptions , 2006, CARN.

[56]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .

[57]  Joel Koshy,et al.  VMSTAR: synthesizing scalable runtime environments for sensor networks , 2005, SenSys '05.

[58]  M. Ertl,et al.  Virtual machine showdown: stack versus registers , 2005, VEE '05.

[59]  Keith D. Cooper,et al.  Engineering a Compiler , 2003 .

[60]  Guy E. Blelloch,et al.  Selective memoization , 2003, POPL '03.

[61]  Matthew R. Guthaus,et al.  MiBench: A free, commercially representative embedded benchmark suite , 2001, Proceedings of the Fourth Annual IEEE International Workshop on Workload Characterization. WWC-4 (Cat. No.01EX538).

[62]  Jeffrey S. Vetter,et al.  A Dynamic Tracing Mechanism for Performance Analysis of OpenMP Applications , 2001, WOMPAT.

[63]  Alan Wood,et al.  Structure and Interpretation of Computer Programs, 2nd Ed by Abelson and Sussman, with Sussman, MIT Press, 1996, ISBN 0-262-51087-1, 657pp. , 2001, Journal of Functional Programming.

[64]  Dezsö Sima,et al.  The Design Space of Register Renaming Techniques , 2000, IEEE Micro.

[65]  Laurie J. Hendren,et al.  Optimizing Java Bytecode Using the Soot Framework: Is It Feasible? , 2000, CC.

[66]  Martin Maierhofer,et al.  Local Stack Allocation , 1998, CC.

[67]  Chia-Jiu Wang,et al.  Reducing stack usage in Java bytecode execution , 1998, CARN.

[68]  Saumya K. Debray,et al.  Alias analysis of executable code , 1998, POPL '98.

[69]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[70]  Scott A. Mahlke,et al.  A comparison of full and partial predicated execution support for ILP processors , 1995, Proceedings 22nd Annual International Symposium on Computer Architecture.

[71]  Barton P. Miller,et al.  Dynamic program instrumentation for scalable performance tools , 1994, Proceedings of IEEE Scalable High Performance Computing Conference.

[72]  V. Sarkar,et al.  Automatic partitioning of a program dependence graph into parallel tasks , 1991, IBM J. Res. Dev..

[73]  Y. Patt,et al.  Single instruction stream parallelism is greater than two , 1991, [1991] Proceedings. The 18th Annual International Symposium on Computer Architecture.

[74]  David W. Wall,et al.  Limits of instruction-level parallelism , 1991, ASPLOS IV.

[75]  Joseph Robert Horgan,et al.  Dynamic program slicing , 1990, PLDI '90.

[76]  Michael D. Smith,et al.  Limits on multiple instruction issue , 1989, ASPLOS III.

[77]  Jong-Deok Choi,et al.  A mechanism for efficient debugging of parallel programs , 1988, PADD '88.

[78]  Karl J. Ottenstein,et al.  The program dependence graph in a software development environment , 1984, SDE 1.

[79]  K. J. Ottenstein,et al.  The program dependence graph and its use in optimization , 1984, TOPL.

[80]  David A. Padua,et al.  Dependence graphs and compiler optimizations , 1981, POPL '81.

[81]  K. Mani Chandy,et al.  A comparison of list schedules for parallel processing systems , 1974, Commun. ACM.

[82]  DONALD MICHIE,et al.  “Memo” Functions and Machine Learning , 1968, Nature.

[83]  X. Shen,et al.  Blockchain-Empowered Space-Air-Ground Integrated Networks: Opportunities, Challenges, and Solutions , 2022, IEEE Communications Surveys & Tutorials.

[84]  M. Marchesi,et al.  Automatic generation of Ethereum-based Smart Contracts for Agri-Food Traceability System , 2022, IEEE Access.

[85]  Bernd Burgstaller,et al.  An Off-The-Chain Execution Environment for Scalable Testing and Profiling of Smart Contracts , 2021, USENIX Annual Technical Conference.

[86]  Hemalatha Eedi,et al.  Execution of Smart Contacts Concurrently Using Fine-Grain Locking and Asynchronous Functions , 2021, Smart Computing Techniques and Applications.

[87]  Jie Li,et al.  Function-Level Dynamic Monitoring and Analysis System for Smart Contract , 2020, IEEE Access.

[88]  Mingdong Tang,et al.  Secure Digital Certificate-Based Data Access Control Scheme in Blockchain , 2020, IEEE Access.

[89]  Işıl Dillig,et al.  Interpretation , 1994, A Bibliography of Islamic Law, 1980-1993.

[90]  Daniel Davis Wood,et al.  ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER , 2014 .

[91]  Jens Palsberg,et al.  Reducing loads and stores in stack architectures , 2000 .

[92]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[93]  Philip Koopman,et al.  A Preliminary Exploration of Optimized Stack Code Generation , 1995 .

[94]  Raj Jain,et al.  The art of computer systems performance analysis - techniques for experimental design, measurement, simulation, and modeling , 1991, Wiley professional computing.

[95]  Ray Jain,et al.  The art of computer systems performance analysis - techniques for experimental design, measurement, simulation, and modeling , 1991, Wiley professional computing.

[96]  Ronald H. Perrott,et al.  Parallel programming , 1988, International computer science series.

[97]  E.L. Lawler,et al.  Optimization and Approximation in Deterministic Sequencing and Scheduling: a Survey , 1977 .