mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-29 22:32:56 +00:00
core/vm: increase cost when exp is > 32bit
This commit is contained in:
parent
07321c6d9c
commit
e17f97a824
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue