Skip to content

Commit

Permalink
core/txpool: improve error responses with wrapped errors (ethereum#30715
Browse files Browse the repository at this point in the history
)
  • Loading branch information
piersy authored Nov 4, 2024
1 parent 6e1fedb commit 484f0f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (p *TxPool) Add(txs []*types.Transaction, local bool, sync bool) []error {
for i, split := range splits {
// If the transaction was rejected by all subpools, mark it unsupported
if split == -1 {
errs[i] = core.ErrTxTypeNotSupported
errs[i] = fmt.Errorf("%w: received type %d", core.ErrTxTypeNotSupported, txs[i].Type())
continue
}
// Find which subpool handled it and pull in the corresponding error
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
}
// Make sure the transaction is signed properly
if _, err := types.Sender(signer, tx); err != nil {
return ErrInvalidSender
return fmt.Errorf("%w: %v", ErrInvalidSender, err)
}
// Ensure the transaction has more gas than the bare minimum needed to cover
// the transaction metadata
Expand Down

0 comments on commit 484f0f4

Please sign in to comment.