I'm having trouble publishing contracts and executing transactions due to the low gas limit (3.14 million gas ~0.15 ETH). How and when will the gas limit rise?

migrated from stackoverflow.com Nov 24 '15 at 18:47

This question came from our site for professional and enthusiast programmers.

  • 1
    A workaround can be to use the Solidity optimization flags. In general, contracts shouldn't rely on a high gas limit and instead make use of libraries of contracts that have been factored into discrete components or even functionality stubs. – Taylor Gerring Nov 20 '15 at 2:53

The block gas limit is determined by miners. According to the Ethereum protocol, they can raise/lower it by 1/1024 of the previous block.

Currently (11/20/2015), geth is set up to automatically increase the gas limit if the previous block used more than ⅔ of the previous block gas limit and automatically decrease it if it’s below the threshold. In practice, an increase (probably) never happens, and even if it does, most blocks are well below the ⅔ threshold, so the limit would fall back to pi million quickly. Gas usage is very spikey like that. See http://stats.ethdev.com

Furthermore, for miners to amend the ⅔ logic, they’d need to alter geth’s code and build from source which is not going to happen en masse.

There are ongoing discussions about what to do about this on https://gitter.im/ethereum/research. Vitalik floated the idea of making the limit 4x its current limit and leaving the ⅔ logic the way it is. I support the 4x increase, but I think the ⅔ logic needs to be rethought.

UPDATE: I asked Vitalik about the low gas limit during DEVCON1. The reason there is no rush to raise the gas limit has to do with block propagation times. Every node in the ethereum network has to execute every transaction. If the gas limit were increased substantially, there might be delays in block times which would cause the network to go from 17 (current average) up north of 20 seconds. That's not the direction we want to be heading in.

I'll also say that one benefit of a low gas price is that it forces contract authors to create efficient code which, in turn, reduces blockchain bloat.

as I understand it the reason for having a gas limit is to avoid nodes being burdened by the load of processing transactions during busy periods and thus reducing processing available for mining and thus delaying block creation and propagation. This would result in longer block times or incentivise miners to create zero transaction blocks just to get the mining reward.

One way this effect could be mitigated would be to have a moving average gas limit. eg: say 5 times pi million for the total of last five blocks. Keeping the same pi million average per block.

This would allow sporadic peaks of high gas for deployment of large contracts without increasing the average processing load . This would allow deployment of high gas contracts but be preferable to increasing the average gas per block.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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