1. 暨南大学 信息科学技术学院,广东 广州 510632
2. 江西师范大学 计算机信息工程学院,江西 南昌 330022
3. 广东省网络与信息安全漏洞研究重点实验室,广东 广州 510643
4. 电子科技大学 计算机科学与工程学院,四川 成都 610054
[ "彭泳翔(1998—),男,暨南大学硕士研究生,E-mail:[email protected]" ]
[ "刘志全(1989—),男,教授,E-mail:[email protected]" ]
[ "王立波(1988—),男,讲师,E-mail:[email protected]" ]
[ "吴永东(1970—),男,教授,E-mail:[email protected]" ]
[ "陈 宁(1984—),女,工程师,E-mail:[email protected]" ]
[ "唐 泳(1979—),男,讲师,E-mail:[email protected]" ]
纸质出版日期:2024-06-20,
网络出版日期:2023-11-08,
收稿日期:2023-05-07,
扫 描 看 全 文
彭泳翔, 马勇, 刘志全, 等. 一种支持交易筛选的高性能智能合约测试方案[J]. 西安电子科技大学学报, 2024,51(3):194-202.
Yongxiang PENG, Yong MA, Zhiquan LIU, et al. Efficient smart contract testing scheme supporting transactions filtering[J]. Journal of Xidian University, 2024,51(3):194-202.
彭泳翔, 马勇, 刘志全, 等. 一种支持交易筛选的高性能智能合约测试方案[J]. 西安电子科技大学学报, 2024,51(3):194-202. DOI: 10.19665/j.issn1001-2400.20230803.
Yongxiang PENG, Yong MA, Zhiquan LIU, et al. Efficient smart contract testing scheme supporting transactions filtering[J]. Journal of Xidian University, 2024,51(3):194-202. DOI: 10.19665/j.issn1001-2400.20230803.
近年来
作为以太坊的重要组成部分
智能合约引起了工业界与学术界的广泛兴趣。智能合约是一段部署在区块链上的程序
为分布式交易提供了可能。然而
由于智能合约携带的金融属性
使其成为黑客攻击的目标。因此
为保证合约的安全性
需对漏洞合约进行修复并通过测试保证功能一致性。然而
现有智能合约测试方案缺乏拓展性、重放准确性低以及储存消耗大等问题。为此
提出一种支持交易筛选的高性能智能合约测试方案。该方案首先基于以太坊状态变更建模交易特征
增强扩展性;接着基于二阶树结构储存以太坊历史数据
优化储存空间;最后通过分叉机制进行交易重放
实现在不干扰主链的情况下对修复合约进行测试。基于所提方案实现原型工具SCTester
并与现有合约测试方案EVMPatch、HARTEL和KIM相比较。实验结果表明
所提方案在拓展性与重放准确率有更好的表现
并且在空间消耗方面
所提方案相较于KIM降低了约21.6%的储存空间;在时间消耗方面
所提方案相较于KIM在账户测试场景下的交易重放减少了约70.5%的时间消耗。
In recent years
the smart contract has become a focal point of both the industry and academia as a vital component of the Ethereum blockchain.A smart contract is a program deployed on the blockchain that enables distributed transactions.However
due to the financial attributes of the smart contract
it becomes the target of hacker attacks.To ensure the security of the contract
identifying and repairing vulnerabilities is essential
and functional consistency must be guaranteed through rigorous testing.Regrettably
existing smart contract testing schemes suffer from several shortcomings
including a low replay accuracy and high storage consumption.In response to these challenges
an efficient smart contract testing scheme supporting transactions filtering is proposed which first models transaction features based on Ethereum state changes to enhance scalability;then optimizes storage space by storing Ethereum historical data based on a second-order tree structure;and finally
perform the transaction replay through the forking mechanism to test patched contract without interfering with the main chain.The prototype tool SCTester is implemented based on the proposed solution and conducts comparative assessments against existing contract testing schemes such as EVMPatch
Hartel
and Kim.Experimental results show the superiority of our proposed approach in terms of scalability and replay accuracy.Besides
it reduces storage space by 21.6% compared with Kim in terms of space consumption;and in terms of time consumption
it reduces time consumption by 70.5% compared with Kim in transaction replay under account testing scenario.
区块链智能合约合约测试
blockchainsmart contractcontract testing
周浩, 马建峰, 刘志全, 等. 车联网中区块链辅助的紧急消息信任评估方案[J]. 西安电子科技大学学报, 2023, 50(4):148-156.
ZHOU Hao, MA Jianfeng, LIU Zhiquan, et al. Blockchain-Assisted Solution for Emergency Message Trust Evaluation in VANET[J]. Journal of Xidian University, 2023, 50(4):148-156.
彭泳翔, 刘志全, 王立波, 等. 一种支持内嵌数据处理的智能合约漏洞修复方案[J]. 西安电子科技大学学报, 2024, 51(1):178-186.
PENG Yongxiang, LIU Zhiquan, WANG Libo, et al. A Smart Contract Vulnerability Repair Scheme Supporting Inline Data Processing[J]. Journal of Xidian University, 2024, 51(1):178-186.
ZHANG Y, MA S, LI J, et al. Smartshield:Automatic Smart Contract Protection Made Easy[C]//2020 IEEE 27th International Conference on Software Analysis,Evolution and Reengineering(SANER).Piscataway:IEEE, 2020:23-34.
RODLER M, LI W, KARAME G O, et al. EVMPatch:Timely and Automated Patching of Ethereum Smart Contracts[C]//30th USENIX Security Symposium(USENIX Security 21).Berkeley:USENIX, 2021:1289-1306.
HARTEL P, STAALDUINEN M. Truffle Tests for Free-Replaying Ethereum Smart Contracts for Transparency(2019)[J/OL].[2019-04-13]. http://arxiv.org/abs/1907.09208.http://arxiv.org/abs/1907.09208http://arxiv.org/abs/1907.09208
YUAN Q, HUANG B, ZHANG J, et al. Detecting Phishing Scams on Ethereum Based on Transaction Records[C]//2020 IEEE International Symposium on Circuits and Systems(ISCAS).Piscataway:IEEE, 2020:1-5.
KIM Y, JEONG S, JEZEK K, et al. An Off-the-Chain Execution Environment for Scalable Testing and Profiling of Smart Contracts.[C]//USENIX Annual Technical Conference. Berkeley:USENIX, 2021:565-579.
YUE C, XIE Z, ZHANG M, et al. Analysis of Indexing Structures for Immutable Data[C]//Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. New York: ACM, 2020:925-935.
REED B. The Height of a Random Binary Search Tree[J]. Journal of the ACM(JACM), 2003, 50(3):306-332.
EHMKE C, WESSLING F, FRIEDRICHC M. Proof-of-Property:A Lightweight and Scalable Blockchain Protocol[C]//Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain. New York: ACM, 2018:48-51.
CHEN T, CAO R, LI T, et al. SODA:A Generic Online Detection Framework for Smart Contracts[C]//Proceedings 2020 Network and Distributed System Security Symposium. San Diego: NDSS, 2020:1-17.
HILDENBRANDT E, SAXENA M, RODRIGUES N, et al. Kevm:A Complete Formal Semantics of the Ethereum Virtual Machine[C]//2018 IEEE 31st Computer Security Foundations Symposium(CSF).Piscataway:IEEE, 2018:204-217.
KIM S K, MA Z, MURALI S, et al. Measuring Ethereum Network Peers[C]//Proceedings of the Internet Measurement Conference 2018. New York: ACM, 2018:91-104.
0
浏览量
7
下载量
0
CSCD
关联资源
相关文章
相关作者
相关机构