Skip to content
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

Fix findNetworkClientIdByChainId to consider default endpoints #5344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcmire
Copy link
Contributor

@mcmire mcmire commented Feb 14, 2025

Explanation

Currently, the findNetworkClientIdByChainId method in NetworkController, which is used in various places, mostly commonly TransactionController and the wallet middleware, returns the network client ID corresponding to the first listed RPC endpoint for the given chain. This may not match users' expectations if they have chosen another RPC endpoint as the default. This commit fixes the implementation of findNetworkClientIdByChainId to match this expectation.

References

Fixes #3686.

Changelog

(Updated in changelog.)

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 highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Currently, the `findNetworkClientIdByChainId` method in
`NetworkController`, which is used in various places, mostly commonly
TransactionController and the wallet middleware, returns the network
client ID corresponding to the first listed RPC endpoint for the given
chain. This may not match users' expectations if they have chosen
another RPC endpoint as the default. This commit fixes the
implementation of `findNetworkClientIdByChainId` to match this
expectation.
@mcmire mcmire force-pushed the fix-find-network-client-id-by-chain-id branch from de00c01 to 8370668 Compare February 14, 2025 20:37
@mcmire mcmire marked this pull request as ready for review February 14, 2025 20:44
@mcmire mcmire requested review from a team as code owners February 14, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant