Super-optimization of Smart Contracts

Author:

Albert Elvira1,Gordillo Pablo1ORCID,Hernández-Cerezo Alejandro1ORCID,Rubio Albert1,Schett Maria A.2

Affiliation:

1. Complutense University of Madrid, Spain

2. University College London, UK

Abstract

Smart contracts are programs deployed on a blockchain. They are executed for a monetary fee paid in gas —a clear optimization target for smart contract compilers. Because smart contracts are a young, fast-moving field without (manually) fine-tuned compilers, they highly benefit from automated and adaptable approaches, especially as smart contracts are effectively immutable, and as such need a high level of assurance. This makes them an ideal domain for applying formal methods. Super-optimization is a technique to find the best translation of a block of instructions by trying all possible sequences of instructions that produce the same result. We present a framework for super-optimizing smart contracts based on Max-SMT with two main ingredients: (1) a stack functional specification extracted from the basic blocks of a smart contract, which is simplified using rules capturing the semantics of arithmetic, bit-wise, and relational operations, and (2) the synthesis of optimized blocks , which finds—by means of an efficient SMT encoding—basic blocks with minimal gas cost whose stack functional specification is equal (modulo commutativity) to the extracted one. We implemented our framework in the tool syrup 2.0 . Through large-scale experiments on real-world smart contracts, we analyze performance improvements for different SMT encodings, as well as tradeoffs between quality of optimizations and required optimization time.

Funder

Spanish

Una manera de hacer Europa

CM project

Ethereum Foundation

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference40 articles.

1. 2018. Etherscan. https://etherscan.io.

2. 2018. Rattle - An EVM Binary Static Analysis Framework. https://github.com/crytic/rattle.

3. Ethereum. 2021. Solidity documentation. https://docs.soliditylang.org/en/latest/index.html.

4. Ethereum. 2021. Yul documentation. https://docs.soliditylang.org/en/latest/yul.html.

5. GASOL: Gas Analysis and Optimization for Ethereum Smart Contracts

Cited by 3 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Understanding Solidity Event Logging Practices in the Wild;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30

2. Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion;Sensors;2023-08-18

3. Using Automated Reasoning Techniques for Enhancing the Efficiency and Security of (Ethereum) Smart Contracts;Automated Reasoning;2022

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3