Skip to content

feat(blobpool): add explicit max blob count limit #31837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Thegaram
Copy link
Contributor

Fixes #31792.

Verified

This commit was signed with the committer’s verified signature.
Thegaram Péter Garamvölgyi
@Thegaram Thegaram requested a review from rjl493456442 as a code owner May 16, 2025 07:18
@@ -63,6 +64,9 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
if opts.Accept&(1<<tx.Type()) == 0 {
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define a specific error type for this case, as it will make error classification and management easier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we do have the blob count validation https://github.com/ethereum/go-ethereum/pull/31837/files#diff-46644e723f975bf890676f7e1b5d5814b6d3137cd4c9ba9fed13a28b52f0e93bR155, please remove the newly added one and modify that instead.

Copy link
Contributor Author

@Thegaram Thegaram May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did consider that existing validation. I added a new one for two reasons:

  1. The existing check is for MaxBlobsPerBlock (a protocol limit), while this one is a local blobpool limit.

    Theoretically these are two different limits and it's not guaranteed which is larger. Though it's true, after Pectra the new check will always be more strict (7 < 9) -- so maybe we can remove the MaxBlobsPerBlock check, but that might break some tests.

  2. For the new check to be effective, we need to add it before the opts.MaxSize check, or increase the max tx size limit.

Let me know how you want to proceed.

Thegaram added 3 commits May 19, 2025 10:22

Verified

This commit was signed with the committer’s verified signature.
Thegaram Péter Garamvölgyi

Verified

This commit was signed with the committer’s verified signature.
Thegaram Péter Garamvölgyi

Verified

This commit was signed with the committer’s verified signature.
Thegaram Péter Garamvölgyi
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MariusVanDerWijden MariusVanDerWijden merged commit 20ad4f5 into ethereum:master May 22, 2025
3 of 4 checks passed
@MariusVanDerWijden MariusVanDerWijden added this to the 1.15.12 milestone May 22, 2025
@Thegaram Thegaram deleted the feat-add-blobpool-blob-count-limit branch May 22, 2025 09:31
Dargon789 pushed a commit to Dargon789/go-ethereum that referenced this pull request May 27, 2025

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Fixes ethereum#31792.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blobpool: proper error message for blob transactions with too many blobs
4 participants