arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.15676cs.PL
收藏

通过类型系统防止 Gas 耗尽异常

Preventing Out-of-Gas Exceptions by Typing

Luca Aceto, Daniele Gorla, Stian Lybech, Mohammad Hamdaqa

AI总结:

本文扩展 TinySol 语言,引入异常与 gas 机制,并设计类型系统保证智能合约运行时永不耗尽 gas,避免交易中止且费用不返还。

摘要:

我们继续开发 TinySol,这是一种基于 Solidity 的最小面向对象语言,Solidity 是以太坊平台使用的标准智能合约语言。我们首先为 TinySol 扩展了异常和 gas 机制,并为其配备了小步操作语义。引入 gas 机制对于在 TinySol 中建模真实世界的智能合约至关重要,因为这是通常确保以太坊智能合约终止的方式。然后,我们为智能合约设计了一个类型系统,保证此类程序在运行时永远不会耗尽 gas。这对于智能合约来说是一个理想的属性,因为耗尽 gas 的交易会被中止(aborted),但为运行代码所支付的费用不会返还给调用者。

英文摘要:

We continue the development of TinySol, a minimal object-oriented language based on Solidity, the standard smart-contract language used for the Ethereum platform. We first extend TinySol with exceptions and a gas mechanism, and equip it with a small-step operational semantics. Introducing the gas mechanism is fundamental for modelling real-life smart contracts in TinySol, since this is the way in which termination of Ethereum smart contracts is usually ensured. We then devise a type system for smart contracts guaranteeing that such programs never run out of gas at runtime. This is a desirable property for smart contracts, since a transaction that runs out of gas is aborted, but the price paid to run the code is not returned to the invoker.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