Skip to main content
QUICK REVIEW

[论文解读] The Economics of Smart Contracts

Kirk Baird, Jeong Seong-Ho|arXiv (Cornell University)|Oct 23, 2019
Blockchain Technology Applications and Security参考文献 21被引用 4
一句话总结

本文揭示了以太坊气体成本模型中的一个关键缺陷:尽管气体价格固定,SLOAD等关键指令的执行时间却随区块链长度增长而不成比例地增加。通过在以太坊历史中广泛部署仪器,作者提出了一种基于性能的新气体模型,引入区块高度以稳定执行成本,消除智能合约执行中的日益严重的低效问题。

ABSTRACT

Ethereum is a distributed blockchain that can execute smart contracts, which inter-communicate and perform transactions automatically. The execution of smart contracts is paid in the form of gas, which is a monetary unit used in the Ethereum blockchain. The Ethereum Virtual Machine (EVM) provides the metering capability for smart contract execution. Instruction costs vary depending on the instruction type and the approximate computational resources required to execute the instruction on the network. The cost of gas is adjusted using transaction fees to ensure adequate payment of the network. In this work, we highlight the "real" economics of smart contracts. We show that the actual costs of executing smart contracts are disproportionate to the computational costs and that this gap is continuously widening. We show that the gas cost-model of the underlying EVM instruction-set is wrongly modeled. Specifically, the computational cost for the SLOAD instruction increases with the length of the blockchain. Our proposed performance model estimates gas usage and execution time of a smart contract at a given block-height. The new gas-cost model incorporates the block-height to eliminate irregularities in the Ethereum gas calculations. Our findings are based on extensive experiments over the entire history of the EVM blockchain.

研究动机与目标

  • 调查以太坊智能合约执行中实际执行时间与气体成本之间日益扩大的差异。
  • 识别当前气体成本模型未能考虑核心EVM指令(如SLOAD和SSTORE)在区块链增长过程中执行时间增加的问题。
  • 开发一个基于区块高度估算气体使用量和执行时间的性能模型。
  • 提出一种结合区块高度的修订版气体成本模型,以纠正每单位气体执行时间的通胀趋势。
  • 解决以太坊在即将到来的权益证明转型背景下的可扩展性与经济可持续性问题。

提出的方法

  • 作者对Parity以太坊客户端进行了宏观与微观层面的仪器化,测量了从以太坊主链起点至第800万区块的整个历史中执行时间与气体使用情况。
  • 分析了EVM指令的时间-每气体比,重点关注SLOAD、SSTORE和CALLCODE,观察到其执行时间随区块高度增加。
  • 构建了性能模型,以估算在任意给定区块高度下智能合约的气体消耗与执行时间。
  • 所提出的模型引入标准智能合约抽象,以模拟不同区块高度下平均合约行为。
  • 新气体成本模型通过调整状态访问指令(尤其是SLOAD)的成本,结合区块高度,以反映实际资源使用情况。
  • 利用从以太坊主网收集的实证数据验证了该模型,显示状态密集型操作的执行时间持续增长。

实验结果

研究问题

  • RQ1为何EVM指令(如SLOAD)的执行时间随时间推移而增加,尽管气体成本保持不变?
  • RQ2当前以太坊气体成本模型与实际计算资源使用量之间的错配程度如何?
  • RQ3区块链大小如何影响智能合约中状态访问操作的性能?
  • RQ4基于区块高度的气体成本模型能否稳定每单位气体的执行时间并提升经济可预测性?
  • RQ5这种定价错误对以太坊长期可扩展性与安全性(尤其是在权益证明机制下)有何影响?

主要发现

  • SLOAD指令的执行时间随区块链长度显著增加,从第100万区块到第800万区块,执行时间最高增长达200%。
  • SSTORE指令也表现出可测量的执行时间随时间推移的增长,尽管增幅不如SLOAD明显。
  • SLOAD的时间-每气体比并非恒定,且随区块高度增长,表明当前气体成本模型存在根本性缺陷。
  • 当前气体成本模型未能反映状态访问成本的增长,导致每单位气体的执行时间不成比例增加。
  • 所提出的基于区块高度的气体模型成功稳定了每单位气体的执行时间,消除了通胀趋势。
  • 研究证实存储操作是性能退化的主要驱动因素,而CPU使用量与气体成本的相关性极低。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。