add new error

This commit is contained in:
Péter Garamvölgyi 2025-05-19 10:24:42 +02:00
parent 1ff38dcf29
commit 27f0efeba1
No known key found for this signature in database
GPG key ID: 7FC8D069F7199070
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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