Skip to content

Conversation

@dan437
Copy link
Contributor

@dan437 dan437 commented Nov 11, 2025

Explanation

The fix ensures that when a network switch happens and a transaction immediately follows, the EIP-1559 compatibility is correctly determined rather than returning undefined, which would cause transaction validation to fail.

Disclaimer: I'm not familiar with the network controller, this PR is just a draft for the team that owns the network controller.

References

Fixes MetaMask/metamask-extension#37570

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

When EIP-1559 compatibility is not cached in metadata, compute it on demand, cache the result, and add tests covering both compatible and incompatible cases.

  • Network Controller
    • get1559CompatibilityWithNetworkClientId: If EIPS[1559] is undefined, determine compatibility via #determineEIP1559Compatibility, cache it in networksMetadata[networkClientId].EIPS[1559], and return the value; otherwise return the cached value.
  • Tests
    • Add tests verifying on-demand determination and caching of EIP-1559 compatibility when EIPS[1559] is initially undefined for both compatible (true) and incompatible (false) scenarios.

Written by Cursor Bugbot for commit 453379f. This will update automatically on new commits. Configure here.

@dan437 dan437 requested review from a team as code owners November 11, 2025 10:19
@dan437 dan437 marked this pull request as draft November 11, 2025 10:20
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.

[Bug]: Invalid transaction params Error after switching account and network (EIP-1559 mismatch)

2 participants