GASOL:以太坊智能合约的Gas分析和优化
GASOL: Gas Analysis and Optimization for Ethereum Smart Contracts
摘要:
我们介绍了GASOL的主要概念、组件和用法,GASOL是以太坊智能合约的气体分析和优化工具。GASOL提供了各种各样的成本模型,其允许推断与所选类型的EVM指令相关联的气体消耗和/或推断执行此类类型的字节码指令的次数。除此之外,我们有成本模型来测量存储操作码,测量以太坊分类后选定的气体消耗操作码家族,估计选定程序行的成本等。在选择所需的成本模型和感兴趣的函数后,GASOL向用户返回该函数的成本上限。由于气体消耗通常由访问存储的指令控制,GASOL使用气体分析来检测未优化的存储模式,并包括对所选功能的(可选)自动优化。我们的工具可以在用于Solidity的Eclipse插件中使用,该插件显示气体和指令边界,并且在适用时显示气体优化的Solidity函数。
英文摘要:
We present the main concepts, components, and usage of GASOL, a Gas AnalysiS and Optimization tooL for Ethereum smart contracts. GASOL offers a wide variety of cost models that allow inferring the gas consumption associated to selected types of EVM instructions and/or inferring the number of times that such types of bytecode instructions are executed. Among others, we have cost models to measure only storage opcodes, to measure a selected family of gas-consumption opcodes following the Ethereum's classification, to estimate the cost of a selected program line, etc. After choosing the desired cost model and the function of interest, GASOL returns to the user an upper bound of the cost for this function. As the gas consumption is often dominated by the instructions that access the storage, GASOL uses the gas analysis to detect under-optimized storage patterns, and includes an (optional) automatic optimization of the selected function. Our tool can be used within an Eclipse plugin for Solidity which displays the gas and instructions bounds and, when applicable, the gas-optimized Solidity function.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。