From 9caab0d8de84c923617d2edb7314ebee54b78a84 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 5 Jun 2025 09:49:46 +0200 Subject: [PATCH] Update contracts.go --- core/vm/contracts.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index fa3b60b716..d10ac3525b 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -469,18 +469,15 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { if gas.BitLen() > 64 { return math.MaxUint64 } - - if gas.Uint64() < minPrice { - return minPrice - } - return gas.Uint64() + return max(minPrice, gas.Uint64()) } + + // Pre-osaka logic. gas = modexpMultComplexity(gas) if adjExpLen.Cmp(big1) > 0 { gas.Mul(gas, adjExpLen) } gas.Div(gas, big20) - if gas.BitLen() > 64 { return math.MaxUint64 }