From 27f0efeba127378eca689f740ec644e4552e6059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Mon, 19 May 2025 10:24:42 +0200 Subject: [PATCH] add new error --- core/txpool/errors.go | 4 ++++ core/txpool/validation.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/txpool/errors.go b/core/txpool/errors.go index 968c9d9542..9bc435d67e 100644 --- a/core/txpool/errors.go +++ b/core/txpool/errors.go @@ -58,6 +58,10 @@ var ( // making the transaction invalid, rather a DOS protection. ErrOversizedData = errors.New("oversized data") + // ErrTxBlobLimitExceeded is returned if a transaction would exceed the number + // of blobs allowed by blobpool. + ErrTxBlobLimitExceeded = errors.New("transaction blob limit exceeded") + // ErrAlreadyReserved is returned if the sender address has a pending transaction // in a different subpool. For example, this error is returned in response to any // input transaction of non-blob type when a blob transaction from this sender diff --git a/core/txpool/validation.go b/core/txpool/validation.go index 5321164418..720d0d3b72 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -65,7 +65,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types return fmt.Errorf("%w: tx type %v not supported by this pool", core.ErrTxTypeNotSupported, tx.Type()) } if blobCount := len(tx.BlobHashes()); blobCount > opts.MaxBlobCount { - return fmt.Errorf("too many blobs in transaction: have %d, permitted %d", blobCount, opts.MaxBlobCount) + return fmt.Errorf("%w: blob count %v, limit %v", ErrTxBlobLimitExceeded, blobCount, opts.MaxBlobCount) } // Before performing any expensive validations, sanity check that the tx is // smaller than the maximum limit the pool can meaningfully handle