From dc82ad221995d4c05895bf5dea64656ddf432ba0 Mon Sep 17 00:00:00 2001 From: Somnath Date: Thu, 6 Mar 2025 14:16:35 +0400 Subject: [PATCH] txpool: add more cases to return err instead of panicking on invalid 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. --- txnprovider/txpool/txpoolcfg/txpoolcfg.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/txnprovider/txpool/txpoolcfg/txpoolcfg.go b/txnprovider/txpool/txpoolcfg/txpoolcfg.go index 5e3894b91bf..a74134ceb93 100644 --- a/txnprovider/txpool/txpoolcfg/txpoolcfg.go +++ b/txnprovider/txpool/txpoolcfg/txpoolcfg.go @@ -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)) }