Abstract
Ethereum is by far the most popular smart contract platform in the public blockchain category. In Ethereum, special programs named smart contracts codify the “self-governed accounts”. By design, users can send transactions to smart contracts, which will automatically lead to code execution and state modification. Unlike regular programs, smart contracts are restricted in execution by gas limit, i.e., a form of runtime resource. If a transaction uses up all available gas, an out of gas (OG) exception will trigger, reverting state until right before the transaction. In this work, we empirically studied the OG exceptions on Ethereum for the very first time. In particular, we collected exception transactions using an instrumented Ethereum client. By investigating OG exceptions, we found OG stand out in terms of both occurrences and damages. Moreover, we focused on individual contracts and transactions, aiming at discovering and identifying common causing factors triggering these exceptions. At last, we also investigate existing tools in preventing OG exceptions. The results call for further research and study in this direction.
Keywords
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Ethereum continues to suffer from DDoS attacks (2016). https://www.ethnews.com/ethereum-continues-to-suffer-from-ddos-attacks
Transaction spam attack: next steps (2016). https://blog.ethereum.org/2016/09/22/transaction-spam-attack-next-steps/
Contracts - solidity 0.5.11 documentation: creating contracts (2019). https://solidity.readthedocs.io/en/v0.5.11/contracts.html#creating-contracts
Home - enterprise ethereum alliance (2019). https://entethalliance.org
A next-generation smart contract and decentralized application platform, ethereum white paper (2019). https://github.com/ethereum/wiki/wiki/White-Paper
Security alert: Ethereum constantinople postponement (2019). https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/
Albert, E., Gordillo, P., Rubio, A., Sergey, I.: GASTAP: a gas analyzer for smart contracts. arXiv preprint arXiv:1811.10403 (2018)
Alharby, M., Aldweesh, A., van Moorsel, A.: Blockchain-based smart contracts: a systematic mapping study of academic research (2018). In: Proceedings of the 2018 International Conference on Cloud Computing, Big Data and Blockchain (2018)
Androulaki, E., et al.: Hyperledger fabric: a distributed operating system for permissioned blockchains. In: Proceedings of the Thirteenth EuroSys Conference, p. 30. ACM (2018)
Chen, T., Li, X., Luo, X., Zhang, X.: Under-optimized smart contracts devour your money. In: 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 442–446. IEEE (2017)
Chen, T., et al.: An adaptive gas cost mechanism for ethereum to defend against under-priced DoS attacks. In: Liu, J.K., Samarati, P. (eds.) ISPEC 2017. LNCS, vol. 10701, pp. 3–24. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-72359-4_1
Chen, T., et al.: Towards saving money in using smart contracts. In: 2018 IEEE/ACM 40th International Conference on Software Engineering: New Ideas and Emerging Technologies Results (ICSE-NIER), pp. 81–84. IEEE (2018)
Cheng, R., et al.: Ekiden: a platform for confidentiality-preserving, trustworthy, and performant smart contracts. In: 2019 IEEE European Symposium on Security and Privacy (EuroS&P), pp. 185–200. IEEE (2019)
Grech, N., Kong, M., Jurisevic, A., Brent, L., Scholz, B., Smaragdakis, Y.: MadMax: surviving out-of-gas conditions in Ethereum smart contracts. Proc. ACM Program. Lang. 2(OOPSLA), 116 (2018)
Kosba, A., Miller, A., Shi, E., Wen, Z., Papamanthou, C.: Hawk: the blockchain model of cryptography and privacy-preserving smart contracts. In: 2016 IEEE Symposium on Security and Privacy (SP), pp. 839–858. IEEE (2016)
Kumaresan, R., Bentov, I.: How to use bitcoin to incentivize correct computations. In: Proceedings of the 2014 ACM SIGSAC Conference on Computer and Communications Security, pp. 30–41. ACM (2014)
Luu, L., Chu, D.H., Olickel, H., Saxena, P., Hobor, A.: Making smart contracts smarter. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 254–269. ACM (2016)
Marescotti, M., Blicha, M., Hyvärinen, A.E.J., Asadi, S., Sharygina, N.: Computing exact worst-case gas consumption for smart contracts. In: Margaria, T., Steffen, B. (eds.) ISoLA 2018. LNCS, vol. 11247, pp. 450–465. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-03427-6_33
Miers, I., Garman, C., Green, M., Rubin, A.D.: Zerocoin: anonymous distributed e-cash from Bitcoin. In: 2013 IEEE Symposium on Security and Privacy, pp. 397–411. IEEE (2013)
Nakamoto, S., et al.: Bitcoin: a peer-to-peer electronic cash system (2008)
Wood, G., et al.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Pap. 151(2014), 1–32 (2014)
Yang, R., Murray, T., Rimba, P., Parampalli, U.: Empirically analyzing ethereum’s gas mechanism. arXiv preprint arXiv:1905.00553 (2019)
Acknowledgments
This work is supported by National Natural Science Foundation of China under the grant No.: 61672060.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Liu, C., Gao, J., Li, Y., Chen, Z. (2020). Understanding Out of Gas Exceptions on Ethereum. In: Zheng, Z., Dai, HN., Tang, M., Chen, X. (eds) Blockchain and Trustworthy Systems. BlockSys 2019. Communications in Computer and Information Science, vol 1156. Springer, Singapore. https://doi.org/10.1007/978-981-15-2777-7_41
Download citation
DOI: https://doi.org/10.1007/978-981-15-2777-7_41
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-15-2776-0
Online ISBN: 978-981-15-2777-7
eBook Packages: Computer ScienceComputer Science (R0)