Skip to content

Commit a72e56e

Browse files
minh-bqjakub-freebit
authored andcommitted
core/txpool: use the cached address in ValidateTransactionWithState (ethereum#30208)
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.
1 parent 5415166 commit a72e56e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/txpool/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ type ValidationOptionsWithState struct {
201201
// rules without duplicating code and running the risk of missed updates.
202202
func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, opts *ValidationOptionsWithState) error {
203203
// Ensure the transaction adheres to nonce ordering
204-
from, err := signer.Sender(tx) // already validated (and cached), but cleaner to check
204+
from, err := types.Sender(signer, tx) // already validated (and cached), but cleaner to check
205205
if err != nil {
206206
log.Error("Transaction sender recovery failed", "err", err)
207207
return err

0 commit comments

Comments
 (0)