This question already has an answer here:

I've tried to run contract function in Mist, which required 10,900,000 of gas, but get 'Exceeds gas limit' error.

How can I call this function? Maybe some ways to increase gas limit inside Mist...

Also, if I provide less gas than required (e.g. 3,000,000), what will happen ?

marked as duplicate by Prashant Prabhakar Singh, Richard Horrocks, Achala Dissanayake, Nicolas Massart, Badr Bellaj Oct 5 '17 at 18:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

The limit on the total amount of gas that can be used in a block (the Block Gas Limit), by all transactions, is currently ~6.7M, so this transaction will currently never succeed.

You can't increase this total limit on the amount of gas used in a block, only the miners can agree on what this should be.

If you were somehow able to get around Mist preventing you from sending this transaction and you set the gas limit on the transaction (the total amount that of gas that you are willing to pay for) to 3M then it would run out of gas before it completes, the transaction will fail and you would have effectively have burnt the Ether / given the miner the Ether for nothing.

I recommend you rethink about what you are trying to do with Ethereum; try to remove storage of data that does not need to be on the blockchain, break the code into smaller functions etc.

  • And if I call a function like for (uint k = 0; k < 3000; k++ ){ new_value = k; } and my gas was enough for 2000 steps, which value will I have in new_value ? Default value or 1999 ? – sp41mer Oct 4 '17 at 19:39
  • I'm afraid that once gas is over the transaction fails and it is like the computation never happened – Davide C Nov 6 '17 at 15:31

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