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:
Zach Brown 2025-09-10 21:44:18 +08:00 committed by GitHub
parent dd7fe1be4b
commit b708feb9c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -538,7 +538,6 @@ func berlinModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64 {
const (
multiplier = 16
divisor = 3
minGas = 500
)
@ -549,7 +548,7 @@ func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
}
iterationCount := modexpIterationCount(expLen, expHead, multiplier)
// Calculate gas: (multComplexity * iterationCount) / osakaDivisor
// Calculate gas: multComplexity * iterationCount
carry, gas := bits.Mul64(iterationCount, multComplexity)
if carry != 0 {
return math.MaxUint64