diff --git a/core/types/access_list_tx.go b/core/types/access_list_tx.go index ab875d29155..946cf34b4dc 100644 --- a/core/types/access_list_tx.go +++ b/core/types/access_list_tx.go @@ -516,7 +516,10 @@ func (tx *AccessListTx) cashedSender() (sender libcommon.Address, ok bool) { } func (tx *AccessListTx) Sender(signer Signer) (libcommon.Address, error) { if sc := tx.from.Load(); sc != nil { - return sc.(libcommon.Address), nil + zeroAddr := libcommon.Address{} + if sc.(libcommon.Address) != zeroAddr { // Sender address can never be zero in a transaction with a valid signer + return sc.(libcommon.Address), nil + } } addr, err := signer.Sender(tx) if err != nil { diff --git a/core/types/blob_tx.go b/core/types/blob_tx.go index 8ebb18444a6..25e8c072f62 100644 --- a/core/types/blob_tx.go +++ b/core/types/blob_tx.go @@ -106,7 +106,10 @@ func (stx *BlobTx) cashedSender() (sender libcommon.Address, ok bool) { func (stx *BlobTx) Sender(signer Signer) (libcommon.Address, error) { if sc := stx.from.Load(); sc != nil { - return sc.(libcommon.Address), nil + zeroAddr := libcommon.Address{} + if sc.(libcommon.Address) != zeroAddr { // Sender address can never be zero in a transaction with a valid signer + return sc.(libcommon.Address), nil + } } addr, err := signer.Sender(stx) if err != nil { diff --git a/core/types/dynamic_fee_tx.go b/core/types/dynamic_fee_tx.go index 2a0200c5ffe..72bb9182218 100644 --- a/core/types/dynamic_fee_tx.go +++ b/core/types/dynamic_fee_tx.go @@ -438,7 +438,10 @@ func (tx *DynamicFeeTransaction) cashedSender() (sender libcommon.Address, ok bo } func (tx *DynamicFeeTransaction) Sender(signer Signer) (libcommon.Address, error) { if sc := tx.from.Load(); sc != nil { - return sc.(libcommon.Address), nil + zeroAddr := libcommon.Address{} + if sc.(libcommon.Address) != zeroAddr { // Sender address can never be zero in a transaction with a valid signer + return sc.(libcommon.Address), nil + } } addr, err := signer.Sender(tx) if err != nil { diff --git a/core/types/legacy_tx.go b/core/types/legacy_tx.go index 30258aa00a7..d6d86f22b89 100644 --- a/core/types/legacy_tx.go +++ b/core/types/legacy_tx.go @@ -443,7 +443,10 @@ func (tx *LegacyTx) cashedSender() (sender libcommon.Address, ok bool) { } func (tx *LegacyTx) Sender(signer Signer) (libcommon.Address, error) { if sc := tx.from.Load(); sc != nil { - return sc.(libcommon.Address), nil + zeroAddr := libcommon.Address{} + if sc.(libcommon.Address) != zeroAddr { // Sender address can never be zero in a transaction with a valid signer + return sc.(libcommon.Address), nil + } } addr, err := signer.Sender(tx) if err != nil {