2

I have the Block Gas Limit of a private Parity-based blockchain set to 4,712,388. That's the "gasLimit" parameter. But when I view it on a block explorer on the very first block running on this network, it reads it as 4,700,036. That is a factor of 1.0026281/

And when I set it as 44,712,388, it reads in as 44,364,406. That is a factor of 1.0078437. So it's not consistent.

There must be some reason though. Right?

  • I awared the bounty to @Linmao_Song but the site keeps saying I didn't. – stone.212 May 15 '18 at 4:37
3
+50

Apparently, Parity rounds the block gas limit value to multiplies of a constant (A follow-up question would be "why?". I can't find the answer yet. It probably should be a separate question anyway). See this comment in its source code. At the moment, the constant (i.e. see the next line - PARITY_GAS_LIMIT_DETERMINANT) is 37. And the two actual values in the question are both multiplies of 37.

4,700,036 = 37 * 127,028
44,364,406 = 37 * 1,199,038

Naturally one would notice the rounding result could have been closer to the original value 44,712,388. It turns out the rounding also takes into account another factor, i.e. a desired range, which is determined by the preceding blocks. See function round_block_gas_limit. This is the reason why it's not consistent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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