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) (#14097)

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.

Cherry pick #14093
  • Loading branch information
somnathb1 authored Mar 7, 2025
1 parent 7618196 commit 06ccbb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erigon-lib/txpool/txpoolcfg/txpoolcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ func (r DiscardReason) String() string {
return "EIP-7702 transactions with an empty authorization list are invalid"
case ErrAuthorityReserved:
return "authority already reserved"
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"
default:
panic(fmt.Sprintf("discard reason: %d", r))
}
Expand Down

0 comments on commit 06ccbb3

Please sign in to comment.