From b96310ebe7315c7dd9446cf48309bcb662ecffde Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Thu, 21 Aug 2025 13:43:52 +0800 Subject: [PATCH] ethclient: fix tx sender cache miss detection #23877 (#1366) --- ethclient/ethclient.go | 2 ++ ethclient/signer.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index bd5f3e4188..a61bf94a67 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -246,6 +246,8 @@ func (ec *Client) TransactionSender(ctx context.Context, tx *types.Transaction, if err == nil { return sender, nil } + + // It was not found in cache, ask the server. var meta struct { Hash common.Hash From common.Address diff --git a/ethclient/signer.go b/ethclient/signer.go index 1db03a9c95..cd82a6aca0 100644 --- a/ethclient/signer.go +++ b/ethclient/signer.go @@ -45,7 +45,7 @@ func (s *senderFromServer) Equal(other types.Signer) bool { } func (s *senderFromServer) Sender(tx *types.Transaction) (common.Address, error) { - if s.blockhash == (common.Hash{}) { + if s.addr == (common.Address{}) { return common.Address{}, errNotCached } return s.addr, nil