fix: cap the message gas limit at the block gas limit (#10637)
Technically, if a message is near the block gas limit, this method could over-estimate past the block gas limit. Instead, cap at the block gas limit.
This commit is contained in:
parent
9d44c88cbb
commit
d1364caa84
@ -388,6 +388,10 @@ func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Messag
|
||||
return nil, err
|
||||
}
|
||||
msg.GasLimit = int64(float64(gasLimit) * m.Mpool.GetConfig().GasLimitOverestimation)
|
||||
// Gas overestimation can cause us to exceed the block gas limit, cap it.
|
||||
if msg.GasLimit > build.BlockGasLimit {
|
||||
msg.GasLimit = build.BlockGasLimit
|
||||
}
|
||||
}
|
||||
|
||||
if msg.GasPremium == types.EmptyInt || types.BigCmp(msg.GasPremium, types.NewInt(0)) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user