RAGas:结合持续知识整合的智能合约检索增强型 Gas 优化
RAGas: Retrieval-Augmented Gas Optimization for Smart Contracts with Continuous Knowledge Integration
浏览论文内容
中文总结 AI 辅助
针对智能合约 Gas 优化的需求,研究人员提出 RAGas 三阶段检索增强型生成框架,分析导致 Gas 过度使用的反模式,实验显示其可降低多达 11% 的 Gas 使用量,且检测精度和召回率较高。
中文摘要 AI 辅助
以太坊现已成为金融、医疗保健和供应链管理等关键领域的核心组成部分。执行费用(通常称为 Gas)随函数的计算复杂度而变化,以太坊上的智能合约会产生执行费用,即 Gas,其数值随计算复杂度的增加而升高。因此,在保持功能等效性的同时优化 Gas 密集型代码可显著降低部署成本。目前尚无现有系统能持续挖掘不断演变的 Gas 使用模式。我们系统分析了导致 Gas 过度使用的句法和语义结构,得出六个高级别类别,涵盖构成精选知识库的十二个细粒度反模式。我们将这些见解转化为 RAGas(一个三阶段检索增强型生成框架),利用大语言模型定位并自动修复 Gas 低效问题。对已部署合约的实验表明,RAGas 可将 Gas 使用量降低多达 11%,并在检测存在 Gas 浪费的代码片段时达到较高的精确率和召回率。
英文摘要
Ethereum is now integral to mission-critical sectors, including finance, healthcare, and supply chain management. Execution fees, commonly referred to as Gas, scale with the computational complexity of their functions. Smart contracts on Ethereum incur execution fees, known as Gas, which increase with computational complexity. Thus, optimizing Gas-intensive code while preserving functional equivalence significantly lowers deployment costs. No existing system continuously exploits evolving Gas usage patterns. We systematically analyze syntactic and semantic constructs that drive excessive Gas use. This yields six high-level categories covering twelve fine-grained antipatterns underpinning a curated knowledge base. We operationalize these insights with RAGas, a three-stage retrieval-augmented generation framework that uses a large language model to pinpoint and automatically fix Gas inefficiencies. Experiments on deployed contracts demonstrate that RAGas reduces Gas usage by up to 11% and achieves high precision and recall in detecting code snippets exhibiting Gas wastage.
发表机构
- School of Cyberspace Security, Hainan University(海南大学网络空间安全学院)
机构由 AI 辅助整理,请以论文原文为准。