skip to main content
10.1145/3611643.3616251acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

EtherDiffer: Differential Testing on RPC Services of Ethereum Nodes

Published: 30 November 2023 Publication History

Abstract

Blockchain is a distributed ledger that records transactions among users on top of a peer-to-peer network. Among all, Ethereum is the most popular general-purpose platform and its support of smart contracts led to a new form of applications called decentralized applications (DApps). A typical DApp has an off-chain frontend and on-chain backend architecture, and the frontend often needs interactions with the backend network, e.g., to acquire chain data or make transactions. Therefore, Ethereum nodes implement the official RPC specification and expose a uniform set of RPC methods to the frontend. However, the specification is not sufficient in two points: (1) lack of clarification for non-deterministic event handling, and (2) lack of specification for invalid arguments. To effectively disclose any deviations caused by the insufficiency, this paper introduces EtherDiffer that automatically performs differential testing on four major node implementations in terms of their RPC services. EtherDiffer first generates a non-deterministic chain by multi-concurrent transactions and propagation delay. Then, it applies our key techniques called property-based generation and type-preserving mutation to generate both semantically-valid and semantically-invalid-yet-executable test cases. EtherDiffer executes the test cases on target nodes and reports any deviations in error handling or return values. The evaluation showed the effectiveness of our test case generation techniques with the success ratios of 98.8% and 95.4%, respectively. Also, EtherDiffer detected 48 different classes of deviations including 11 implementation bugs such as crash and denial-of-service bugs. We reported 44 of the detected classes to the specification and node developers and received acknowledgements as well as bug patches. Lastly, it significantly outperformed the official node testing tool in every technical aspect. We believe that our research findings can contribute to more stable DApp ecosystem by reducing the inconsistencies among nodes.

Supplementary Material

Video (fse23main-p98-p-video.mp4)
"Blockchain is a distributed ledger that records transactions among users on top of a peer-to-peer network. While various blockchain platforms exist, Ethereum is the most popular general-purpose platform and its support of smart contracts led to a new form of applications called decentralized applications (DApps). A typical DApp has an off-chain frontend and on-chain backend architecture, and the frontend often needs interactions with the backend network, e.g., to acquire chain data or make transactions. Therefore, Ethereum nodes implement the official RPC specification and expose a uniform set of RPC methods to the frontend. However, the specification is not sufficient in two points: (1) lack of clarification for non-deterministic event handling, and (2) lack of specification for invalid-as-themselves arguments. To effectively disclose any deviations caused by the insufficiency, this paper introduces EtherDiffer that automatically performs differential testing on four major node implementations in terms of their RPC services. EtherDiffer first generates a non-deterministic chain by multi-concurrent transactions and propagation delay. Then, it applies our key techniques called property-based generation and type-preserving mutation to generate both semantically-valid and semantically-invalid-yet-executable test cases. EtherDiffer executes the test cases on target nodes and reports any deviations in error handling or return values. The evaluation showed the effectiveness of our test case generation techniques with the success ratios of 98.8% and 95.4%, respectively. Also, EtherDiffer detected 48 different classes of deviations including 11 implementation bugs such as crash and denial-of-service bugs. We reported 44 of the detected classes to the specification and node developers and received acknowledgements as well as bug patches. Lastly, it significantly outperformed the official node testing tool in every technical aspect. We believe that our research findings can contribute to more stable DApp ecosystem by reducing the inconsistencies among nodes."

References

