Abstract
In the Ethereum network, miners are incentivized to include transactions in a block depending on the gas price specified by the sender. The sender of a transaction therefore faces a trade-off between timely inclusion and cost of his transaction. Existing recommendation mechanisms aggregate recent gas price data on a per-block basis to suggest a gas price. We perform an empirical analysis of historic block data to motivate the use of a predictive model for gas price recommendation. Subsequently, we propose a novel mechanism that combines a deep-learning based price forecasting model as well as an algorithm parameterized by a user-specific urgency value to recommend gas prices. In a comprehensive evaluation on real-world data, we show that our approach results on average in costs savings of more than 50% while only incurring an inclusion delay of 1.3 blocks, when compared to the gas price recommendation mechanism of the most widely used Ethereum client.
Sam M. Werner—The author would like to thank the Brevan Howard Centre for Financial Analysis for its financial support.
Daniel Perez—The author would like to thank the Tezos Foundation for its financial support.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Note that via a hard-fork, the Ethereum Improvement Proposal 150 [3] re-aligned gas costs for instructions involving I/O-heavy operations.
- 2.
At the time of writing the average block gas limit was around 10,000,000 units of gas.
References
Ethgasstation. (2020). https://ethgasstation.info/. [Online; Accessed 14-January-2020].
Albert, E., Gordillo, P., Rubio, A., & Sergey, I. (2018, November). GASTAP: A gas analyzer for smart contracts. CoRR, abs/1811.1.
Buterin, V. (2019). EIP 150: Gas cost changes for IO-heavy operations. https://eips.ethereum.org/EIPS/eip-150. [Online; Accessed 05-June-2019].
Buterin, V. (2014). A next-generation smart contract and decentralized application platform. Ethereum, (January), 1–36.
Chen, T., Li, X., Luo, X., Zhang, X. (2017). Under-optimized smart contracts devour your money. In SANER 2017 - 24th IEEE International Conference on Software Analysis, Evolution, and Reengineering (pp. 442–446).
Chen, T., Li, X., Wang, Y., Chen, J., Li, Z., Luo, X., et al. (2017). An adaptive gas cost mechanism for ethereum to defend against under-priced dos attacks. In J. K. Liu & P. Samarati (Eds.), Information security practice and experience (pp. 3–24). Cham: Springer International Publishing.
Cho, K., van Merrienboer, B., Gülçehre, Ç., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, arXiv:1406.1078.
Dannen, C. (2017). Introducing ethereum and solidity: Foundations of cryptocurrency and blockchain programming for beginners (1st ed.). Berkely, CA, USA: Apress.
etherchain.org. (2020). Gas price oracle. https://www.etherchain.org/tools/gasPriceOracle. [Online; Accessed 15-January-2020].
ethernodes.org. (2020). Ethereum mainnet statistics. https://www.ethernodes.org/. [Online; Accessed 15-January-2020].
Etherscan. (2020). Ethereum average block time chart. https://etherscan.io/chart/blocktime. Accessed 28-January-2020.
Github. (2020). Gasstation-express. https://github.com/ethgasstation/gasstation-express-oracle. [Online; Accessed 15-January-2020].
Github. (2020). Official go implementation of the ethereum protocol. https://github.com/ethereum/go-ethereum/. [Online; Accessed 14-January-2020].
Github. (2020). Parity ethereum: The fastest and most advanced ethereum client. https://github.com/paritytech/parity-ethereum. [Online; Accessed 16-January-2020].
Grech, N., Kong, M., Jurisevic, A., Brent, L., Scholz, B., & Smaragdakis, Y. (2018). MadMax: Surviving out-of-gas conditions in ethereum smart contracts. SPLASH 2018 Oopsla, 2(October).
Harz, D., & Knottenbelt, W. (2018). Towards safer smart contracts: A survey of languages and verification methods. arXiv preprint arXiv:1809.09805.
Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780.
Kingma, D. P., & Ba, J. (2014). Adam: A method for stochastic optimization.
Marescotti, M., Blicha, M., Hyvärinen, A. E. J., Asadi, S., & Sharygina, N. (2018). Computing exact worst-case gas consumption for smart contracts. In T. Margaria & B. Steffen (Eds.), Leveraging applications of formal methods, verification and validation. Industrial practice (pp. 450–465). Cham: Springer International Publishing.
Nakamoto, S. (2008, December). Bitcoin: A peer-to-peer electronic cash system. https://bitcoin.org/bitcoin.pdf. Accessed: 2015-07-01.
Perez, D., & Livshits, B. (2019). Broken metre: Attacking resource metering in EVM. arXiv preprint arXiv:1909.07220.
Pierro, G. A., & Rocha, H. (2019). The influence factors on ethereum transaction fees. In 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB) (pp. 24–31). IEEE.
Pritz, P. J., Perez, D., & Leung, K. K. (2020). Fast-fourier-forecasting resource utilisation in distributed systems.
PyTorch Contributors. (2019). PyTorch online documentation. https://pytorch.org/docs. Accessed 13-August-2019.
Station, M. E. G. (2017). Gasstation express: A simple gas price oracle for anyone running a full ethereum node. https://medium.com/@ethgasstation/gasstation-express-a-simple-gas-price-oracle-for-anyone-running-a-full-ethereum-node-f1bde46260f5. [Online; Accessed 15-January-2020].
Wood, G. (2014). Ethereum yellow paper.
Yang, R., Murray, T., Rimba, P., & Parampalli, U. (2019). Empirically analyzing ethereum’s gas mechanism. CoRR, abs/1905.0.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Werner, S.M., Pritz, P.J., Perez, D. (2020). Step on the Gas? A Better Approach for Recommending the Ethereum Gas Price. In: Pardalos, P., Kotsireas, I., Guo, Y., Knottenbelt, W. (eds) Mathematical Research for Blockchain Economy. Springer Proceedings in Business and Economics. Springer, Cham. https://doi.org/10.1007/978-3-030-53356-4_10
Download citation
DOI: https://doi.org/10.1007/978-3-030-53356-4_10
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-53355-7
Online ISBN: 978-3-030-53356-4
eBook Packages: Economics and FinanceEconomics and Finance (R0)