OpBench: A CPU Performance Benchmark for Ethereum Smart Contract Operation Code

Ethereum and other blockchains rely on miners contributing computational power to execute tasks such as the proof of work consensus mechanism and the execution and validation of smart contracts. Miners receive a fee, and for the correct operation of the blockchain, rewards should be proportional to the required investment (equipment, energy use, etc.). In Ethereum, the reward obtained for executing smart contracts is set statically, associating a fee with each operation code (opcode) in the smart contract. To determine whether fees are aligned with investments made, we propose OpBench, a platform-independent benchmarking approach. OpBench measures the CPU time required to execute opcodes in the Ethereum Virtual Machine. We implemented OpBench for the PyEthApp and Go-Ethereum clients, and present results for both platforms on three different machines and operating systems. The results show that the static fees set by Ethereum are not always proportional to the invested CPU time, with up to an order of magnitude difference across opcodes. The results also show a markable difference in performance between clients, with the Go client outperforming the Python client across machines.

[1]  Maher Alharby,et al.  Blockchain-based Smart Contracts: A Systematic Mapping Study of Academic Research (2018) , 2018, 2018 International Conference on Cloud Computing, Big Data and Blockchain (ICCBB).

[2]  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).

[3]  Ellis Solaiman,et al.  Performance Benchmarking of Smart Contracts to Assess Miner Incentives in Ethereum , 2018, 2018 14th European Dependable Computing Conference (EDCC).

[4]  W. Bolt Bitcoin and Cryptocurrency Technologies : A Comprehensive Introduction , 2017 .

[5]  Hubert Ritzdorf,et al.  On the Security and Performance of Proof of Work Blockchains , 2016, IACR Cryptol. ePrint Arch..

[6]  Beng Chin Ooi,et al.  BLOCKBENCH: A Framework for Analyzing Private Blockchains , 2017, SIGMOD Conference.

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

[8]  Maher Alharby,et al.  The Impact of Profit Uncertainty on Miner Decisions in Blockchain Systems , 2018, UKPEW.

[9]  Ying Wang,et al.  An Adaptive Gas Cost Mechanism for Ethereum to Defend Against Under-Priced DoS Attacks , 2017, ISPEC.

[10]  Vitalik Buterin A NEXT GENERATION SMART CONTRACT & DECENTRALIZED APPLICATION PLATFORM , 2015 .

[11]  Satoshi Nakamoto Bitcoin : A Peer-to-Peer Electronic Cash System , 2009 .