From 7d3e73951f957beddb46fedf106dca34b000cc96 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 17 Mar 2026 13:47:27 +0800 Subject: [PATCH] perf(core/txpool): use the cached address in ValidateTransactionWithState #30208 (#2166) The address recover is executed and cached in ValidateTransaction already. It's expected that the cached one is returned in ValidateTransaction. However, currently, we use the wrong function signer.Sender instead of types.Sender which will do all the address recover again. Co-authored-by: minh-bq <97180373+minh-bq@users.noreply.github.com> --- core/txpool/validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/txpool/validation.go b/core/txpool/validation.go index 71d307d977..673fb0f60b 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -177,7 +177,7 @@ type ValidationOptionsWithState struct { // rules without duplicating code and running the risk of missed updates. func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, opts *ValidationOptionsWithState) error { // Ensure the transaction adheres to nonce ordering - from, err := signer.Sender(tx) // already validated (and cached), but cleaner to check + from, err := types.Sender(signer, tx) // already validated (and cached), but cleaner to check if err != nil { log.Error("Transaction sender recovery failed", "err", err) return err