-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: update sei fallback rpc and default visibility #22450
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
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Network Configuration Desync Creates Inconsistent State
The Sei network configuration (0x531) was removed from NetworkController.networkConfigurationsByChainId, but the corresponding entry "0x531": true remains in NetworkEnablementController.enabledNetworkMap.eip155. This creates an inconsistent test state where a network is marked as enabled but doesn't exist in the network configurations, potentially causing tests to fail or pass incorrectly.
app/util/test/initial-background-state.json#L120-L130
metamask-mobile/app/util/test/initial-background-state.json
Lines 120 to 130 in 369feac
| "name": "BNB Chain", | |
| "nativeCurrency": "BNB", | |
| "rpcEndpoints": [ | |
| { | |
| "failoverUrls": [], | |
| "networkClientId": "bsc-mainnet", | |
| "type": "infura", | |
| "url": "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | |
| } | |
| ] | |
| }, |
Bug: Orphaned Preferences: Network Configuration Mismatch
The Sei network configuration (0x531) was removed from NetworkController.networkConfigurationsByChainId, but PreferencesController.showIncomingTransactions still contains "0x531": true. This creates an inconsistent test state where incoming transactions are enabled for a network that doesn't exist in the network configurations.
app/util/test/initial-background-state.json#L120-L130
metamask-mobile/app/util/test/initial-background-state.json
Lines 120 to 130 in 369feac
| "name": "BNB Chain", | |
| "nativeCurrency": "BNB", | |
| "rpcEndpoints": [ | |
| { | |
| "failoverUrls": [], | |
| "networkClientId": "bsc-mainnet", | |
| "type": "infura", | |
| "url": "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | |
| } | |
| ] | |
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Phantom Network: Enabled But Configuration Gone.
The Sei network (0x531) is removed from NetworkController.networkConfigurationsByChainId but remains enabled in NetworkEnablementController.enabledNetworkMap.eip155. This creates an inconsistent state where the enablement controller indicates Sei is enabled but no network configuration exists for it, potentially causing runtime errors when code tries to access the missing Sei configuration.
app/util/test/initial-background-state.json#L120-L130
metamask-mobile/app/util/test/initial-background-state.json
Lines 120 to 130 in d8c9441
| "name": "BNB Chain", | |
| "nativeCurrency": "BNB", | |
| "rpcEndpoints": [ | |
| { | |
| "failoverUrls": [], | |
| "networkClientId": "bsc-mainnet", | |
| "type": "infura", | |
| "url": "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | |
| } | |
| ] | |
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Phantom Network Causes Runtime Errors
Sei network (0x531) is removed from NetworkController.networkConfigurationsByChainId but remains enabled (true) in NetworkEnablementController.enabledNetworkMap.eip155. This creates an inconsistency where the enablement controller references a network that doesn't exist in the network configurations for new users, potentially causing runtime errors when the app tries to access the enabled but non-existent network.
app/util/test/initial-background-state.json#L120-L130
metamask-mobile/app/util/test/initial-background-state.json
Lines 120 to 130 in 62ef7c8
| "name": "BNB Chain", | |
| "nativeCurrency": "BNB", | |
| "rpcEndpoints": [ | |
| { | |
| "failoverUrls": [], | |
| "networkClientId": "bsc-mainnet", | |
| "type": "infura", | |
| "url": "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | |
| } | |
| ] | |
| }, |
ef5b057 to
0475a5e
Compare
|
pls fix the broken unit test |
| ) | ||
| ) | ||
| ) { | ||
| return state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should capture exceptions if the state is not structured as expected, and that means a bug on the user data structure.
If you can, please visit other migrations to see how this is handled or our migration guidelines
|
|
||
| // Remove Sei from initial state so it appears in Additional Networks section | ||
| // Users can add it manually, and it will be available in FEATURED_RPCS | ||
| delete initialNetworkControllerState.networkConfigurationsByChainId[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not understanding the need od this delete, shouldnt this be handled by the migration?
|



Description
This change removes Sei from the default preloaded networks so that it no longer appears as a default entry in the networks list.
Instead, it will now be displayed under Additional Networks, allowing users to manually add it if needed.
Additionally, this update introduces a fallback RPC for Sei (QUICKNODE_SEI_URL) in customNetworks.tsx, ensuring improved redundancy and reliability when Infura is unavailable.
Changelog
CHANGELOG entry: removed Sei from default networks and added QuickNode fallback RPC.
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Removes Sei from default networks and adds a QuickNode fallback RPC, including a migration to populate failoverUrls and associated test/snapshot updates.
sei-mainnetfrom defaultNetworkControllerstate so it appears under Additional Networks (app/core/Engine/controllers/network-controller-init.ts).sei-mainnetand use it asfailoverRpcUrlsinPopularList(app/util/networks/customNetworks.tsx).migration107to appendfailoverUrlsto SEI RPC endpoints when missing, guarded byQUICKNODE_SEI_URL(app/store/migrations/107.ts, wired inapp/store/migrations/index.ts).app/store/migrations/107.test.ts).Seifrom EVM list (app/components/Views/AddressSelector/*).QUICKNODE_SEI_URLin utils tests (app/core/Engine/controllers/network-controller/utils.test.ts).app/util/logs/__snapshots__/index.test.ts.snap,app/util/test/initial-background-state.json).Written by Cursor Bugbot for commit 27c61df. This will update automatically on new commits. Configure here.