core/txpool/legacypool: use types.Sender instead of signer.Sender (#34059)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run

`pool.signer.Sender(tx)` bypasses the sender cache used by types.Sender,
which can force an extra signature recovery for every promotable tx
(promotion runs frequently). Use `types.Sender(pool.signer, tx)` here to
keep sender derivation cached and consistent.
This commit is contained in:
Daniel Liu 2026-03-28 18:46:09 +08:00 committed by GitHub
parent bd3c8431d9
commit d1369b69f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1404,7 +1404,7 @@ func (pool *LegacyPool) promoteExecutables(accounts []common.Address) []*types.T
// promote all promotable transactions
promoted := make([]*types.Transaction, 0, len(promotable))
for _, tx := range promotable {
from, _ := pool.signer.Sender(tx)
from, _ := types.Sender(pool.signer, tx) // already validated
if pool.promoteTx(from, tx.Hash(), tx) {
promoted = append(promoted, tx)
}