From b708feb9c34b0f62fc76cee549dbde6fbe939f22 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 10 Sep 2025 21:44:18 +0800 Subject: [PATCH] core/vm: fix comment and remove unused divisor in osakaModexpGas (#32553) The `divisor` const is not needed in the gas cost calculation in `osakaModexpGas`. --- core/vm/contracts.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 77fac2f907..34cb766708 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -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