From e17f97a8242c55b6fba66317d3720b9728a12f78 Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Tue, 3 Jun 2025 22:49:48 +0200 Subject: [PATCH] core/vm: increase cost when exp is > 32bit --- core/vm/contracts.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 73f2b8ffaa..1513665b30 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -418,7 +418,11 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { adjExpLen := new(big.Int) if expLen.Cmp(big32) > 0 { adjExpLen.Sub(expLen, big32) - adjExpLen.Lsh(adjExpLen, 3) + if c.eip7883 { + adjExpLen.Lsh(adjExpLen, 4) + } else { + adjExpLen.Lsh(adjExpLen, 3) + } } adjExpLen.Add(adjExpLen, big.NewInt(int64(msb))) // Calculate the gas cost of the operation