如何节省我的燃气费用:了解和检测固体程序中的实际气体问题

IF 5.6 1区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Mengting He;Shihao Xia;Boqin Qin;Nobuko Yoshida;Tingting Yu;Yiying Zhang;Linhai Song
{"title":"如何节省我的燃气费用:了解和检测固体程序中的实际气体问题","authors":"Mengting He;Shihao Xia;Boqin Qin;Nobuko Yoshida;Tingting Yu;Yiying Zhang;Linhai Song","doi":"10.1109/TSE.2025.3593930","DOIUrl":null,"url":null,"abstract":"The execution of smart contracts on Ethereum, a public blockchain system, incurs a fee called <i>gas fee</i> for its computation and data storage. When programmers develop smart contracts (<i>e.g.</i>, in the Solidity programming language), they could unknowingly write code snippets that unnecessarily cause more gas fees. These issues, or what we call <i>gas wastes</i>, can lead to significant monetary losses for users. This paper takes the initiative in helping Ethereum users reduce their gas fees in two key steps. First, we conduct an empirical study on gas wastes in open-source Solidity programs and Ethereum transaction traces. Second, to validate our study findings, we develop a static tool called <i>PeCatch</i> to effectively detect gas wastes in Solidity programs, and manually examine the Solidity compiler’s code to pinpoint implementation errors causing gas wastes. Overall, we make 11 insights and four suggestions, which can foster future tool development and programmer awareness, and fixing our detected bugs can save <inline-formula><tex-math>${\\$}$</tex-math></inline-formula>0.76 million in gas fees daily.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"51 9","pages":"2617-2633"},"PeriodicalIF":5.6000,"publicationDate":"2025-07-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"How to Save My Gas Fees: Understanding and Detecting Real-World Gas Issues in Solidity Programs\",\"authors\":\"Mengting He;Shihao Xia;Boqin Qin;Nobuko Yoshida;Tingting Yu;Yiying Zhang;Linhai Song\",\"doi\":\"10.1109/TSE.2025.3593930\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The execution of smart contracts on Ethereum, a public blockchain system, incurs a fee called <i>gas fee</i> for its computation and data storage. When programmers develop smart contracts (<i>e.g.</i>, in the Solidity programming language), they could unknowingly write code snippets that unnecessarily cause more gas fees. These issues, or what we call <i>gas wastes</i>, can lead to significant monetary losses for users. This paper takes the initiative in helping Ethereum users reduce their gas fees in two key steps. First, we conduct an empirical study on gas wastes in open-source Solidity programs and Ethereum transaction traces. Second, to validate our study findings, we develop a static tool called <i>PeCatch</i> to effectively detect gas wastes in Solidity programs, and manually examine the Solidity compiler’s code to pinpoint implementation errors causing gas wastes. Overall, we make 11 insights and four suggestions, which can foster future tool development and programmer awareness, and fixing our detected bugs can save <inline-formula><tex-math>${\\\\$}$</tex-math></inline-formula>0.76 million in gas fees daily.\",\"PeriodicalId\":13324,\"journal\":{\"name\":\"IEEE Transactions on Software Engineering\",\"volume\":\"51 9\",\"pages\":\"2617-2633\"},\"PeriodicalIF\":5.6000,\"publicationDate\":\"2025-07-31\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"IEEE Transactions on Software Engineering\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://ieeexplore.ieee.org/document/11105518/\",\"RegionNum\":1,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/11105518/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

摘要

在以太坊(一个公共区块链系统)上执行智能合约会产生一种称为gas费的费用,用于其计算和数据存储。当程序员开发智能合约(例如,在Solidity编程语言中)时,他们可能会在不知不觉中编写不必要地导致更多gas费用的代码片段。这些问题,或者我们所说的气体浪费,会给用户带来巨大的经济损失。本文通过两个关键步骤主动帮助以太坊用户降低gas费用。首先,我们对开源Solidity程序和以太坊交易痕迹中的气体浪费进行了实证研究。其次,为了验证我们的研究结果,我们开发了一个名为PeCatch的静态工具,以有效地检测Solidity程序中的气体浪费,并手动检查Solidity编译器的代码,以查明导致气体浪费的实现错误。总的来说,我们提出了11个见解和4个建议,可以培养未来的工具开发和程序员意识,修复我们检测到的bug可以每天节省${\$}76万美元的gas费。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
How to Save My Gas Fees: Understanding and Detecting Real-World Gas Issues in Solidity Programs
The execution of smart contracts on Ethereum, a public blockchain system, incurs a fee called gas fee for its computation and data storage. When programmers develop smart contracts (e.g., in the Solidity programming language), they could unknowingly write code snippets that unnecessarily cause more gas fees. These issues, or what we call gas wastes, can lead to significant monetary losses for users. This paper takes the initiative in helping Ethereum users reduce their gas fees in two key steps. First, we conduct an empirical study on gas wastes in open-source Solidity programs and Ethereum transaction traces. Second, to validate our study findings, we develop a static tool called PeCatch to effectively detect gas wastes in Solidity programs, and manually examine the Solidity compiler’s code to pinpoint implementation errors causing gas wastes. Overall, we make 11 insights and four suggestions, which can foster future tool development and programmer awareness, and fixing our detected bugs can save ${\$}$0.76 million in gas fees daily.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering 工程技术-工程:电子与电气
CiteScore
9.70
自引率
10.80%
发文量
724
审稿时长
6 months
期刊介绍: IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include: a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models. b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects. c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards. d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues. e) System issues: Hardware-software trade-offs. f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信