Skip to content

Commit

Permalink
txpool: add more cases to return err instead of panicking on invalid …
Browse files Browse the repository at this point in the history
…Txn cases (#14093)

This pull request includes updates to the `DiscardReason` function to
handle additional discard reasons for transactions. The most important
changes include adding new cases for different types of transaction
validation errors.
  • Loading branch information
somnathb1 committed Mar 6, 2025
1 parent 9e416fb commit dc82ad2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions txnprovider/txpool/txpoolcfg/txpoolcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ func (r DiscardReason) String() string {
return "blobs limit in txpool is full"
case NoAuthorizations:
return "EIP-7702 transactions with an empty authorization list are invalid"
case GasLimitTooHigh:
return "gas limit is too high"
case BlobHashCheckFail:
return "KZGcommitment's versioned hash has to be equal to blob_versioned_hash at the same index"
case UnmatchedBlobTxExt:
return "KZGcommitments must match the corresponding blobs and proofs"
case UnequalBlobTxExt:
return "blob_versioned_hashes, blobs, commitments and proofs must have equal number"
case ErrAuthorityReserved:
return "EIP-7702 transaction with authority already reserved"
default:
panic(fmt.Sprintf("discard reason: %d", r))
}
Expand Down

0 comments on commit dc82ad2

Please sign in to comment.