core/vm: increase cost when exp is > 32bit

This commit is contained in:
MariusVanDerWijden 2025-06-03 22:49:48 +02:00
parent 07321c6d9c
commit e17f97a824

View file

@ -418,7 +418,11 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 {
adjExpLen := new(big.Int)
if expLen.Cmp(big32) > 0 {
adjExpLen.Sub(expLen, big32)
adjExpLen.Lsh(adjExpLen, 3)
if c.eip7883 {
adjExpLen.Lsh(adjExpLen, 4)
} else {
adjExpLen.Lsh(adjExpLen, 3)
}
}
adjExpLen.Add(adjExpLen, big.NewInt(int64(msb)))
// Calculate the gas cost of the operation