-
Notifications
You must be signed in to change notification settings - Fork 5.4k
chore: migrate testnet network MegaETH Testnet v1 to MegaETH Testnet v2 #38426
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
base: main
Are you sure you want to change the base?
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (1 files, +9 -9)
🕵️ @MetaMask/extension-privacy-reviewers (2 files, +23 -3)
🧪 @MetaMask/qa (2 files, +23 -4)
|
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.
Pull request overview
This PR migrates the MegaETH Testnet from v1 (chain ID 0x18c6 / 6342) to v2 (chain ID 0x18c7 / 6343) across the MetaMask extension codebase. The migration updates the network's RPC endpoint from https://carrot.megaeth.com/rpc to https://timothy.megaeth.com/rpc, the block explorer from https://megaexplorer.xyz to https://megaeth-testnet-v2.blockscout.com, and standardizes the network name to "MegaETH Testnet". The changes include a state migration script that removes the v1 configuration and adds v2, along with updates to all network constants, test fixtures, and e2e tests.
- Adds migration #184 to transition user state from MegaETH Testnet v1 to v2
- Updates network constants to include both v1 (for backward compatibility) and v2 configurations
- Updates all test fixtures and e2e tests to use the new v2 network configuration
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/scripts/migrations/index.js | Registers migration #184 in the migrations list |
| app/scripts/migrations/184.ts | Implements the migration logic to add v2 config and remove v1 config from user state |
| app/scripts/migrations/184.test.ts | Adds tests for the migration functionality |
| app/scripts/controller-init/network-controller-init.ts | Temporarily adds v2 network manually and removes v1 from default networks |
| app/scripts/controller-init/network-controller-init.test.ts | Updates snapshot tests to reflect v2 configuration |
| shared/constants/network.ts | Adds v2 constants alongside existing v1 constants for backward compatibility |
| test/e2e/fixtures/fixture-builder.js | Updates fixture builder to use v2 configuration |
| test/e2e/fixtures/onboarding-fixture.json | Updates fixture to include v2 network and adds both v1 and v2 to NetworkEnablementController |
| test/e2e/mock-e2e.js | Adds v2 RPC host to blocklist for testing |
| test/e2e/mock-response-data/chain-id-network-chains.json | Updates mock chain data with v2 information |
| test/e2e/tests/network/network-connection.spec.ts | Updates e2e tests to use v2 chain ID |
| ui/pages/confirmations/hooks/useEIP7702Networks.test.ts | Updates test expectations to use v2 chain ID |
| privacy-snapshot.json | Adds v2 RPC host to privacy snapshot |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Builds ready [167e9bc]
UI Startup Metrics (1289 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [5754e23]
UI Startup Metrics (1269 ± 123 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
1 similar comment
Builds ready [5754e23]
UI Startup Metrics (1269 ± 123 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [f061f95]
UI Startup Metrics (1288 ± 131 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [7a6d5fa]
UI Startup Metrics (1217 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [b0c843c]
UI Startup Metrics (1278 ± 107 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| } | ||
|
|
||
| // Add the MegaETH Testnet v2 network configuration to the enabled network map. | ||
| eip155NetworkMap[MEGAETH_TESTNET_V2_CONFIG.chainId] = false; |
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: Migration loses v1 enabled state when setting v2
The migration deletes the v1 entry from eip155NetworkMap and then unconditionally sets v2 to false. This discards the user's enablement preference — if v1 was enabled (true), v2 will still be set to false (disabled). The enabled state from v1 should be preserved and applied to v2 instead of always hardcoding false.
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 default move to mainnet, hence we set megaETH testnet v2 to false (not enabled)
Builds ready [e5ec629]
UI Startup Metrics (1222 ± 110 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [378e4dd]
UI Startup Metrics (1223 ± 120 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [ed32150]
UI Startup Metrics (1250 ± 118 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [cf1c6e0]
UI Startup Metrics (1279 ± 125 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
cf1c6e0 to
3f7d139
Compare
Builds ready [3f7d139]
UI Startup Metrics (1246 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR migrates the MegaETH Testnet from v1 (chain ID 0x18c6 / 6342) to v2 (chain ID 0x18c7 / 6343) across the MetaMask extension codebase.
The migration updates the network's RPC endpoint from https://carrot.megaeth.com/rpc to https://timothy.megaeth.com/rpc, the block explorer from https://megaexplorer.xyz to https://megaeth-testnet-v2.blockscout.com, and standardizes the network name to "MegaETH Testnet".
The changes include a state migration script that removes the v1 configuration and adds v2, along with updates to all network constants, test fixtures, and e2e tests.
Adds migration to transition user state from MegaETH Testnet v1 to v2
Updates network constants to include both v1 (for backward compatibility) and v2 configurations
Updates all test fixtures and e2e tests to use the new v2 network configuration
Changelog
CHANGELOG entry: Added new network client
megaeth-testnet-v2CHANGELOG entry: Removed network client
megaeth-testnetRelated issues
Fixes:
Manual testing steps
editon the network menu of MegaETH testnetScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Migrates MegaETH Testnet from v1 (0x18c6) to v2 (0x18c7) with new RPC/explorer, adds migration 184, and updates constants, tests, and mocks across the codebase.
MEGAETH_TESTNET_V2(0x18c7) config; removes v1 (0x18c6).NetworkEnablementController.enabledNetworkMapand switchesselectedNetworkClientIdtomainnetif pointing to v1.184.NETWORK_TYPES.MEGAETH_TESTNET_V2,CHAIN_IDS.MEGAETH_TESTNET_V2, image/ticker/display mappings, RPC URLhttps://timothy.megaeth.com/rpc, and Blockscout URL.0x18c7andmegaeth-testnet-v2; adjusts privacy snapshot and mock blocklists/allowlists fortimothy.megaeth.com.migrations/index.jsto include184; aligns EIP-7702 networks test ordering with new chain ID.Written by Cursor Bugbot for commit 3f7d139. This will update automatically on new commits. Configure here.