3

I'm following this article to create my own PoA private blockchain.

Now I'm stucked at this section after number 13:

enter image description here

enter image description here

I've checked the Puppeth source code and Geth CLI docs, but I'm still not quite sure what's the best number for that What gas limit should full blocks target (MGas) question.

  1. Should I make it 94000000 too or should I make it higher?
  2. If higher, how much higher?
  3. What is the formula to get block Gas Target and block Gas Limit?

1 Answer 1

5

Take care, the gas target and limits are in Mega-gas. The default is 7.5. Your 94000000 is actually 94 * 10^12 gas, which is semi-infinite. To get 94M, just specify 94.

A good rule of thumb imho is to stick to the amounts mainnet can handle (8M). Most clients require 100-200ms to crunch through an average mainnet 8M gas block. If you raise the gas limit to 94M, processing such a block will easily take 1.2-2.4sec. That might be a bit pushing it even in PoA, probably bad things can happen with block propagation at those numbers.

The gas target is what miners will aim for even with empty blocks. If blocks get full, Ethereum has an auto adjustment mechanism where miners will gradually raise the gas limit to cater for more transactions. It however doesn't make any sense to push it upwards unlimited, because you'll hit strange issues within the code.

Rinkeby for example uses 8M gas for the block target and 10-12M for the upper limit.

2
  • 1
    Thank you Peter for your answer. Just to seek more clarification here. Let say I set the block upper limit to 10M, what will happen to the transaction if the block size is already 10M? Will the transaction get deleted from the txpool? Will the mining process fail? Last question, can I edit this block target and block upper limit after my PoA network is up and running? Nov 13, 2018 at 16:55
  • 1
    Transaction will be included in next block Dec 6, 2018 at 11:10

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.