[1]
Aashish Kolluri, Ivica Nikolic, Ilya Sergey, Aquinas Hobor and Prateek Saxena. 2019. Exploiting the Laws of Order in Smart Contracts. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA). 363–373. https://doi.org/10.1145/3293882.3330560
[2]
Paul Bouchon. 2022. Remote Procedure Call Specification. https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md#error-codes
[3]
ChainSafe. 2016. Web3.js - Ethereum JavaScript API. https://github.com/ChainSafe/web3.js/tree/v1.7.4
[4]
Chenguang Zhu, Ye Liu, Xiuheng Wu, and Yi Li. 2022. Identifying Solidity Smart Contract API Documentation Errors. In Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering (ASE). 1–13. https://doi.org/doi.org/10.1145/3551349.3556963
[5]
Infura Community. 2019. How Does the Load Balancer Work? https://community.infura.io/t/how-does-the-load-balancer-work/1090
[6]
ConsenSys. 2020. Ethereum by the Numbers - May 2020. https://consensys.net/blog/news/ethereum-by-the-numbers-may-2020/
[7]
Cryptoslate. 2023. Coin Rankings. https://cryptoslate.com/coins/
[8]
DappRadar. 2023. Top Ethereum Dapps. https://dappradar.com/rankings/protocol/ethereum
[9]
Dominik Maier, Fabian Fäß ler and Jean-Pierre Seifert. 2021. Uncovering Smart Contract VM Bugs via Differential Fuzzing. In Proceedings of the 5th Reversing and Offensive-oriented Trends Symposium (ROOT). 11–22. https://doi.org/10.1145/3503921.3503923
[10]
Smart Contract Engineer. 2022. Solidity by Example. https://solidity-by-example.org/
[11]
Ethereum. 2019. EVM Lab Utilities. https://github.com/ethereum/evmlab
[12]
Ethereum. 2022. Ethereum JSON-RPC Specification. https://ethereum.org/en/developers/docs/nodes-and-clients/
[13]
Ethereum. 2023. Hive - Ethereum End-to-End Test Harness. https:// github.com/ethereum/hive
[14]
Ethereum. 2023. Rpc-Compat Simulator. https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
[15]
Ethereum.org. 2022. JSON-RPC API. https://ethereum.org/en/developers/docs/apis/json-rpc/
[16]
Ethereum.org. 2022. Nodes and Clients. https://ethereum.org/en/developers/docs/nodes-and-clients/
[17]
Ethereum.org. 2022. Proof-of-Stake. https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/
[18]
Ethereum.org. 2022. Proof-of-Work. https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/
[19]
Ethernodes. 2023. Ethereum Mainnet Statistics. https://ethernodes.org
[20]
Ethereum Stack Exchange. 2016. What Happens When a Transaction Nonce is Too High? https://ethereum.stackexchange.com/questions/2808/what-happens-when-a-transaction-nonce-is-too-high
[21]
Fuchen Ma, Yuanliang Chen, Meng Ren, Yuanhang Zhou, Yu Jiang, Ting Chen, Huizhong Li and Jiaguang Sun. 2023. LOKI: State-Aware Fuzzing Framework for the Implementation of Blockchain Consensus Protocols. In Proceedings of the 30th Annual Network and Distributed System Security Symposium (NDSS). https://doi.org/10.14722/ndss.2023.24078
[22]
Haijun Wang, Yi Li, Shang-Wei Lin, Lei Ma, and Yang Liu. 2019. VULTRON: Catching Vulnerable Smart Contracts Once and for All. In Proceedings of the 41st International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER). 1–4. https://doi.org/doi.org/10.1109/ICSE-NIER.2019.00009
[23]
Sungjae Hwang and Sukyoung Ryu. 2020. Gap between Theory and Practice: An Empirical Study of Security Patches in Solidity. In Proceedings of the 42nd ACM/IEEE International Conference on Software Engineering (ICSE). 542–553. https://doi.org/10.1145/3377811.3380424
[24]
Jianmin Guo, Yu Jiang, Yue Zhao, Quan Chen, and Jiaguang Sun. 2018. Dlfuzz: Differential Fuzzing Testing of Deep Learning Systems. In Proceedings of the 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 739–743. https://doi.org/10.1145/3236024.3264835
[25]
JosephK95. 2022. Erigon RPC Service Consistency against Other Client Implementations #1. https://github.com/ledgerwatch/erigon/issues/4962
[26]
JosephK95. 2022. Proposal: Error Handling Specification #1. https://github.com/ethereum/execution-apis/issues/286
[27]
Kai Li, Jiaqi Chen, Xianghong Liu, Yuzhe Tang, XiaoFeng Wang, and Xiapu Luo. 2021. As Strong As Its Weakest Link: How to Break Blockchain DApps at RPC Service. In Proceedings of the 28th Annual Network and Distributed System Security Symposium (NDSS). 616–633. https://doi.org/10.14722/ndss.2021.23108
[28]
Shinhae Kim and Sungjae Hwang. 2023. EtherDiffer: Differential Testing on RPC Services of Ethereum Nodes (Code). https://doi.org/10.6084/m9.figshare.23913096.v1
[29]
Shinhae Kim and Sungjae Hwang. 2023. EtherDiffer: Differential Testing on RPC Services of Ethereum Nodes (Data). https://doi.org/10.6084/m9.figshare.21936555.v1
[30]
Shinhae Kim and Sukyoung Ryu. 2020. Analysis of Blockchain Smart Contracts: Techniques and Insights. In Proceedings of the 5th IEEE Secure Development Conference (SecDev). 65–73. https://doi.org/10.1109/SecDev45635.2020.00026
[31]
Liya Su, Xinyue Shen, Xiangyu Du, Xiaojing Liao, XiaoFeng Wang, Luyi Xing and Baoxu Liu. 2021. Evil Under the Sun: Understanding and Discovering Attacks on Ethereum Decentralized Applications. In Proceedings of the 30th USENIX Security Symposium (USENIX Security). 1307–1324.
[32]
Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena and Aquinas Hobor. 2016. Making Smart Contracts Smarter. In Proceedings of the 23rd ACM SIGSAC Conference on Computer and Communications Security (CCS). 254–269. https://doi.org/10.1145/2976749.2978309
[33]
Bernard Marr. 2022. The Top 10 Tech Trends In 2023 Everyone Must Be Ready For. https://www.forbes.com/sites/bernardmarr/2022/11/21/the-top-10-tech-trends-in-2023-everyone-must-be-ready-for
[34]
MiningPoolStats. 2023. Mining Pool Stats. https://miningpoolstats.stream/
[35]
Monika Angelo and Gernot Salzer. 2019. A Survey of Tools for Analyzing Ethereum Smart Contracts. In Proceedings of the 1st IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). 69–78. https://doi.org/10.1109/DAPPCON.2019.00018
[36]
Satoshi Nakamoto. 2008. Bitcoin: A Peer-to-Peer Electronic Cash System. Decentralized Business Review.
[37]
Nicola Atzei, Massimo Bartoletti and Tiziana Cimoli. 2017. A Survey of Attacks on Ethereum Smart Contracts. In Proceedings of the 6th International Conference on Principles of Security and Trust (POST). 164–186. https://doi.org/10.1007/978-3-662-54455-6_8
[38]
Fellowship of Ethereum Magicians. 2018. Remote Procedure Call Specification. https://ethereum-magicians.org/t/remote-procedure-call-specification/1537
[39]
Petar Tsankov, Andrei Dan, Dana Drachsler-Cohen, Arthur Gervais, Florian Buenzli and Martin Vechev. 2018. Securify: Practical Security Analysis of Smart Contracts. In Proceedings of the 25th ACM SIGSAC Conference on Computer and Communications Security (CCS). 67–82. https://doi.org/10.1145/3243734.3243780
[40]
Evgeny Ponomarev. 2019. DApp Survey Results 2019. https://medium.com/ fluence-network/dapp-survey-results-2019-a04373db6452
[41]
Roberto Paleari, Lorenzo Martignoni, Giampaolo Fresi Roglia, and Danilo Bruschi. 2010. N-version Disassembly: Differential Testing of x86 Disassemblers. In Proceedings of the 19th International Symposium on Software Testing and Analysis (ISSTA). 265–274. https://doi.org/10.1145/1831708.1831741
[42]
Shuai Wang, Chengyu Zhang, and Zhendong Su. 2019. Detecting Nondeterministic Payment Bugs in Ethereum Smart Contracts. In Proceedings of the 34th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). 1–29. https://doi.org/10.1145/3360615
[43]
Sungjae Hwang, Sungho Lee, Jihoon Kim and Sukyoung Ryu. 2021. JUSTGen: Effective Test Generation for Unspecified JNI Behaviors on JVMs. In Proceedings of the 43rd IEEE/ACM International Conference on Software Engineering (ICSE). 1708–1718. https://doi.org/10.1109/ICSE-Companion52605.2021.00073
[44]
Solidity Team. 2022. Solidity. https://soliditylang.org/
[45]
Teng Zhou, Kui Liu, Li Li, Zhe Liu, Jacques Klein and Tegawendé F Bissyandé. 2021. SmartGift: Learning to Generate Practical Inputs for Testing Smart Contracts. In Proceedings of the 37th IEEE International Conference on Software Maintenance (ICSM). 23–34. https://doi.org/10.1109/ICSME52107.2021.00009
[46]
Thomas Durieux, João F. Ferreira, Rui Abreu and Pedro Cruz. 2020. Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts. In Proceedings of the 42nd ACM/IEEE International Conference on Software Engineering (ICSE). 530–541. https://doi.org/10.1145/3377811.3380364
[47]
Wuqi Zhang, Lili Wei, Shuqing Li, Yepang Liu, and Shing-Chi Cheung. 2021. Ð Archer: Detecting On-Chain-Off-Chain Synchronization Bugs in Decentralized Applications. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 553–565. https://doi.org/10.1145/3468264.3468546
[48]
Ying Fu, Meng Ren, Fuchen Ma, Heyuan Shi, Xin Yang, Yu Jiang, Huizhong Li, and Xiang Shi. 2019. EVMFuzzer: Detect EVM Vulnerabilities via Fuzz Testing. In Proceedings of the 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 1110–1114. https://doi.org/10.1145/3338906.3341175
[49]
Youngseok Yang, Taesoo Kim and Byung-Gon Chun. 2021. Finding Consensus Bugs in Ethereum via Multi-Transaction Differential Fuzzing. In Proceedings of the 15th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 349–365.
[50]
Yuting Chen, Ting Su, and Zhendong Su. 2019. Deep Differential Testing of JVM Implementations. In Proceedings of the 41st IEEE/ACM International Conference on Software Engineering (ICSE). 1257–1268. https://doi.org/10.1109/ICSE.2019.00127
[51]
Yuting Chen, Ting Su, Chengnian Sun, Zhendong Su, and Jianjun Zhao. 2016. Coverage-directed Differential Testing of JVM Implementations. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 85–99. https://doi.org/10.1145/2908080.2908095

Cited By

View all
  • (2025)A Comprehensive Survey of Smart Contracts Vulnerability Detection Tools: Techniques and MethodologiesJournal of Network and Computer Applications10.1016/j.jnca.2025.104142237(104142)Online publication date: May-2025

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC/FSE 2023: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
November 2023
2215 pages
ISBN:9798400703270
DOI:10.1145/3611643
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 November 2023

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. blockchain
  2. differential testing
  3. ethereum nodes
  4. rpc services

Qualifiers

  • Research-article

Conference

ESEC/FSE '23
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)200
  • Downloads (Last 6 weeks)20
Reflects downloads up to 03 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2025)A Comprehensive Survey of Smart Contracts Vulnerability Detection Tools: Techniques and MethodologiesJournal of Network and Computer Applications10.1016/j.jnca.2025.104142237(104142)Online publication date: May-2025

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media