GethReplayer: a smart contract testing method based on transaction replay

Xiaohong Shi,Ziyan Wang, Runlu Zhong, Liangliang Ma,Xiangping Chen, Peng Yang

INTERNATIONAL JOURNAL OF WEB INFORMATION SYSTEMS(2024)

引用 0|浏览0
暂无评分
摘要
PurposeSmart contracts are written in high-level programming languages, compiled into Ethereum Virtual Machine (EVM) bytecode, deployed onto blockchain systems and called with the corresponding address by transactions. The deployed smart contracts are immutable, even if there are bugs or vulnerabilities. Therefore, it is critical to verify smart contracts before deployment. This paper aims to help developers effectively and efficiently locate potential defects in smart contracts.Design/methodology/approachGethReplayer, a smart contract testing method based on transaction replay, is proposed. It constructs a parallel transaction execution environment with two virtual machines to compare the execution results. It uses the real existing transaction data on Ethereum and the source code of the tested smart contacts as inputs, conditionally substitutes the bytecode of the tested smart contract input into the testing EVM, and then monitors the environmental information to check the correctness of the contract.FindingsExperiments verified that the proposed method is effective in smart contract testing. Virtual environmental information has a significant effect on the success of transaction replay, which is the basis for the performance of the method. The efficiency of error locating was approximately 14 times faster with the proposed method than without. In addition, the proposed method supports gas consumption analysis.Originality/valueThis paper addresses the difficulty that developers encounter in testing smart contracts before deployment and focuses on helping develop smart contracts with as few defects as possible. GethReplayer is expected to be an alternative solution for smart contract testing and provide inspiration for further research.
更多
查看译文
关键词
Smart contract testing,Transaction reply,Gas consumption,Blockchain
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要