13

A few days ago, several attempts at creating a contract failed with out of gas errors (confirmed by etherscan/ethercamp and getBalance API), however it is not clear to me what failed exactly, and how it can be diagnosed.

Not enough gas for 'No gas to return just created contract' cause spending

One such transaction is 0x47bf53491a14e64bc8938afa97d4b012677f465bddd7c3c0bbfb5df2baa99127

If you check it in Etherscan and ether.camp, it is listed with an error, but when looking at the vmtrace in both explorers, or when looking at the output of debug.traceTransaction, no error is reported.

The transaction receipt also shows no error and indicates a contract address as if everything worked.

What exactly went wrong?

(I tentatively declared an Issue for geth, but I am unsure of how it should be qualified)

edit AFAICT there four transactions with the same behavior, listed below, (they are not mine, nor my attempts, I am only interested in them because of the out of gas behavior)

  • 0x0b157cbbcca6079664e1f61e5f5e33241999c1cc1a7dbc1adad347b904c0fb65
  • 0xc712e39a316745d1c0154941bcd9c60eacaf6287596dd3e356249e69509d20c1
  • 0xaf071ce2147cc61d951a07c4e123c99f84b50e3656ceb07bba2c78796875626c
  • 0x47bf53491a14e64bc8938afa97d4b012677f465bddd7c3c0bbfb5df2baa99127
8
  • This doesn't look like a geth issue. Possibly a Solidity bug that causes improper returns? Any chance you can post the initializer method from the source? Commented May 17, 2016 at 15:19
  • Not sure what you mean by initializer method... I merely checked the traceTransaction vs getBalance before/after using geth, found something I did not understand, and then had a look at what the explorers were saying :)
    – fair glu
    Commented May 17, 2016 at 15:30
  • I mean the function in the source code with the same name as the contract Commented May 17, 2016 at 15:52
  • @fairglu: Did you figure out the problem? etherscan.io/tx/…
    – ryepdx
    Commented May 17, 2016 at 20:18
  • 1
    If your contract threw an exception during deployment, that would explain it. Exceptions consume all the gas in a transaction and result in an "out of gas" error.
    – ryepdx
    Commented May 18, 2016 at 5:08

1 Answer 1

3

You only provided 500,000 gas when creating the transaction, and the transaction burned through all of it (see "Gas" and "Gas Used By Transaction" on Etherscan). You really just need to provide more gas.

As seen on Ethstats, the current gas limit (per block) is 4,712,388. You may want to try submitting the transaction on Testnet or using eth_estimategas to see exactly how much gas it's going to take to get this contract creation transaction to process before you go about spending that much gas on one transaction.

1
  • 1
    As I wrote, these are NOT my transactions, just transactions I found by scanning the blockchain, the issue is about figuring out a posteriori from the trace and ethereum API, without having to rely on 3rd party explorers.
    – fair glu
    Commented May 30, 2016 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.