From 075cc6417a949fd1b7314a10fd9e442db2592e26 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 21 Apr 2026 16:01:39 +0200 Subject: [PATCH] core/txpool: report actual 110% threshold in intrinsic gas error When a chain has gasCostPerStateByte != 0 (EIP-8037), the txpool admission requires tx.Gas() >= ceil(intrGas.RegularGas * 10/9), but the error message reported intrGas.RegularGas as the "minimum needed", which is the unscaled value below the real threshold. This is confusing: the user sees e.g. "gas 21000, minimum needed 21000" for a simple transfer and assumes the comparison is broken, when in fact the pool wants 23334. Compute the threshold once and report it in the error. --- core/txpool/validation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/txpool/validation.go b/core/txpool/validation.go index 1b65d0c80f..284fc062fc 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -134,8 +134,8 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types // We require transactions to pay for 110% of intrinsic gas in order to // prevent situations where a change in gas limit invalidates a lot // of transactions in the txpool - if tx.Gas() < (intrGas.RegularGas*10)/9 { - return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas.RegularGas) + if minGas := (intrGas.RegularGas * 10) / 9; tx.Gas() < minGas { + return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), minGas) } } if tx.Gas() < intrGas.RegularGas {