fix: handle EIP-4844 transactions in underpriced check#19
Closed
fix: handle EIP-4844 transactions in underpriced check#19
Conversation
Collaborator
🟡 Heimdall Review Status
|
Collaborator
|
Thanks for the PR, we don't currently support EIP-4844 transactions, so this case should never happen (we're also going to delete this code soon). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Previously, the is_underpriced function within the mempool-rebroadcaster crate did not explicitly account for EIP-4844 (Blob) transactions. As a result, any EIP-4844 transactions encountered were incorrectly categorized by the default _ match arm as "unknown transaction type" and subsequently treated as underpriced. This led to these transactions being filtered out from the mempool, preventing their proper rebroadcasting.
Solution
This Pull Request addresses the issue by updating the is_underpriced function in rebroadcaster.rs to correctly identify and process EIP-4844 transactions. The changes include:
Importing EIP4844_TX_TYPE_ID: The alloy_eips::eip2718 module now explicitly imports EIP4844_TX_TYPE_ID.
Updating is_underpriced logic: The EIP1559_TX_TYPE_ID match arm has been extended to include EIP4844_TX_TYPE_ID. This ensures that EIP-4844 transactions are evaluated based on their max_fee_per_gas against the base_fee, aligning their handling with other EIP-1559-like transactions.
Impact
This fix ensures that EIP-4844 transactions are no longer erroneously filtered out due to incorrect pricing assessment. By properly handling these transaction types, the mempool-rebroadcaster will maintain a more accurate representation of the mempool contents and facilitate the correct rebroadcasting of all supported transaction types, including Blob transactions.
Testing
Existing unit and end-to-end tests for the mempool-rebroadcaster crate were executed and passed successfully after applying this fix, confirming that the changes do not introduce regressions and the intended behavior for EIP-4844 transactions is now correctly implemented.
Branch: fix/handle-eip4844-txns