feat(transaction-controller): add EIP-4844 blob transaction type (0x03)#8366
Open
skyc1e wants to merge 2 commits intoMetaMask:mainfrom
Open
feat(transaction-controller): add EIP-4844 blob transaction type (0x03)#8366skyc1e wants to merge 2 commits intoMetaMask:mainfrom
skyc1e wants to merge 2 commits intoMetaMask:mainfrom
Conversation
Add `blob = '0x3'` to the `TransactionEnvelopeType` enum so that EIP-4844 blob-carrying transactions are no longer rejected by validation. Blob transactions use EIP-1559 fee market parameters, so the type is also added to `TRANSACTION_ENVELOPE_TYPES_FEE_MARKET`. Closes MetaMask#8331
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.
Summary
Closes #8331.
EIP-4844 blob transactions (type
0x03) are currently rejected byvalidateTxParamswith:This PR adds
blob = "0x3"to theTransactionEnvelopeTypeenum and includes it inTRANSACTION_ENVELOPE_TYPES_FEE_MARKET(blob transactions use EIP-1559 fee market parameters —maxFeePerGas/maxPriorityFeePerGas— plus an additionalmaxFeePerBlobGasfield).Changes
packages/transaction-controller/src/types.ts— addblob = "0x3"toTransactionEnvelopeTypewith JSDoc referencing EIP-4844packages/transaction-controller/src/utils/validation.ts— addTransactionEnvelopeType.blobtoTRANSACTION_ENVELOPE_TYPES_FEE_MARKETpackages/transaction-controller/src/utils/validation.test.ts— update "unknown type" test from0x3to0x5and fix expected error messageChangelog
@metamask/transaction-controllerAdded
blob(0x03) to theTransactionEnvelopeTypeenum to support EIP-4844 blob-carrying transactions (#8331)Manual testing steps
type: "0x3"validateTxParams— it should no longer throwyarn testinpackages/transaction-controllerNote
Medium Risk
Touches transaction parameter validation to allow a new envelope type (
0x3), which could change which transactions are accepted and how gas fields are interpreted. Risk is moderate because blob-specific fields (e.g.,maxFeePerBlobGas) are not validated here, so downstream handling must be correct.Overview
Adds support for EIP-4844 blob transactions by introducing
TransactionEnvelopeType.blob = '0x3'and treating it as a fee-market envelope alongside0x2/0x4for gas-field validation.Updates the validation test to ensure truly unknown envelope types still throw, and refreshes the expected error message to include
0x3in the allowed set.Written by Cursor Bugbot for commit 1723364. This will update automatically on new commits. Configure here.