From 51f8da1d6e03563d325245e1e6088f89a7ea3eca Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 5 Jun 2025 16:07:56 +0200 Subject: [PATCH] Update contracts.go --- core/vm/contracts.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index d10ac3525b..8dd7b9f056 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -441,14 +441,15 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { maxLenOver32 := gas.Cmp(big32) > 0 if c.eip2565 { - // EIP-2565 has three changes + // EIP-2565 (Berlin fork) has three changes: + // // 1. Different multComplexity (inlined here) // in EIP-2565 (https://eips.ethereum.org/EIPS/eip-2565): // // def mult_complexity(x): // ceiling(x/8)^2 // - //where is x is max(length_of_MODULUS, length_of_BASE) + // where is x is max(length_of_MODULUS, length_of_BASE) gas.Add(gas, big7) gas.Rsh(gas, 3) gas.Mul(gas, gas) @@ -472,7 +473,7 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { return max(minPrice, gas.Uint64()) } - // Pre-osaka logic. + // Pre-Berlin logic. gas = modexpMultComplexity(gas) if adjExpLen.Cmp(big1) > 0 { gas.Mul(gas, adjExpLen)