0

I am wondering if it is available to make multiple gas limit block in one of my private networks. The multiple gas limits blocks in a private network means that size 10, 100, 1000 and so on, those are mixed in a same private ethereum network. I have checked that it seems unavailable, but I wanted to create multiple gaslimit block sizes if any possible. Please let me know any comments.

1 Answer 1

1

The gas limit can change overtime based on the targetgaslimit set by miners (this is geth terminology). The gas limit is capped with an upper and lower bound and can only be changed so much with each new block. So the gas limit can be dynamic, but generally there really is only gas limit at any point in time.

Often times blocks do not use all of the gas available in the gas limit. Blocks may only use a small percentage of the gas limit available. In your example - if the gas limit was 10,000 - then you could have blocks that use 10, 100, and 1,000 gas all in the same network.


If we look at an example of two blocks that were published on eth main net 9269109 on etherscan we can see the gas limit of this block is 9,102,737 however the gas used was 4,228,665. This means only ~46% of the gas limit was actually used.

This means that more transactions could have fit into the block based on the gas limit, however a miner found an appropriate hash to publish a block before it was full and sent it to the network. The miner is incentivized to publish this block as fast as possible to increase the chance of this block being accepted by the network and therefore receiving the block reward. For this reason, the miner publishes the block even though there is still room for transactions in the block based on the gas limit.

enter image description here

4
  • Can you explain about your comment from "Blocks may only use a small percentage of the gas limit available"?
    – JongH
    Jan 12, 2020 at 21:55
  • 1
    Updating answer with example
    – Steven V
    Jan 12, 2020 at 23:29
  • Awesome. One more basic question is that I would like to test this various block size but, how I test to get a various sized block in my private ethereum network. Should I set the option --targetgaslimit for each or change source code for that like gaslimit?
    – JongH
    Jan 13, 2020 at 22:47
  • 1
    If you are working with your own private network, you can set the gas limit in the genesis file and when your run the geth commands for your miners, use the --targetgaslimit flag and you should be able to see the gaslimit property of published blocks changing
    – Steven V
    Jan 13, 2020 at 22:55

Your Answer

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

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