Skip to content

core/txpool: add 7702 protection to blobpool #31526

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
merged 5 commits into from
Apr 8, 2025

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Mar 30, 2025

This pull request introduces two constraints in the blobPool:

(a) If the sender has a pending authorization or delegation, only one in-flight
executable transaction can be cached.
(b) If the authority address in a SetCode transaction is already reserved by
the blobPool, the transaction will be rejected.

These constraints mitigate an attack where an attacker spams the pool with
numerous blob transactions, evicts other transactions, and then cancels all
pending blob transactions by draining the sender’s funds if they have a delegation.

Note, because there is no exclusive lock held between different subpools
when processing transactions, it's totally possible the SetCode transaction
and blob transactions with conflict sender and authorities are accepted
simultaneously. I think it's acceptable as it's very hard to be exploited.

@rjl493456442 rjl493456442 requested a review from holiman as a code owner March 30, 2025 01:38
@ethereum ethereum deleted a comment from irajsavadloo Apr 1, 2025
@ethereum ethereum deleted a comment from irajsavadloo Apr 1, 2025
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.

This approach LGTM. I see how you mean that it is a bit weird exposing the HasPendingAuth. One nice benefit of the way you've done this is that we don't need to additionally track all the auths using the reserver. This was my original approach and it ended up being quite tricky reserving and unreserving the authorities, so this minimizes the surface for issues there. Additionally, since we want to still allow 1 in-flight tx in the blob pool from accounts with pending delegations to avoid a deadlock in the account, it is going to be necessary to expose some legacy pool details to the blob pool.

@rjl493456442
Copy link
Member Author

@lightclient Please take another look

lightclient
lightclient previously approved these changes Apr 8, 2025
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 - I made a small change on the Reserver so that it will not require each use of Hold and Release to also include the pool name. Please take a look at it and the naming and let me know if you think it's okay.

@lightclient lightclient added this to the 1.15.8 milestone Apr 8, 2025
@rjl493456442
Copy link
Member Author

LGTM @lightclient !

@lightclient lightclient merged commit 2e739fc into ethereum:master Apr 8, 2025
3 of 4 checks passed
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.

None yet

2 participants