From c4661020930b618365a19df028e5c98fa4cd63a6 Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Mon, 27 Apr 2026 11:47:18 +0200 Subject: [PATCH] core: fixed costPerStateByte --- core/evm.go | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/core/evm.go b/core/evm.go index 27096ab45e..de43bbbe4a 100644 --- a/core/evm.go +++ b/core/evm.go @@ -18,7 +18,6 @@ package core import ( "math/big" - "math/bits" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" @@ -91,26 +90,7 @@ func CostPerStateByte(header *types.Header, config *params.ChainConfig) uint64 { if !config.IsAmsterdam(header.Number, header.Time) { return 0 } - const ( - blocksPerYear uint64 = 2_628_000 // 7200 * 365 - offset uint64 = 9578 - significantBts uint64 = 5 - ) - numerator := header.GasLimit * blocksPerYear - denominator := uint64(2) * params.TargetStateGrowthPerYear - raw := (numerator + denominator - 1) / denominator - shifted := raw + offset - // bit length of shifted - bitLen := uint64(64 - bits.LeadingZeros64(shifted)) - var shift uint64 - if bitLen > significantBts { - shift = bitLen - significantBts - } - quantized := (shifted >> shift) << shift - if quantized > offset { - return quantized - offset - } - return 1 + return 1174 // Fixed cost for devnet-4 } // NewEVMTxContext creates a new transaction context for a single transaction.