Skip to content

Commit b708feb

Browse files
authored
core/vm: fix comment and remove unused divisor in osakaModexpGas (#32553)
The `divisor` const is not needed in the gas cost calculation in `osakaModexpGas`.
1 parent dd7fe1b commit b708feb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/vm/contracts.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ func berlinModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
538538
func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64 {
539539
const (
540540
multiplier = 16
541-
divisor = 3
542541
minGas = 500
543542
)
544543

@@ -549,7 +548,7 @@ func osakaModexpGas(baseLen, expLen, modLen uint64, expHead uint256.Int) uint64
549548
}
550549
iterationCount := modexpIterationCount(expLen, expHead, multiplier)
551550

552-
// Calculate gas: (multComplexity * iterationCount) / osakaDivisor
551+
// Calculate gas: multComplexity * iterationCount
553552
carry, gas := bits.Mul64(iterationCount, multComplexity)
554553
if carry != 0 {
555554
return math.MaxUint64

0 commit comments

Comments
 (0)