Open
Description
When using a custom genesis environment to set a custom gas limit, it results in an invalid gas limit value being set for blocks 1 and after, since no gas limit is specified for these later blocks, the default is used, which would be outside of the allowed increase/decrease of gas limit in a 1 block period.
E.g. if gas_limit
is set to 10_000_000_000 in genesis_environment
, and no gas_limit
is set for any of the blocks in the test, the environment gas limit for block 1 reverts to the default value (100_000_000_000_000_000) in this line:
The default gas_limit
is much higher than the allowed increase per block, therefore the block is invalid, and the block processing will fail:
block #1 insertion into chain failed: invalid gas limi
t: have 100000000000000000, want 10000000000 +-= 9765624
We need to either:
- take into account the parent gas used before setting a default value in the block 1
- check the gas limit delta from block to block and warn the tester when the value is invalid