mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +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)
|
adjExpLen := new(big.Int)
|
||||||
if expLen.Cmp(big32) > 0 {
|
if expLen.Cmp(big32) > 0 {
|
||||||
adjExpLen.Sub(expLen, big32)
|
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)))
|
adjExpLen.Add(adjExpLen, big.NewInt(int64(msb)))
|
||||||
// Calculate the gas cost of the operation
|
// Calculate the gas cost of the operation
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue