From 5b0e2e4bf0be2555e0fd0a67c9808a5555e500ea Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 17 Mar 2026 13:46:44 +0800 Subject: [PATCH] fix(core/txpool): clarify tx validation error messages #29081 (#2163) Adjust txpool validation error wording to report actual and minimum values consistently. - intrinsic gas error now reports: gas , minimum needed - underpriced tip error now reports: gas tip cap , minimum needed No transaction validation logic is changed in this commit; only error message text is updated. --- core/txpool/validation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/txpool/validation.go b/core/txpool/validation.go index 496aea5dd0..71d307d977 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -100,7 +100,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types // Skip further validation for special transactions if tx.IsSpecialTransaction() { if opts.NotSigner(from) { - return fmt.Errorf("%w: tip needed %v, tip permitted %v", ErrUnderpriced, opts.MinTip, tx.GasTipCap()) + return fmt.Errorf("%w: gas tip cap %v, minimum needed %v", ErrUnderpriced, tx.GasTipCap(), opts.MinTip) } return nil } @@ -115,7 +115,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types return err } if tx.Gas() < intrGas { - return fmt.Errorf("%w: needed %v, allowed %v", core.ErrIntrinsicGas, intrGas, tx.Gas()) + return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas) } // Ensure the transaction can cover floor data gas. if rules.IsPrague { @@ -129,7 +129,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types } // Ensure the gas price is high enough to cover the requirement of the calling pool if tx.GasTipCapIntCmp(opts.MinTip) < 0 { - return fmt.Errorf("%w: tip needed %v, tip permitted %v", ErrUnderpriced, opts.MinTip, tx.GasTipCap()) + return fmt.Errorf("%w: gas tip cap %v, minimum needed %v", ErrUnderpriced, tx.GasTipCap(), opts.MinTip) } if tx.Type() == types.SetCodeTxType { if len(tx.SetCodeAuthorizations()) == 0 {