Skip to content

Commit 5de5f33

Browse files
piersyholiman
authored andcommitted
core/txpool: improve error responses with wrapped errors (#30715)
1 parent 3adb076 commit 5de5f33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/txpool/txpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (p *TxPool) Add(txs []*types.Transaction, local bool, sync bool) []error {
358358
for i, split := range splits {
359359
// If the transaction was rejected by all subpools, mark it unsupported
360360
if split == -1 {
361-
errs[i] = core.ErrTxTypeNotSupported
361+
errs[i] = fmt.Errorf("%w: received type %d", core.ErrTxTypeNotSupported, txs[i].Type())
362362
continue
363363
}
364364
// Find which subpool handled it and pull in the corresponding error

core/txpool/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
9999
}
100100
// Make sure the transaction is signed properly
101101
if _, err := types.Sender(signer, tx); err != nil {
102-
return ErrInvalidSender
102+
return fmt.Errorf("%w: %v", ErrInvalidSender, err)
103103
}
104104
// Ensure the transaction has more gas than the bare minimum needed to cover
105105
// the transaction metadata

0 commit comments

Comments
 (0)