Skip to content

Assume networks support EIP-1559 and don't trust them if they don't - #11945

Draft
mcmire wants to merge 1 commit into
mainfrom
fix-eip-1559-support-bug
Draft

mcmire wants to merge 1 commit into
mainfrom
fix-eip-1559-support-bug

Conversation

@mcmire

@mcmire mcmire commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Explanation

Some users are unable to send transactions, receiving a "current network does not support EIP-1559" error on chains that in fact do support EIP-1559.

When preparing a transaction for submission, TransactionController will ask NetworkController whether the transaction's chain supports EIP-1559. If it has not already done so, NetworkController will then fetch the latest block and look for the presence of a baseFeePerGas field. TransactionController then uses the result to 1) validate the transaction data relative to its type, 2) fill in the type of the transaction if it's missing, and 3) determine the estimated gas fees for that transaction.

There are therefore two possible causes for the aforementioned bug:

  • The request for the latest block fails (and continues to fail), so NetworkController is unable to determine whether a chain supports EIP-1559, leaving the status of that chain as unknown. Then, TransactionController re-interprets that status as false. As a result, transactions with EIP-1559 fees are rejected before any confirmation is shown, and transactions without a type are quietly downgraded to legacy (0x1).
  • The latest block, when requested, is mysteriously missing a baseFeePerGas field. NetworkController then captures the status in state as false. Because the EIP-1559 status of a chain is "sticky" — once set it is never updated again — this causes transactions to be broken until the user uninstalls and reinstalls MetaMask.

Taking the position that every chain really ought to support EIP-1559 by now, this commit makes two related changes:

  1. If the latest block of a chain doesn't have baseFeePerGas, NetworkController will still record the chain as lacking EIP-1559 support, but this value will get cleared from state the next time NetworkController is initialized. This effectively means the next time the user restarts their wallet, the controller will check again (in case the chain really does support EIP-1559).
  2. If NetworkController is unable to determine whether a chain supports EIP-1559, TransactionController will act as though it does, defaulting the transaction type to 0x2 and estimating gas fees using EIP-1559 limits. (If the chain doesn't really have support, then it should reject the transaction.)

References

(Will add a ticket)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Some users are unable to send transactions, receiving a "current network
does not support EIP-1559" error on chains that in fact *do* support
EIP-1559.

When preparing a transaction for submission, TransactionController will
ask NetworkController whether the transaction's chain supports EIP-1559.
If it has not already done so, NetworkController will then fetch the
latest block and look for the presence of a `baseFeePerGas` field.
TransactionController then uses the result to 1) validate the
transaction data relative to its type, 2) fill in the type of the
transaction if it's missing, and 3) determine the estimated gas fees for
that transaction.

There are therefore two possible causes for the aforementioned bug:

A. The request for the latest block fails (and continues to fail),
   so NetworkController is unable to determine whether a chain supports
   EIP-1559, leaving the status of that chain as unknown. Then,
   TransactionController re-interprets that status as `false`. As a
   result, transactions with EIP-1559 fees are rejected before any
   confirmation is shown, and transactions without a type are quietly
   downgraded to legacy (0x1).
B. The latest block, when requested, is mysteriously missing a
  `baseFeePerGas` field. NetworkController then captures the status in
  state as `false`. Because the EIP-1559 status of a chain is "sticky" —
  once set it is never updated again — this causes transactions to be
  broken until the user uninstalls and reinstalls MetaMask.

Taking the position that every chain really ought to support EIP-1559 by
now, this commit makes two related changes:

1. If the latest block of a chain doesn't have `baseFeePerGas`,
   NetworkController will still record the chain as lacking EIP-1559
   support, but this value will get cleared from state the next time
   NetworkController is initialized. This effectively means the next time
   the user restarts their wallet, the controller will check again (in
   case the chain really *does* support EIP-1559).
2. If NetworkController is unable to determine whether a chain supports
   EIP-1559, TransactionController will act as though it does,
   defaulting the transaction type to 0x2 and estimating gas fees using
   EIP-1559 limits. (If the chain doesn't *really* have support, then it
   should reject the transaction.)
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🛑 Files requiring codeowner review

To merge this PR, you'll need to get approvals from the following owner groups.

(Note: For files with multiple owners, approval from one owner is sufficient.)

@MetaMask/confirmations (3 files)
  • packages/transaction-controller/CHANGELOG.md
  • packages/transaction-controller/src/lifecycle/init.test.ts
  • packages/transaction-controller/src/lifecycle/init.ts
@MetaMask/core-platform or @MetaMask/metamask-assets or @MetaMask/networks (4 files)
  • packages/network-controller/CHANGELOG.md
  • packages/network-controller/src/NetworkController-method-action-types.ts
  • packages/network-controller/src/NetworkController.ts
  • packages/network-controller/tests/NetworkController.test.ts

ℹ️ Files co-owned by @MetaMask/core-platform

For convenience in maintaining this repo, this team co-owns the following files and thus may approve changes to them.

(Expand to view list of files)
  • packages/transaction-controller/CHANGELOG.md

This branch has not been deployed

No deployments
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.

1 participant