一种支持交易筛选的高性能智能合约测试方案OA北大核心CSTPCD
Efficient smart contract testing scheme supporting transactions filtering
近年来,作为以太坊的重要组成部分,智能合约引起了工业界与学术界的广泛兴趣.智能合约是一段部署在区块链上的程序,为分布式交易提供了可能.然而,由于智能合约携带的金融属性,使其成为黑客攻击的目标.因此,为保证合约的安全性,需对漏洞合约进行修复并通过测试保证功能一致性.然而,现有智能合约测试方案缺乏拓展性、重放准确性低以及储存消耗大等问题.为此,提出一种支持交易筛选的高性能智能合约测试方案.该方案首先基于以太坊状态变更建模交易特征,增强扩展性;接着基于二阶树结构储存以太坊历史数据,优化储存空间;最后通过分叉机制进行交易重放,实现在不干扰主链的情况下对修复合约进行测试.基于所提方案实现原型工具 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.
彭泳翔;马勇;刘志全;王立波;吴永东;陈宁;唐泳
暨南大学 信息科学技术学院,广东 广州 510632江西师范大学 计算机信息工程学院,江西 南昌 330022暨南大学 信息科学技术学院,广东 广州 510632||广东省网络与信息安全漏洞研究重点实验室,广东 广州 510643广东省网络与信息安全漏洞研究重点实验室,广东 广州 510643电子科技大学 计算机科学与工程学院,四川 成都 610054
计算机与自动化
区块链智能合约合约测试
blockchainsmart contractcontract testing
《西安电子科技大学学报(自然科学版)》 2024 (003)
194-202 / 9
国家自然科学基金(62032025,61932011,62272195);广东省网络与信息安全漏洞研究重点实验室项目(2020B1212060081);广东省重点研发计划(2020B0101090002);广东省基础与应用基础研究基金(2022A1515010299,2020A1515110364);广州市科技计划项目(202201010421);中央高校基本科研业务费专项资金(21622402)
评论