evmos icon indicating copy to clipboard operation
evmos copied to clipboard

Question: Can anyone simulate case overflow block gas limit?

Open VictorTrustyDev opened this issue 1 year ago • 6 comments

Context

Can someone explain to me how 3x transactions with gas limit 36m can be included in a single block like this?

Is the validator altered their Tendermint/CometBFT to bypass the logic check total gas during collect txs from mempool for proposal?

VictorTrustyDev avatar Jan 17 '24 13:01 VictorTrustyDev

This is the expected behaviour. If the gas used doesn't reach a certain threshold we consume half of the gas limit.

The code that tackle this issue:

        // calculate a minimum amount of gas to be charged to sender if GasLimit
	// is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics
	// for more info https://github.com/evmos/ethermint/issues/1085
	gasLimit := math.LegacyNewDec(int64(msg.Gas()))
	minGasMultiplier := k.GetMinGasMultiplier(ctx)
	minimumGasUsed := gasLimit.Mul(minGasMultiplier)
	if !minimumGasUsed.TruncateInt().IsUint64() {
		return nil, errorsmod.Wrapf(types.ErrGasOverflow, "minimumGasUsed(%s) is not a uint64", minimumGasUsed.TruncateInt().String())
	}
	if msg.Gas() < leftoverGas {
		return nil, errorsmod.Wrapf(types.ErrGasOverflow, "message gas limit < leftover gas (%d < %d)", msg.Gas(), leftoverGas)
	}

For more info, view this issue

ramacarlucho avatar Feb 14 '24 21:02 ramacarlucho

@ramacarlucho I understood and know how it was handled but I was asking about simulate the case. Please reopen the ticket, I still need to know how to simulate the block.

VictorTrustyDev avatar Feb 15 '24 03:02 VictorTrustyDev

Thanks for reporting this issue @VictorTrustyDev We'll investigate this further

Just to clarify, the issue is that there's this block that consumed more gas than allowed Block max gas is 40M and this block has 54M gas used

GAtom22 avatar Feb 22 '24 13:02 GAtom22

Yeah, 3 evm txs each consume half of max gas 18m (of 36m) is already 54m.

VictorTrustyDev avatar Feb 22 '24 13:02 VictorTrustyDev

This issue is stale because it has been open 45 days with no activity. Remove Status: Stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 08 '24 00:04 github-actions[bot]