diff --git a/core/types/transaction.go b/core/types/transaction.go index 6af960b8c3..e8a408e0d5 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/holiman/uint256" ) @@ -524,13 +525,17 @@ func (tx *Transaction) SetCodeAuthorities() []common.Address { auths = make([]common.Address, 0, len(setcodetx.AuthList)) ) for _, auth := range setcodetx.AuthList { - if addr, err := auth.Authority(); err == nil { - if marks[addr] { - continue - } - marks[addr] = true - auths = append(auths, addr) + addr, err := auth.Authority() + if err != nil { + log.Error("SetCodeTx authorization has invalid signature", "tx", tx.Hash(), "address", addr, "err", err) + continue } + if marks[addr] { + log.Warn("SetCodeTx authorization has duplicate authority", "tx", tx.Hash(), "address", addr) + continue + } + marks[addr] = true + auths = append(auths, addr) } return auths } diff --git a/core/types/tx_setcode.go b/core/types/tx_setcode.go index 9487c9cc81..11c2e8c534 100644 --- a/core/types/tx_setcode.go +++ b/core/types/tx_setcode.go @@ -117,7 +117,7 @@ func (a *SetCodeAuthorization) SigHash() common.Hash { }) } -// Authority recovers the the authorizing account of an authorization. +// Authority recovers the authorizing account of an authorization. func (a *SetCodeAuthorization) Authority() (common.Address, error) { sighash := a.SigHash() if !crypto.ValidateSignatureValues(a.V, a.R.ToBig(), a.S.ToBig(), true) {