nimbus-eth1 icon indicating copy to clipboard operation
nimbus-eth1 copied to clipboard

txpool: gasLimit calculation does not match sealing engine gasLimit

Open jangko opened this issue 2 years ago • 1 comments

pre London gasLimit in sealing engine

computeGasLimit(
      parent.gasUsed,
      parent.gasLimit,
      gasFloor = DEFAULT_GAS_LIMIT,
      gasCeil = DEFAULT_GAS_LIMIT)

post London gasLimit in sealing engine

if isLondon(conf, header.blockNumber):
    var parentGasLimit = parent.gasLimit
    if not isLondon(conf, parent.blockNumber):
      # Bump by 2x
      parentGasLimit = parent.gasLimit * EIP1559_ELASTICITY_MULTIPLIER
    # TODO: desiredLimit can be configured by user, gasCeil
    header.gasLimit = calcGasLimit1559(parentGasLimit, desiredLimit = DEFAULT_GAS_LIMIT)

seems one or both of them produce different result compared to txPool gasLimit.

Sealing engine gasLimit pass test using test vector from https://notes.ethereum.org/rmVErCfCRPKGqGkUe89-Kg?both

but txPool gasLimit failed to pass test.

see #1030

jangko avatar Apr 03 '22 12:04 jangko

in #1047 we already remove over complicated job queue in txpool, perhaps we can simplify txpool further by replacing it with simpler gas limit calculator. current gas limit calculator in txpool also broken.

jangko avatar Apr 11 '22 09:04 jangko