Skip to main content

Understanding Out of Gas Exceptions on Ethereum

  • Conference paper
  • First Online:

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1156))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Ethereum continues to suffer from DDoS attacks (2016). https://www.ethnews.com/ethereum-continues-to-suffer-from-ddos-attacks

  2. Transaction spam attack: next steps (2016). https://blog.ethereum.org/2016/09/22/transaction-spam-attack-next-steps/

  3. Contracts - solidity 0.5.11 documentation: creating contracts (2019). https://solidity.readthedocs.io/en/v0.5.11/contracts.html#creating-contracts

  4. Home - enterprise ethereum alliance (2019). https://entethalliance.org

  5. A next-generation smart contract and decentralized application platform, ethereum white paper (2019). https://github.com/ethereum/wiki/wiki/White-Paper

  6. Security alert: Ethereum constantinople postponement (2019). https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/

  7. Albert, E., Gordillo, P., Rubio, A., Sergey, I.: GASTAP: a gas analyzer for smart contracts. arXiv preprint arXiv:1811.10403 (2018)

  8. 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)

    Google Scholar 

  9. Androulaki, E., et al.: Hyperledger fabric: a distributed operating system for permissioned blockchains. In: Proceedings of the Thirteenth EuroSys Conference, p. 30. ACM (2018)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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

    Chapter  Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. 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)

    Article  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. 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)

    Google Scholar 

  18. 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

    Chapter  Google Scholar 

  19. 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)

    Google Scholar 

  20. Nakamoto, S., et al.: Bitcoin: a peer-to-peer electronic cash system (2008)

    Google Scholar 

  21. Wood, G., et al.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Pap. 151(2014), 1–32 (2014)

    Google Scholar 

  22. Yang, R., Murray, T., Rimba, P., Parampalli, U.: Empirically analyzing ethereum’s gas mechanism. arXiv preprint arXiv:1905.00553 (2019)

Download references

Acknowledgments

This work is supported by National Natural Science Foundation of China under the grant No.: 61672060.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Chao Liu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics