当前位置: X-MOL 学术ACM Trans. Softw. Eng. Methodol. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Developing Cost-Effective Blockchain-Powered Applications
ACM Transactions on Software Engineering and Methodology ( IF 4.4 ) Pub Date : 2021-03-09 , DOI: 10.1145/3431726
Abdullah A. Zarir 1 , Gustavo A. Oliva 2 , Zhen M. (Jack) Jiang 3 , Ahmed E. Hassan 2
Affiliation  

Ethereum is a blockchain platform that hosts and executes smart contracts. Executing a function of a smart contract burns a certain amount of gas units (a.k.a., gas usage). The total gas usage depends on how much computing power is necessary to carry out the execution of the function. Ethereum follows a free-market policy for deciding the transaction fee for executing a transaction. More specifically, transaction issuers choose how much they are willing to pay for each unit of gas (a.k.a., gas price). The final transaction fee corresponds to the gas price times the gas usage. Miners process transactions to gain mining rewards, which come directly from these transaction fees. The flexibility and the inherent complexity of the gas system pose challenges to the development of blockchain-powered applications. Developers of blockchain-powered applications need to translate requests received in the frontend of their application into one or more smart contract transactions. Yet, it is unclear how developers should set the gas parameters of these transactions given that (i) miners are free to prioritize transactions whichever way they wish and (ii) the gas usage of a contract transaction is only known after the transaction is processed and included in a new block. In this article, we analyze the gas usage of Ethereum transactions that were processed between Oct. 2017 and Feb. 2019 (the Byzantium era). We discover that (i) most miners prioritize transactions based on their gas price only, (ii) 25% of the functions that received at least 10 transactions have an unstable gas usage (coefficient of variation = 19%), and (iii) a simple prediction model that operates on the recent gas usage of a function achieves an R-Squared of 0.76 and a median absolute percentage error of 3.3%. We conclude that (i) blockchain-powered application developers should be aware that transaction prioritization in Ethereum is frequently done based solely on the gas price of transactions (e.g., a higher transaction fee does not necessarily imply a higher transaction priority) and act accordingly and (ii) blockchain-powered application developers can leverage gas usage prediction models similar to ours to make more informed decisions to set the gas price of their transactions. Lastly, based on our findings, we list and discuss promising avenues for future research.

中文翻译:

开发具有成本效益的区块链驱动应用程序

以太坊是一个托管和执行智能合约的区块链平台。执行智能合约的功能会消耗一定数量的气体单位(也就是气体使用量)。总气体使用量取决于执行功能所需的计算能力。以太坊遵循自由市场政策来决定执行交易的交易费用。更具体地说,交易发行人选择他们愿意为每单位天然气支付多少(也就是天然气价格)。最终交易费用对应于 gas 价格乘以 gas 使用量。矿工处理交易以获得挖矿奖励,这些奖励直接来自这些交易费用。气体系统的灵活性和固有的复杂性对区块链驱动的应用程序的开发提出了挑战。区块链驱动应用程序的开发人员需要将其应用程序前端收到的请求转换为一项或多项智能合约交易。然而,鉴于(i)矿工可以自由地以他们希望的方式优先考虑交易,以及(ii)合约交易的 gas 使用情况只有在交易处理后才知道,因此开发人员应该如何设置这些交易的 gas 参数尚不清楚。包含在一个新的块中。在本文中,我们分析了 2017 年 10 月至 2019 年 2 月(拜占庭时代)期间处理的以太坊交易的 gas 使用量。我们发现 (i) 大多数矿工仅根据其 gas 价格优先交易,(ii) 收到至少 10 笔交易的函数中有 25% 的 gas 使用不稳定(变异系数 = 19%),(iii) 一个简单的预测模型,该模型对函数的最近气体使用情况进行操作,实现了 0.76 的 R-Squared 和 3.3% 的中值绝对百分比误差。我们的结论是 (i) 区块链驱动的应用程序开发人员应该意识到,以太坊中的交易优先级通常仅基于交易的 gas 价格(例如,更高的交易费用并不一定意味着更高的交易优先级)并采取相应的行动,并且(ii) 区块链驱动的应用程序开发人员可以利用类似于我们的天然气使用预测模型来做出更明智的决定,以设定其交易的天然气价格。最后,根据我们的发现,我们列出并讨论了未来研究的有希望的途径。我们的结论是 (i) 区块链驱动的应用程序开发人员应该意识到,以太坊中的交易优先级通常仅基于交易的 gas 价格(例如,更高的交易费用并不一定意味着更高的交易优先级)并采取相应的行动,并且(ii) 区块链驱动的应用程序开发人员可以利用类似于我们的天然气使用预测模型来做出更明智的决定,以设定其交易的天然气价格。最后,根据我们的发现,我们列出并讨论了未来研究的有希望的途径。我们的结论是 (i) 区块链驱动的应用程序开发人员应该意识到,以太坊中的交易优先级通常仅基于交易的 gas 价格(例如,更高的交易费用并不一定意味着更高的交易优先级)并采取相应的行动,并且(ii) 区块链驱动的应用程序开发人员可以利用类似于我们的天然气使用预测模型来做出更明智的决定,以设定其交易的天然气价格。最后,根据我们的发现,我们列出并讨论了未来研究的有希望的途径。更高的交易费用并不一定意味着更高的交易优先级)并采取相应的行动,并且(ii)区块链驱动的应用程序开发人员可以利用类似于我们的天然气使用预测模型来做出更明智的决定来设定他们交易的天然气价格。最后,根据我们的发现,我们列出并讨论了未来研究的有希望的途径。更高的交易费用并不一定意味着更高的交易优先级)并采取相应的行动,并且(ii)区块链驱动的应用程序开发人员可以利用类似于我们的天然气使用预测模型来做出更明智的决定来设定他们交易的天然气价格。最后,根据我们的发现,我们列出并讨论了未来研究的有希望的途径。
更新日期:2021-03-09
down
wechat
bug