一句话:提出 FunRedisp,用 TextCNN 预测高频外部函数并将其前移,降低 Solidity 合约调用 Gas。
论文针对 Solidity 智能合约调用 Gas 费用较高的问题,提出函数分派重构工具 FunRedisp。该工具首先在源码层面提取合约的所有外部函数,随后利用预训练的 TextCNN 模型识别这些函数中被调用的概率较高的函数,并在字节码层面将其移动到函数分派逻辑的前部,以降低交易执行时的分派开销。作者从以太坊随机选取 50 个真实智能合约进行评估,结果显示平均每笔合约交易可节省约 125.17 单位 Gas,且每个合约重构的平均时间开销仅为 0.37 秒,表明该工具兼具有效性与效率。
FunRedisp is a function dispatch refactoring tool to reduce the overall invocation gas consumption of Solidity smart contracts. It initially extracts all external functions in a contract at the source code level. After identifying the functions which are highly likely to be invoked among these functions by a pre-trained TextCNN model, FunRedisp moves them to the front of the function dispatch at the bytecode level. FunRedisp saves about 125.17 units of gas per contract transaction on the 50 real-world smart contracts, which are randomly selected from Ethereum. The time overhead for refactoring each contract is only 0.37 seconds on average, demonstrating its effectiveness and efficiency.
DOI 原文 ·
@inproceedings{paperbot8499,
title = {FunRedisp: A Function Redispatch Tool to Reduce Invocation Gas Fees in Solidity Smart Contracts},
author = {Yunqi Liu and Wei Song},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3685312}
}