From 4da11398a460e53ce8f4dbbb566c98b948f8a067 Mon Sep 17 00:00:00 2001 From: Amine Harty Date: Thu, 27 Nov 2025 18:50:20 +0100 Subject: [PATCH 1/5] feat: update megaeth testnet config and add megaeth mainnet --- .../network-controller-init.test.ts | 6 +- app/scripts/migrations/184.test.ts | 265 ++++++++++++++++++ app/scripts/migrations/184.ts | 122 ++++++++ app/scripts/migrations/index.js | 1 + privacy-snapshot.json | 2 +- shared/constants/common.ts | 5 + shared/constants/network.test.ts | 1 + shared/constants/network.ts | 20 +- test/e2e/fixtures/fixture-builder.js | 2 +- test/e2e/fixtures/onboarding-fixture.json | 8 +- test/e2e/mock-e2e.js | 2 +- .../chain-id-network-chains.json | 2 +- test/e2e/tests/settings/state-logs.json | 2 +- .../hooks/useEIP7702Networks.test.ts | 10 +- 14 files changed, 428 insertions(+), 20 deletions(-) create mode 100644 app/scripts/migrations/184.test.ts create mode 100644 app/scripts/migrations/184.ts diff --git a/app/scripts/controller-init/network-controller-init.test.ts b/app/scripts/controller-init/network-controller-init.test.ts index 26ec049f5d2a..2be0fbada91c 100644 --- a/app/scripts/controller-init/network-controller-init.test.ts +++ b/app/scripts/controller-init/network-controller-init.test.ts @@ -127,11 +127,11 @@ describe('NetworkControllerInit', () => { }, ], }, - "0x18c6": { + "0x18c7": { "blockExplorerUrls": [ "https://megaexplorer.xyz", ], - "chainId": "0x18c6", + "chainId": "0x18c7", "defaultBlockExplorerUrlIndex": 0, "defaultRpcEndpointIndex": 0, "name": "Mega Testnet", @@ -141,7 +141,7 @@ describe('NetworkControllerInit', () => { "failoverUrls": [], "networkClientId": "megaeth-testnet", "type": "custom", - "url": "https://carrot.megaeth.com/rpc", + "url": "https://timothy.megaeth.com/rpc", }, ], }, diff --git a/app/scripts/migrations/184.test.ts b/app/scripts/migrations/184.test.ts new file mode 100644 index 000000000000..d8c50c4c0806 --- /dev/null +++ b/app/scripts/migrations/184.test.ts @@ -0,0 +1,265 @@ +import { migrate, version } from './184'; + +const oldVersion = 183; +const OLD_CHAIN_ID = '0x18c6'; +const NEW_CHAIN_ID = '0x18c7'; +const OLD_RPC_URL = 'https://carrot.megaeth.com/rpc'; +const NEW_RPC_URL = 'https://timothy.megaeth.com/rpc'; + +/** + * Get the old MegaETH testnet network configuration object. + * + * @returns The old MegaETH testnet network configuration object. + */ +const getOldMegaEthTestnetConfiguration = () => ({ + chainId: OLD_CHAIN_ID, + name: 'Mega Testnet', + nativeCurrency: 'MegaETH', + blockExplorerUrls: ['https://megaexplorer.xyz'], + defaultRpcEndpointIndex: 0, + defaultBlockExplorerUrlIndex: 0, + rpcEndpoints: [ + { + networkClientId: 'megaeth-testnet', + url: OLD_RPC_URL, + type: 'custom', + }, + ], +}); + +/** + * Get the new MegaETH testnet network configuration object after migration. + * + * @returns The new MegaETH testnet network configuration object. + */ +const getNewMegaEthTestnetConfiguration = () => ({ + chainId: NEW_CHAIN_ID, + name: 'Mega Testnet', + nativeCurrency: 'MegaETH', + blockExplorerUrls: ['https://megaexplorer.xyz'], + defaultRpcEndpointIndex: 0, + defaultBlockExplorerUrlIndex: 0, + rpcEndpoints: [ + { + networkClientId: 'megaeth-testnet', + url: NEW_RPC_URL, + type: 'custom', + }, + ], +}); + +describe(`migration #${version}`, () => { + it('updates the version metadata', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: {}, + }; + const newStorage = await migrate(oldStorage); + expect(newStorage.meta).toStrictEqual({ version }); + }); + + describe('NetworkController migration', () => { + it('does nothing if `NetworkController` is missing', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: {}, + }; + const newStorage = await migrate(oldStorage); + expect(newStorage.data).toStrictEqual({}); + }); + + it('does nothing if `NetworkController` is not an object', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: 'invalidData', + }, + }; + const newStorage = await migrate(oldStorage); + expect(newStorage.data).toStrictEqual(oldStorage.data); + }); + + it('does nothing if `NetworkController.networkConfigurationsByChainId` is not an object', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + networkConfigurationsByChainId: 'invalidData', + }, + }, + }; + const newStorage = await migrate(oldStorage); + expect(newStorage.data).toStrictEqual(oldStorage.data); + }); + + it('does nothing if MegaETH testnet is not configured', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + selectedNetworkClientId: 'mainnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + '0x1': { + chainId: '0x1', + rpcEndpoints: [ + { + networkClientId: 'mainnet', + url: 'https://mainnet.infura.io/v3/{infuraProjectId}', + type: 'infura', + }, + ], + defaultRpcEndpointIndex: 0, + blockExplorerUrls: ['https://etherscan.io'], + defaultBlockExplorerUrlIndex: 0, + name: 'Ethereum Mainnet', + nativeCurrency: 'ETH', + }, + }, + }, + }, + }; + + const newStorage = await migrate(oldStorage); + expect(newStorage.data).toStrictEqual(oldStorage.data); + }); + + it('migrates MegaETH testnet from old chain ID to new chain ID with new RPC URL', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + selectedNetworkClientId: 'mainnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), + }, + }, + }, + }; + + const expectedData = { + NetworkController: { + selectedNetworkClientId: 'mainnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + [NEW_CHAIN_ID]: getNewMegaEthTestnetConfiguration(), + }, + }, + }; + + const newStorage = await migrate(oldStorage); + expect(newStorage.data).toStrictEqual(expectedData); + }); + + it('updates selectedNetworkClientId if user was on MegaETH testnet', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + selectedNetworkClientId: 'megaeth-testnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), + }, + }, + }, + }; + + const newStorage = await migrate(oldStorage); + const networkController = newStorage.data.NetworkController as Record< + string, + unknown + >; + + expect(networkController.selectedNetworkClientId).toBe('megaeth-testnet'); + }); + + it('preserves custom RPC endpoints added by user but updates default one', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + selectedNetworkClientId: 'mainnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + [OLD_CHAIN_ID]: { + ...getOldMegaEthTestnetConfiguration(), + rpcEndpoints: [ + { + networkClientId: 'megaeth-testnet', + url: OLD_RPC_URL, + type: 'custom', + }, + { + networkClientId: 'custom-megaeth', + url: 'https://custom-rpc.example.com', + type: 'custom', + }, + ], + }, + }, + }, + }, + }; + + const newStorage = await migrate(oldStorage); + const networkController = newStorage.data.NetworkController as Record< + string, + unknown + >; + const networkConfigurationsByChainId = + networkController.networkConfigurationsByChainId as Record< + string, + { rpcEndpoints: Array<{ url: string; networkClientId: string }> } + >; + + // Old chain ID should be removed + expect(networkConfigurationsByChainId[OLD_CHAIN_ID]).toBeUndefined(); + + // New chain ID should exist + const newConfig = networkConfigurationsByChainId[NEW_CHAIN_ID]; + expect(newConfig).toBeDefined(); + expect(newConfig.rpcEndpoints).toHaveLength(2); + + // Default endpoint should be updated + expect(newConfig.rpcEndpoints[0].url).toBe(NEW_RPC_URL); + expect(newConfig.rpcEndpoints[0].networkClientId).toBe('megaeth-testnet'); + + // Custom endpoint should be preserved (not updated since it's not the default) + expect(newConfig.rpcEndpoints[1].url).toBe( + 'https://custom-rpc.example.com', + ); + expect(newConfig.rpcEndpoints[1].networkClientId).toBe('custom-megaeth'); + }); + + it('removes old chain ID and adds new chain ID', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: { + NetworkController: { + selectedNetworkClientId: 'mainnet', + networksMetadata: {}, + networkConfigurationsByChainId: { + [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), + }, + }, + }, + }; + + const newStorage = await migrate(oldStorage); + const networkController = newStorage.data.NetworkController as Record< + string, + unknown + >; + const networkConfigurationsByChainId = + networkController.networkConfigurationsByChainId as Record< + string, + unknown + >; + + expect(networkConfigurationsByChainId[OLD_CHAIN_ID]).toBeUndefined(); + expect(networkConfigurationsByChainId[NEW_CHAIN_ID]).toBeDefined(); + }); + }); +}); diff --git a/app/scripts/migrations/184.ts b/app/scripts/migrations/184.ts new file mode 100644 index 000000000000..93e369a71972 --- /dev/null +++ b/app/scripts/migrations/184.ts @@ -0,0 +1,122 @@ +import { hasProperty, isObject, Hex } from '@metamask/utils'; +import { cloneDeep } from 'lodash'; + +type VersionedData = { + meta: { version: number }; + data: Record; +}; + +export const version = 184; + +// MegaETH Testnet chain ID changed from 6342 to 6343 +const OLD_CHAIN_ID: Hex = '0x18c6'; // 6342 +const NEW_CHAIN_ID: Hex = '0x18c7'; // 6343 +const NEW_RPC_URL = 'https://timothy.megaeth.com/rpc'; +const NETWORK_CLIENT_ID = 'megaeth-testnet'; + +/** + * This migration updates the MegaETH Testnet network configuration + * to use the new chain ID (6343) and new RPC URL. + * + * @param originalVersionedData - Versioned MetaMask extension state. + * @returns Updated versioned MetaMask extension state. + */ +export async function migrate( + originalVersionedData: VersionedData, +): Promise { + const versionedData = cloneDeep(originalVersionedData); + versionedData.meta.version = version; + transformState(versionedData.data); + return versionedData; +} + +function transformState(state: Record) { + if (!hasProperty(state, 'NetworkController')) { + return state; + } + + const networkState = state.NetworkController; + if (!isObject(networkState)) { + return state; + } + + if ( + !hasProperty(networkState, 'networkConfigurationsByChainId') || + !isObject(networkState.networkConfigurationsByChainId) + ) { + return state; + } + + const { networkConfigurationsByChainId } = networkState; + + // Check if the old chain ID exists in the user's configuration + const oldNetworkConfig = networkConfigurationsByChainId[OLD_CHAIN_ID]; + + if (!oldNetworkConfig) { + // User doesn't have this network, nothing to migrate + return state; + } + + if ( + !isObject(oldNetworkConfig) || + !hasProperty(oldNetworkConfig, 'rpcEndpoints') || + !Array.isArray(oldNetworkConfig.rpcEndpoints) + ) { + return state; + } + + // Update the RPC endpoints with the new URL + const updatedRpcEndpoints = oldNetworkConfig.rpcEndpoints.map( + (rpcEndpoint: Record) => { + if (!isObject(rpcEndpoint) || !hasProperty(rpcEndpoint, 'url')) { + return rpcEndpoint; + } + + // Only update the default MegaETH testnet RPC endpoint + if ( + rpcEndpoint.url === 'https://carrot.megaeth.com/rpc' || + rpcEndpoint.networkClientId === NETWORK_CLIENT_ID + ) { + return { + ...rpcEndpoint, + url: NEW_RPC_URL, + }; + } + + return rpcEndpoint; + }, + ); + + // Create the new network configuration with the new chain ID + const newNetworkConfig = { + ...oldNetworkConfig, + chainId: NEW_CHAIN_ID, + rpcEndpoints: updatedRpcEndpoints, + }; + + // Add the new configuration and remove the old one + networkConfigurationsByChainId[NEW_CHAIN_ID] = newNetworkConfig; + delete networkConfigurationsByChainId[OLD_CHAIN_ID]; + + // Update selectedNetworkClientId if it was pointing to the old network + if ( + hasProperty(networkState, 'selectedNetworkClientId') && + typeof networkState.selectedNetworkClientId === 'string' + ) { + const wasOnOldChain = ( + oldNetworkConfig.rpcEndpoints as Array<{ networkClientId?: string }> + ).some( + (endpoint) => + endpoint.networkClientId === networkState.selectedNetworkClientId, + ); + + if (wasOnOldChain && updatedRpcEndpoints.length > 0) { + // Keep the same networkClientId since we're just updating the chain + networkState.selectedNetworkClientId = NETWORK_CLIENT_ID; + } + } + + return state; +} + +export default migrate; diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index c11faed56a80..b7b5c42651b2 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -218,6 +218,7 @@ const migrations = [ require('./181'), require('./182'), require('./183'), + require('./184'), ]; export default migrations; diff --git a/privacy-snapshot.json b/privacy-snapshot.json index 3b67dc547eee..9000fdebf2cf 100644 --- a/privacy-snapshot.json +++ b/privacy-snapshot.json @@ -26,7 +26,7 @@ "bridge.dev-api.cx.metamask.io", "bsc-dataseed.binance.org", "bsc-mainnet.infura.io", - "carrot.megaeth.com", + "timothy.megaeth.com", "cdn.contentful.com", "cdn.segment.com", "cdn.segment.io", diff --git a/shared/constants/common.ts b/shared/constants/common.ts index 6330f156fa7f..126cad58e87d 100644 --- a/shared/constants/common.ts +++ b/shared/constants/common.ts @@ -32,6 +32,8 @@ const MONAD_DEFAULT_BLOCK_EXPLORER_URL = 'https://monadscan.com/'; const MONAD_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'MonadScan'; const HYPEREVM_DEFAULT_BLOCK_EXPLORER_URL = 'https://hyperevmscan.io/'; const HYPEREVM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'HyperEVMScan'; +const MEGAETH_DEFAULT_BLOCK_EXPLORER_URL = 'https://explorer.megaeth.com/'; +const MEGAETH_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL = 'MegaExplorer'; type BlockExplorerUrlMap = { [key: string]: string; @@ -51,6 +53,7 @@ export const CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP: BlockExplorerUrlMap = { [CHAIN_IDS.SEI]: SEI_DEFAULT_BLOCK_EXPLORER_URL, [CHAIN_IDS.MONAD]: MONAD_DEFAULT_BLOCK_EXPLORER_URL, [CHAIN_IDS.HYPE]: HYPEREVM_DEFAULT_BLOCK_EXPLORER_URL, + [CHAIN_IDS.MEGAETH_MAINNET]: MEGAETH_DEFAULT_BLOCK_EXPLORER_URL, } as const; export const CHAINID_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL_MAP: BlockExplorerUrlMap = @@ -68,4 +71,6 @@ export const CHAINID_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL_MAP: BlockExplore [CHAIN_IDS.SEI]: SEI_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, [CHAIN_IDS.MONAD]: MONAD_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, [CHAIN_IDS.HYPE]: HYPEREVM_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, + [CHAIN_IDS.MEGAETH_MAINNET]: + MEGAETH_DEFAULT_BLOCK_EXPLORER_HUMAN_READABLE_URL, } as const; diff --git a/shared/constants/network.test.ts b/shared/constants/network.test.ts index b3c7fef239f9..c85ce347b04c 100644 --- a/shared/constants/network.test.ts +++ b/shared/constants/network.test.ts @@ -37,6 +37,7 @@ describe('NetworkConstants', () => { Sei: CHAIN_IDS.SEI, Monad: CHAIN_IDS.MONAD, HyperEVM: CHAIN_IDS.HYPE, + MegaETH: CHAIN_IDS.MEGAETH_MAINNET, }; FEATURED_RPCS.forEach((rpc) => { diff --git a/shared/constants/network.ts b/shared/constants/network.ts index 2c82c534adf7..b0f9245f032b 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -182,7 +182,7 @@ export const CHAIN_IDS = { GSYS_TESTNET: '0xa5c8', MODE_SEPOLIA: '0x397', MODE: '0x868b', - MEGAETH_TESTNET: '0x18c6', + MEGAETH_TESTNET: '0x18c7', MEGAETH_MAINNET: '0x10e6', XRPLEVM_TESTNET: '0x161c28', LENS: '0xe8', @@ -332,7 +332,7 @@ export const OP_BNB_DISPLAY_NAME = 'opBNB'; export const BERACHAIN_DISPLAY_NAME = 'Berachain'; export const METACHAIN_ONE_DISPLAY_NAME = 'Metachain One Mainnet'; export const MEGAETH_TESTNET_DISPLAY_NAME = 'Mega Testnet'; -export const MEGAETH_MAINNET_DISPLAY_NAME = 'Mega Mainnet'; +export const MEGAETH_MAINNET_DISPLAY_NAME = 'MegaETH'; export const LISK_DISPLAY_NAME = 'Lisk'; export const LISK_SEPOLIA_DISPLAY_NAME = 'Lisk Sepolia'; export const INK_SEPOLIA_DISPLAY_NAME = 'Ink Sepolia'; @@ -402,7 +402,7 @@ export const LINEA_MAINNET_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.LINEA_MAINNET, }); export const LOCALHOST_RPC_URL = 'http://localhost:8545'; -export const MEGAETH_TESTNET_RPC_URL = 'https://carrot.megaeth.com/rpc'; +export const MEGAETH_TESTNET_RPC_URL = 'https://timothy.megaeth.com/rpc'; export const MONAD_TESTNET_RPC_URL = 'https://testnet-rpc.monad.xyz'; /** @@ -1583,6 +1583,20 @@ export const FEATURED_RPCS: AddNetworkFields[] = [ blockExplorerUrls: ['https://basescan.org'], defaultBlockExplorerUrlIndex: 0, }, + { + chainId: CHAIN_IDS.MEGAETH_MAINNET, + name: MEGAETH_MAINNET_DISPLAY_NAME, + nativeCurrency: CURRENCY_SYMBOLS.ETH, + rpcEndpoints: [ + { + url: `https://mainnet.megaeth.com/rpc`, + type: RpcEndpointType.Custom, + }, + ], + defaultRpcEndpointIndex: 0, + blockExplorerUrls: ['https://megaexplorer.xyz/'], + defaultBlockExplorerUrlIndex: 0, + }, ]; export const FEATURED_NETWORK_CHAIN_IDS = [ diff --git a/test/e2e/fixtures/fixture-builder.js b/test/e2e/fixtures/fixture-builder.js index 80df52b63c6b..5360699cc728 100644 --- a/test/e2e/fixtures/fixture-builder.js +++ b/test/e2e/fixtures/fixture-builder.js @@ -300,7 +300,7 @@ class FixtureBuilder { 'megaeth-testnet': { chainId: CHAIN_IDS.MEGAETH_TESTNET, nickname: 'Mega Testnet', - rpcUrl: 'https://carrot.megaeth.com/rpc', + rpcUrl: 'https://timothy.megaeth.com/rpc', ticker: 'MegaETH', rpcPrefs: { blockExplorerUrl: 'https://testnet.megaeth.com', diff --git a/test/e2e/fixtures/onboarding-fixture.json b/test/e2e/fixtures/onboarding-fixture.json index 35df006428d3..979882927ada 100644 --- a/test/e2e/fixtures/onboarding-fixture.json +++ b/test/e2e/fixtures/onboarding-fixture.json @@ -335,9 +335,9 @@ } ] }, - "0x18c6": { + "0x18c7": { "blockExplorerUrls": ["https://megaexplorer.xyz"], - "chainId": "0x18c6", + "chainId": "0x18c7", "defaultBlockExplorerUrlIndex": 0, "defaultRpcEndpointIndex": 0, "name": "Mega Testnet", @@ -347,7 +347,7 @@ "failoverUrls": [], "networkClientId": "megaeth-testnet", "type": "custom", - "url": "https://carrot.megaeth.com/rpc" + "url": "https://timothy.megaeth.com/rpc" } ] }, @@ -525,7 +525,7 @@ }, "eip155": { "0x1": true, - "0x18c6": false, + "0x18c7": false, "0x2105": true, "0x279f": false, "0x38": true, diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index 0c7f45a36ba8..2074b5b7c372 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -75,7 +75,7 @@ const blocklistedHosts = [ 'linea-mainnet.infura.io', 'linea-sepolia.infura.io', 'testnet-rpc.monad.xyz', - 'carrot.megaeth.com', + 'timothy.megaeth.com', 'sei-mainnet.infura.io', 'mainnet.infura.io', 'sepolia.infura.io', diff --git a/test/e2e/mock-response-data/chain-id-network-chains.json b/test/e2e/mock-response-data/chain-id-network-chains.json index 36caad1a5611..1d2e7d4d459b 100644 --- a/test/e2e/mock-response-data/chain-id-network-chains.json +++ b/test/e2e/mock-response-data/chain-id-network-chains.json @@ -200,7 +200,7 @@ "symbol": "ETH", "decimals": 18 }, - "rpc": ["https://carrot.megaeth.com/rpc", "wss://carrot.megaeth.com/ws"], + "rpc": ["https://timothy.megaeth.com/rpc", "wss://timothy.megaeth.com/ws"], "faucets": [], "infoURL": "https://testnet.megaeth.com", "shortName": "megatest", diff --git a/test/e2e/tests/settings/state-logs.json b/test/e2e/tests/settings/state-logs.json index b53f584006aa..22730503631e 100644 --- a/test/e2e/tests/settings/state-logs.json +++ b/test/e2e/tests/settings/state-logs.json @@ -175,7 +175,7 @@ "balance": "string" } }, - "0x18c6": { + "0x18c7": { "0x5CfE73b6021E818B776b421B1c4Db2474086a7e1": { "balance": "string" } diff --git a/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts b/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts index 3c098917140a..cb1b08d81777 100644 --- a/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts +++ b/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts @@ -38,9 +38,9 @@ const mockNetworkConfig = { }, ], }, - '0x18c6': { + '0x18c7': { blockExplorerUrls: ['https://megaexplorer.xyz'], - chainId: '0x18c6', + chainId: '0x18c7', defaultBlockExplorerUrlIndex: 0, defaultRpcEndpointIndex: 0, name: 'Mega Testnet', @@ -50,7 +50,7 @@ const mockNetworkConfig = { failoverUrls: [], networkClientId: 'megaeth-testnet', type: 'custom', - url: 'https://carrot.megaeth.com/rpc', + url: 'https://timothy.megaeth.com/rpc', }, ], }, @@ -81,7 +81,7 @@ const mockNetworkBatchSupport = [ upgradeContractAddress: '0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B', }, { - chainId: '0x18c6', + chainId: '0x18c7', isSupported: true, upgradeContractAddress: '0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B', }, @@ -149,7 +149,7 @@ describe('useEIP7702Networks', () => { result.current.network7702List?.map( (network: EIP7702NetworkConfiguration) => network.chainIdHex, ) || []; - expect(chainIds).toEqual(['0x1', '0x5', '0x18c6', '0xaa36a7']); + expect(chainIds).toEqual(['0x1', '0x5', '0x18c7', '0xaa36a7']); // Verify the corresponding decimal values are in ascending order const decimalChainIds = chainIds.map((id: string) => parseInt(id, 16)); From d78809ae469e03239ee69326d4151ecf711314c1 Mon Sep 17 00:00:00 2001 From: Amine Harty Date: Thu, 27 Nov 2025 19:21:42 +0100 Subject: [PATCH 2/5] fix: fix cursor comments --- shared/constants/network.ts | 2 +- test/e2e/mock-response-data/chain-id-network-chains.json | 4 ++-- ui/pages/confirmations/hooks/useEIP7702Networks.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/constants/network.ts b/shared/constants/network.ts index b0f9245f032b..421a446cd04d 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -1594,7 +1594,7 @@ export const FEATURED_RPCS: AddNetworkFields[] = [ }, ], defaultRpcEndpointIndex: 0, - blockExplorerUrls: ['https://megaexplorer.xyz/'], + blockExplorerUrls: ['https://explorer.megaeth.com/'], defaultBlockExplorerUrlIndex: 0, }, ]; diff --git a/test/e2e/mock-response-data/chain-id-network-chains.json b/test/e2e/mock-response-data/chain-id-network-chains.json index 1d2e7d4d459b..79d004d8d4ac 100644 --- a/test/e2e/mock-response-data/chain-id-network-chains.json +++ b/test/e2e/mock-response-data/chain-id-network-chains.json @@ -204,8 +204,8 @@ "faucets": [], "infoURL": "https://testnet.megaeth.com", "shortName": "megatest", - "chainId": 6342, - "networkId": 6342, + "chainId": 6343, + "networkId": 6343, "slip44": 1 }, { diff --git a/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts b/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts index cb1b08d81777..f593fc83cf17 100644 --- a/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts +++ b/ui/pages/confirmations/hooks/useEIP7702Networks.test.ts @@ -153,7 +153,7 @@ describe('useEIP7702Networks', () => { // Verify the corresponding decimal values are in ascending order const decimalChainIds = chainIds.map((id: string) => parseInt(id, 16)); - expect(decimalChainIds).toEqual([1, 5, 6342, 11155111]); + expect(decimalChainIds).toEqual([1, 5, 6343, 11155111]); }); it('returns the correct values for non-EVM accounts', () => { From 712cd240c63facb9271dbef90c4b2026f013cf6e Mon Sep 17 00:00:00 2001 From: Amine Harty Date: Thu, 27 Nov 2025 21:54:31 +0100 Subject: [PATCH 3/5] fix: fix lint --- app/scripts/controller-init/network-controller-init.test.ts | 6 +++--- app/scripts/migrations/184.test.ts | 2 +- app/scripts/migrations/184.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/scripts/controller-init/network-controller-init.test.ts b/app/scripts/controller-init/network-controller-init.test.ts index 2be0fbada91c..26ec049f5d2a 100644 --- a/app/scripts/controller-init/network-controller-init.test.ts +++ b/app/scripts/controller-init/network-controller-init.test.ts @@ -127,11 +127,11 @@ describe('NetworkControllerInit', () => { }, ], }, - "0x18c7": { + "0x18c6": { "blockExplorerUrls": [ "https://megaexplorer.xyz", ], - "chainId": "0x18c7", + "chainId": "0x18c6", "defaultBlockExplorerUrlIndex": 0, "defaultRpcEndpointIndex": 0, "name": "Mega Testnet", @@ -141,7 +141,7 @@ describe('NetworkControllerInit', () => { "failoverUrls": [], "networkClientId": "megaeth-testnet", "type": "custom", - "url": "https://timothy.megaeth.com/rpc", + "url": "https://carrot.megaeth.com/rpc", }, ], }, diff --git a/app/scripts/migrations/184.test.ts b/app/scripts/migrations/184.test.ts index d8c50c4c0806..23e332ca94d9 100644 --- a/app/scripts/migrations/184.test.ts +++ b/app/scripts/migrations/184.test.ts @@ -211,7 +211,7 @@ describe(`migration #${version}`, () => { const networkConfigurationsByChainId = networkController.networkConfigurationsByChainId as Record< string, - { rpcEndpoints: Array<{ url: string; networkClientId: string }> } + { rpcEndpoints: { url: string; networkClientId: string }[] } >; // Old chain ID should be removed diff --git a/app/scripts/migrations/184.ts b/app/scripts/migrations/184.ts index 93e369a71972..f5d734b85801 100644 --- a/app/scripts/migrations/184.ts +++ b/app/scripts/migrations/184.ts @@ -104,7 +104,7 @@ function transformState(state: Record) { typeof networkState.selectedNetworkClientId === 'string' ) { const wasOnOldChain = ( - oldNetworkConfig.rpcEndpoints as Array<{ networkClientId?: string }> + oldNetworkConfig.rpcEndpoints as { networkClientId?: string }[] ).some( (endpoint) => endpoint.networkClientId === networkState.selectedNetworkClientId, From b9e8b6347d4a90253fa723b261a539840338ab56 Mon Sep 17 00:00:00 2001 From: Amine Harty Date: Fri, 28 Nov 2025 03:26:02 +0100 Subject: [PATCH 4/5] revert megaeth testnet chain id and rpc url changes --- COMMIT_MESSAGE.txt | 13 + app/scripts/migrations/184.test.ts | 265 ------------------ app/scripts/migrations/184.ts | 122 -------- app/scripts/migrations/index.js | 1 - privacy-snapshot.json | 2 +- shared/constants/network.ts | 4 +- test/e2e/fixtures/fixture-builder.js | 2 +- test/e2e/fixtures/onboarding-fixture.json | 8 +- test/e2e/mock-e2e.js | 2 +- .../chain-id-network-chains.json | 6 +- test/e2e/tests/settings/state-logs.json | 2 +- .../network-list-menu.test.tsx.snap | 76 +++++ .../hooks/useEIP7702Networks.test.ts | 12 +- 13 files changed, 108 insertions(+), 407 deletions(-) create mode 100644 COMMIT_MESSAGE.txt delete mode 100644 app/scripts/migrations/184.test.ts delete mode 100644 app/scripts/migrations/184.ts diff --git a/COMMIT_MESSAGE.txt b/COMMIT_MESSAGE.txt new file mode 100644 index 000000000000..353ea4d6c940 --- /dev/null +++ b/COMMIT_MESSAGE.txt @@ -0,0 +1,13 @@ +Revert MegaETH Testnet chain ID and RPC URL changes + +This commit reverts all changes related to MegaETH Testnet configuration: +- Revert chain ID from 0x18c7 back to 0x18c6 +- Revert RPC URL from timothy.megaeth.com back to carrot.megaeth.com +- Remove migration 184 and its test file +- Remove migration 184 registration from index.js +- Remove controller-utils patch (already removed from package.json) +- Update test files to use original values (0x18c6, carrot.megaeth.com) +- Update test snapshots and mock data + +MegaETH Mainnet addition to FEATURED_RPCS is preserved. + diff --git a/app/scripts/migrations/184.test.ts b/app/scripts/migrations/184.test.ts deleted file mode 100644 index 23e332ca94d9..000000000000 --- a/app/scripts/migrations/184.test.ts +++ /dev/null @@ -1,265 +0,0 @@ -import { migrate, version } from './184'; - -const oldVersion = 183; -const OLD_CHAIN_ID = '0x18c6'; -const NEW_CHAIN_ID = '0x18c7'; -const OLD_RPC_URL = 'https://carrot.megaeth.com/rpc'; -const NEW_RPC_URL = 'https://timothy.megaeth.com/rpc'; - -/** - * Get the old MegaETH testnet network configuration object. - * - * @returns The old MegaETH testnet network configuration object. - */ -const getOldMegaEthTestnetConfiguration = () => ({ - chainId: OLD_CHAIN_ID, - name: 'Mega Testnet', - nativeCurrency: 'MegaETH', - blockExplorerUrls: ['https://megaexplorer.xyz'], - defaultRpcEndpointIndex: 0, - defaultBlockExplorerUrlIndex: 0, - rpcEndpoints: [ - { - networkClientId: 'megaeth-testnet', - url: OLD_RPC_URL, - type: 'custom', - }, - ], -}); - -/** - * Get the new MegaETH testnet network configuration object after migration. - * - * @returns The new MegaETH testnet network configuration object. - */ -const getNewMegaEthTestnetConfiguration = () => ({ - chainId: NEW_CHAIN_ID, - name: 'Mega Testnet', - nativeCurrency: 'MegaETH', - blockExplorerUrls: ['https://megaexplorer.xyz'], - defaultRpcEndpointIndex: 0, - defaultBlockExplorerUrlIndex: 0, - rpcEndpoints: [ - { - networkClientId: 'megaeth-testnet', - url: NEW_RPC_URL, - type: 'custom', - }, - ], -}); - -describe(`migration #${version}`, () => { - it('updates the version metadata', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: {}, - }; - const newStorage = await migrate(oldStorage); - expect(newStorage.meta).toStrictEqual({ version }); - }); - - describe('NetworkController migration', () => { - it('does nothing if `NetworkController` is missing', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: {}, - }; - const newStorage = await migrate(oldStorage); - expect(newStorage.data).toStrictEqual({}); - }); - - it('does nothing if `NetworkController` is not an object', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: 'invalidData', - }, - }; - const newStorage = await migrate(oldStorage); - expect(newStorage.data).toStrictEqual(oldStorage.data); - }); - - it('does nothing if `NetworkController.networkConfigurationsByChainId` is not an object', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - networkConfigurationsByChainId: 'invalidData', - }, - }, - }; - const newStorage = await migrate(oldStorage); - expect(newStorage.data).toStrictEqual(oldStorage.data); - }); - - it('does nothing if MegaETH testnet is not configured', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - selectedNetworkClientId: 'mainnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - '0x1': { - chainId: '0x1', - rpcEndpoints: [ - { - networkClientId: 'mainnet', - url: 'https://mainnet.infura.io/v3/{infuraProjectId}', - type: 'infura', - }, - ], - defaultRpcEndpointIndex: 0, - blockExplorerUrls: ['https://etherscan.io'], - defaultBlockExplorerUrlIndex: 0, - name: 'Ethereum Mainnet', - nativeCurrency: 'ETH', - }, - }, - }, - }, - }; - - const newStorage = await migrate(oldStorage); - expect(newStorage.data).toStrictEqual(oldStorage.data); - }); - - it('migrates MegaETH testnet from old chain ID to new chain ID with new RPC URL', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - selectedNetworkClientId: 'mainnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), - }, - }, - }, - }; - - const expectedData = { - NetworkController: { - selectedNetworkClientId: 'mainnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - [NEW_CHAIN_ID]: getNewMegaEthTestnetConfiguration(), - }, - }, - }; - - const newStorage = await migrate(oldStorage); - expect(newStorage.data).toStrictEqual(expectedData); - }); - - it('updates selectedNetworkClientId if user was on MegaETH testnet', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - selectedNetworkClientId: 'megaeth-testnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), - }, - }, - }, - }; - - const newStorage = await migrate(oldStorage); - const networkController = newStorage.data.NetworkController as Record< - string, - unknown - >; - - expect(networkController.selectedNetworkClientId).toBe('megaeth-testnet'); - }); - - it('preserves custom RPC endpoints added by user but updates default one', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - selectedNetworkClientId: 'mainnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - [OLD_CHAIN_ID]: { - ...getOldMegaEthTestnetConfiguration(), - rpcEndpoints: [ - { - networkClientId: 'megaeth-testnet', - url: OLD_RPC_URL, - type: 'custom', - }, - { - networkClientId: 'custom-megaeth', - url: 'https://custom-rpc.example.com', - type: 'custom', - }, - ], - }, - }, - }, - }, - }; - - const newStorage = await migrate(oldStorage); - const networkController = newStorage.data.NetworkController as Record< - string, - unknown - >; - const networkConfigurationsByChainId = - networkController.networkConfigurationsByChainId as Record< - string, - { rpcEndpoints: { url: string; networkClientId: string }[] } - >; - - // Old chain ID should be removed - expect(networkConfigurationsByChainId[OLD_CHAIN_ID]).toBeUndefined(); - - // New chain ID should exist - const newConfig = networkConfigurationsByChainId[NEW_CHAIN_ID]; - expect(newConfig).toBeDefined(); - expect(newConfig.rpcEndpoints).toHaveLength(2); - - // Default endpoint should be updated - expect(newConfig.rpcEndpoints[0].url).toBe(NEW_RPC_URL); - expect(newConfig.rpcEndpoints[0].networkClientId).toBe('megaeth-testnet'); - - // Custom endpoint should be preserved (not updated since it's not the default) - expect(newConfig.rpcEndpoints[1].url).toBe( - 'https://custom-rpc.example.com', - ); - expect(newConfig.rpcEndpoints[1].networkClientId).toBe('custom-megaeth'); - }); - - it('removes old chain ID and adds new chain ID', async () => { - const oldStorage = { - meta: { version: oldVersion }, - data: { - NetworkController: { - selectedNetworkClientId: 'mainnet', - networksMetadata: {}, - networkConfigurationsByChainId: { - [OLD_CHAIN_ID]: getOldMegaEthTestnetConfiguration(), - }, - }, - }, - }; - - const newStorage = await migrate(oldStorage); - const networkController = newStorage.data.NetworkController as Record< - string, - unknown - >; - const networkConfigurationsByChainId = - networkController.networkConfigurationsByChainId as Record< - string, - unknown - >; - - expect(networkConfigurationsByChainId[OLD_CHAIN_ID]).toBeUndefined(); - expect(networkConfigurationsByChainId[NEW_CHAIN_ID]).toBeDefined(); - }); - }); -}); diff --git a/app/scripts/migrations/184.ts b/app/scripts/migrations/184.ts deleted file mode 100644 index f5d734b85801..000000000000 --- a/app/scripts/migrations/184.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { hasProperty, isObject, Hex } from '@metamask/utils'; -import { cloneDeep } from 'lodash'; - -type VersionedData = { - meta: { version: number }; - data: Record; -}; - -export const version = 184; - -// MegaETH Testnet chain ID changed from 6342 to 6343 -const OLD_CHAIN_ID: Hex = '0x18c6'; // 6342 -const NEW_CHAIN_ID: Hex = '0x18c7'; // 6343 -const NEW_RPC_URL = 'https://timothy.megaeth.com/rpc'; -const NETWORK_CLIENT_ID = 'megaeth-testnet'; - -/** - * This migration updates the MegaETH Testnet network configuration - * to use the new chain ID (6343) and new RPC URL. - * - * @param originalVersionedData - Versioned MetaMask extension state. - * @returns Updated versioned MetaMask extension state. - */ -export async function migrate( - originalVersionedData: VersionedData, -): Promise { - const versionedData = cloneDeep(originalVersionedData); - versionedData.meta.version = version; - transformState(versionedData.data); - return versionedData; -} - -function transformState(state: Record) { - if (!hasProperty(state, 'NetworkController')) { - return state; - } - - const networkState = state.NetworkController; - if (!isObject(networkState)) { - return state; - } - - if ( - !hasProperty(networkState, 'networkConfigurationsByChainId') || - !isObject(networkState.networkConfigurationsByChainId) - ) { - return state; - } - - const { networkConfigurationsByChainId } = networkState; - - // Check if the old chain ID exists in the user's configuration - const oldNetworkConfig = networkConfigurationsByChainId[OLD_CHAIN_ID]; - - if (!oldNetworkConfig) { - // User doesn't have this network, nothing to migrate - return state; - } - - if ( - !isObject(oldNetworkConfig) || - !hasProperty(oldNetworkConfig, 'rpcEndpoints') || - !Array.isArray(oldNetworkConfig.rpcEndpoints) - ) { - return state; - } - - // Update the RPC endpoints with the new URL - const updatedRpcEndpoints = oldNetworkConfig.rpcEndpoints.map( - (rpcEndpoint: Record) => { - if (!isObject(rpcEndpoint) || !hasProperty(rpcEndpoint, 'url')) { - return rpcEndpoint; - } - - // Only update the default MegaETH testnet RPC endpoint - if ( - rpcEndpoint.url === 'https://carrot.megaeth.com/rpc' || - rpcEndpoint.networkClientId === NETWORK_CLIENT_ID - ) { - return { - ...rpcEndpoint, - url: NEW_RPC_URL, - }; - } - - return rpcEndpoint; - }, - ); - - // Create the new network configuration with the new chain ID - const newNetworkConfig = { - ...oldNetworkConfig, - chainId: NEW_CHAIN_ID, - rpcEndpoints: updatedRpcEndpoints, - }; - - // Add the new configuration and remove the old one - networkConfigurationsByChainId[NEW_CHAIN_ID] = newNetworkConfig; - delete networkConfigurationsByChainId[OLD_CHAIN_ID]; - - // Update selectedNetworkClientId if it was pointing to the old network - if ( - hasProperty(networkState, 'selectedNetworkClientId') && - typeof networkState.selectedNetworkClientId === 'string' - ) { - const wasOnOldChain = ( - oldNetworkConfig.rpcEndpoints as { networkClientId?: string }[] - ).some( - (endpoint) => - endpoint.networkClientId === networkState.selectedNetworkClientId, - ); - - if (wasOnOldChain && updatedRpcEndpoints.length > 0) { - // Keep the same networkClientId since we're just updating the chain - networkState.selectedNetworkClientId = NETWORK_CLIENT_ID; - } - } - - return state; -} - -export default migrate; diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index b7b5c42651b2..c11faed56a80 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -218,7 +218,6 @@ const migrations = [ require('./181'), require('./182'), require('./183'), - require('./184'), ]; export default migrations; diff --git a/privacy-snapshot.json b/privacy-snapshot.json index 9000fdebf2cf..3b67dc547eee 100644 --- a/privacy-snapshot.json +++ b/privacy-snapshot.json @@ -26,7 +26,7 @@ "bridge.dev-api.cx.metamask.io", "bsc-dataseed.binance.org", "bsc-mainnet.infura.io", - "timothy.megaeth.com", + "carrot.megaeth.com", "cdn.contentful.com", "cdn.segment.com", "cdn.segment.io", diff --git a/shared/constants/network.ts b/shared/constants/network.ts index 421a446cd04d..0d349d5a86a4 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -182,7 +182,7 @@ export const CHAIN_IDS = { GSYS_TESTNET: '0xa5c8', MODE_SEPOLIA: '0x397', MODE: '0x868b', - MEGAETH_TESTNET: '0x18c7', + MEGAETH_TESTNET: '0x18c6', MEGAETH_MAINNET: '0x10e6', XRPLEVM_TESTNET: '0x161c28', LENS: '0xe8', @@ -402,7 +402,7 @@ export const LINEA_MAINNET_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.LINEA_MAINNET, }); export const LOCALHOST_RPC_URL = 'http://localhost:8545'; -export const MEGAETH_TESTNET_RPC_URL = 'https://timothy.megaeth.com/rpc'; +export const MEGAETH_TESTNET_RPC_URL = 'https://carrot.megaeth.com/rpc'; export const MONAD_TESTNET_RPC_URL = 'https://testnet-rpc.monad.xyz'; /** diff --git a/test/e2e/fixtures/fixture-builder.js b/test/e2e/fixtures/fixture-builder.js index 5360699cc728..80df52b63c6b 100644 --- a/test/e2e/fixtures/fixture-builder.js +++ b/test/e2e/fixtures/fixture-builder.js @@ -300,7 +300,7 @@ class FixtureBuilder { 'megaeth-testnet': { chainId: CHAIN_IDS.MEGAETH_TESTNET, nickname: 'Mega Testnet', - rpcUrl: 'https://timothy.megaeth.com/rpc', + rpcUrl: 'https://carrot.megaeth.com/rpc', ticker: 'MegaETH', rpcPrefs: { blockExplorerUrl: 'https://testnet.megaeth.com', diff --git a/test/e2e/fixtures/onboarding-fixture.json b/test/e2e/fixtures/onboarding-fixture.json index 979882927ada..35df006428d3 100644 --- a/test/e2e/fixtures/onboarding-fixture.json +++ b/test/e2e/fixtures/onboarding-fixture.json @@ -335,9 +335,9 @@ } ] }, - "0x18c7": { + "0x18c6": { "blockExplorerUrls": ["https://megaexplorer.xyz"], - "chainId": "0x18c7", + "chainId": "0x18c6", "defaultBlockExplorerUrlIndex": 0, "defaultRpcEndpointIndex": 0, "name": "Mega Testnet", @@ -347,7 +347,7 @@ "failoverUrls": [], "networkClientId": "megaeth-testnet", "type": "custom", - "url": "https://timothy.megaeth.com/rpc" + "url": "https://carrot.megaeth.com/rpc" } ] }, @@ -525,7 +525,7 @@ }, "eip155": { "0x1": true, - "0x18c7": false, + "0x18c6": false, "0x2105": true, "0x279f": false, "0x38": true, diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index 2074b5b7c372..0c7f45a36ba8 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -75,7 +75,7 @@ const blocklistedHosts = [ 'linea-mainnet.infura.io', 'linea-sepolia.infura.io', 'testnet-rpc.monad.xyz', - 'timothy.megaeth.com', + 'carrot.megaeth.com', 'sei-mainnet.infura.io', 'mainnet.infura.io', 'sepolia.infura.io', diff --git a/test/e2e/mock-response-data/chain-id-network-chains.json b/test/e2e/mock-response-data/chain-id-network-chains.json index 79d004d8d4ac..36caad1a5611 100644 --- a/test/e2e/mock-response-data/chain-id-network-chains.json +++ b/test/e2e/mock-response-data/chain-id-network-chains.json @@ -200,12 +200,12 @@ "symbol": "ETH", "decimals": 18 }, - "rpc": ["https://timothy.megaeth.com/rpc", "wss://timothy.megaeth.com/ws"], + "rpc": ["https://carrot.megaeth.com/rpc", "wss://carrot.megaeth.com/ws"], "faucets": [], "infoURL": "https://testnet.megaeth.com", "shortName": "megatest", - "chainId": 6343, - "networkId": 6343, + "chainId": 6342, + "networkId": 6342, "slip44": 1 }, { diff --git a/test/e2e/tests/settings/state-logs.json b/test/e2e/tests/settings/state-logs.json index 22730503631e..b53f584006aa 100644 --- a/test/e2e/tests/settings/state-logs.json +++ b/test/e2e/tests/settings/state-logs.json @@ -175,7 +175,7 @@ "balance": "string" } }, - "0x18c7": { + "0x18c6": { "0x5CfE73b6021E818B776b421B1c4Db2474086a7e1": { "balance": "string" } diff --git a/ui/components/multichain/network-list-menu/__snapshots__/network-list-menu.test.tsx.snap b/ui/components/multichain/network-list-menu/__snapshots__/network-list-menu.test.tsx.snap index b7a02973975c..f548f79ffa77 100644 --- a/ui/components/multichain/network-list-menu/__snapshots__/network-list-menu.test.tsx.snap +++ b/ui/components/multichain/network-list-menu/__snapshots__/network-list-menu.test.tsx.snap @@ -589,6 +589,44 @@ exports[`NetworkListMenu renders properly 1`] = ` +
+
+
+ MegaETH logo +
+
+

+ MegaETH +

+
+
+
+ +
+
+
+
+
+ MegaETH logo +
+
+

+ MegaETH +

+
+
+
+ +
+
{ result.current.network7702List?.map( (network: EIP7702NetworkConfiguration) => network.chainIdHex, ) || []; - expect(chainIds).toEqual(['0x1', '0x5', '0x18c7', '0xaa36a7']); + expect(chainIds).toEqual(['0x1', '0x5', '0x18c6', '0xaa36a7']); // Verify the corresponding decimal values are in ascending order const decimalChainIds = chainIds.map((id: string) => parseInt(id, 16)); - expect(decimalChainIds).toEqual([1, 5, 6343, 11155111]); + expect(decimalChainIds).toEqual([1, 5, 6342, 11155111]); }); it('returns the correct values for non-EVM accounts', () => { From c6166f4651cf58878bb530b90dfa72b5685ce942 Mon Sep 17 00:00:00 2001 From: Amine Harty Date: Fri, 28 Nov 2025 03:36:28 +0100 Subject: [PATCH 5/5] chore: delete useless commit message --- COMMIT_MESSAGE.txt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 COMMIT_MESSAGE.txt diff --git a/COMMIT_MESSAGE.txt b/COMMIT_MESSAGE.txt deleted file mode 100644 index 353ea4d6c940..000000000000 --- a/COMMIT_MESSAGE.txt +++ /dev/null @@ -1,13 +0,0 @@ -Revert MegaETH Testnet chain ID and RPC URL changes - -This commit reverts all changes related to MegaETH Testnet configuration: -- Revert chain ID from 0x18c7 back to 0x18c6 -- Revert RPC URL from timothy.megaeth.com back to carrot.megaeth.com -- Remove migration 184 and its test file -- Remove migration 184 registration from index.js -- Remove controller-utils patch (already removed from package.json) -- Update test files to use original values (0x18c6, carrot.megaeth.com) -- Update test snapshots and mock data - -MegaETH Mainnet addition to FEATURED_RPCS is preserved. -