mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 12:06:40 +00:00
core/vm: fix comment and remove unused divisor in osakaModexpGas (#32553)
The `divisor` const is not needed in the gas cost calculation in `osakaModexpGas`.
This commit is contained in:
parent
dd7fe1be4b
commit
b708feb9c3
1 changed files with 1 additions and 2 deletions
|
|
@ -538,7 +538,6 @@ func berlinModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
|
||||||
func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64 {
|
func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64 {
|
||||||
const (
|
const (
|
||||||
multiplier = 16
|
multiplier = 16
|
||||||
divisor = 3
|
|
||||||
minGas = 500
|
minGas = 500
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -549,7 +548,7 @@ func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
|
||||||
}
|
}
|
||||||
iterationCount := modexpIterationCount(expLen, expHead, multiplier)
|
iterationCount := modexpIterationCount(expLen, expHead, multiplier)
|
||||||
|
|
||||||
// Calculate gas: (multComplexity * iterationCount) / osakaDivisor
|
// Calculate gas: multComplexity * iterationCount
|
||||||
carry, gas := bits.Mul64(iterationCount, multComplexity)
|
carry, gas := bits.Mul64(iterationCount, multComplexity)
|
||||||
if carry != 0 {
|
if carry != 0 {
|
||||||
return math.MaxUint64
|
return math.MaxUint64
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue