Skip to main content
QUICK REVIEW

[论文解读] Empirically Analyzing Ethereum's Gas Mechanism

Renlord Yang, Toby Murray|arXiv (Cornell University)|May 2, 2019
Blockchain Technology Applications and Security参考文献 27被引用 4
一句话总结

本文通过测量以太坊自创世区块以来超过200万区块的纳秒级交易执行时间,首次对以太坊的gas机制进行了大规模实证分析。研究发现,当前的gas成本未能准确反映实际计算成本,尤其在I/O密集型操作码上表现尤为明显,且高性能节点存在不公平优势,威胁网络去中心化。

ABSTRACT

Ethereum's Gas mechanism attempts to set transaction fees in accordance with the computational cost of transaction execution: a cost borne by default by every node on the network to ensure correct smart contract execution. Gas encourages users to author transactions that are efficient to execute and in so doing encourages node diversity, allowing modestly resourced nodes to join and contribute to the security of the network. However, the effectiveness of this scheme relies on Gas costs being correctly aligned with observed computational costs in reality. In this work, we performed the first large scale empirical study to understand to what degree this alignment exists in practice, by collecting and analyzing Tera-bytes worth of nanosecond-precision transaction execution traces. Besides confirming potential denial-of-service vectors, our results also shed light on the role of I/O in transaction costs which remains poorly captured by the current Gas cost model. Finally, our results suggest that under the current Gas cost model, nodes with modest computational resources are disadvantaged compared to their better resourced peers, which we identify as an ongoing threat to node diversity and network decentralization.

研究动机与目标

  • 实证评估以太坊gas成本模型在真实使用场景中与实际交易执行成本的匹配程度。
  • 识别理论gas定价与实际执行时间之间的差异,特别是针对I/O密集型操作。
  • 评估在当前gas模型下,硬件性能差异对节点多样性及网络去中心化的影响。
  • 分析内存缓存和I/O在交易执行成本中的作用,这些因素在当前模型中未能充分捕捉。
  • 探究gas机制是否有效激励高效交易设计并防止拒绝服务攻击。

提出的方法

  • 通过重放以太坊自创世区块以来的所有状态转换,收集了TB级别的纳秒级EVM执行追踪数据。
  • 在两台不同机器上测量每个EVM操作码的执行时间:一台高性能系统和一台典型台式机。
  • 为每个操作码计算Time-to-Gas比率,以评估实际执行时间与分配gas成本之间的校准精度。
  • 分析磁盘I/O和内存缓存对执行性能的影响,比较不同硬件配置下的结果。
  • 对比两台机器的执行行为,评估当前gas模型对资源有限节点的公平性。
  • 使用操作码级别执行时间分布的统计分析,检测系统性定价错误的操作。

实验结果

研究问题

  • RQ1当前以太坊gas成本在多大程度上准确反映了真实世界的交易执行时间?
  • RQ2I/O操作如何影响交易执行成本?为何当前gas模型未能充分捕捉这些成本?
  • RQ3在当前gas定价方案下,高端与资源有限节点之间的性能差距有多大?
  • RQ4是否存在系统性定价错误的操作码,从而可能引发拒绝服务漏洞?
  • RQ5内存缓存如何影响I/O密集型操作的观察执行时间?这是否影响gas成本的公平性?

主要发现

  • 涉及磁盘I/O的多个EVM操作码存在显著定价错误,因实际执行成本被低估,可能成为拒绝服务攻击的向量。
  • I/O操作对交易执行时间有显著贡献,但其成本在当前gas模型中未得到充分反映,该模型将它们视为具有恒定或可忽略的成本。
  • 当前的gas成本模型有利于高性能机器,使其在交易处理效率上相对于资源有限的节点具有可测量的优势。
  • I/O操作码的执行时间分布表现出高度变异性,表明性能对硬件和缓存行为极为敏感,而当前gas模型未对此进行考虑。
  • 高端与标准机器之间执行效率的差异削弱了节点多样性,并对以太坊去中心化的长期发展构成威胁。
  • 本研究证实,当前的gas模型未能与真实世界的计算成本保持一致,尤其在涉及持久存储访问的操作中更为明显。

更好的研究,从现在开始

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

无需绑定信用卡

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