You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Explanation
Wallets shouldn't be directly concerned about the network ID as this is
more of a node concept for gossip. What wallets really care about is
chain ID as that is the correct value to use to identify a chain, build
transactions, etc. Although these two values usually match (ignoring
hex/dec formatting), there are
[exceptions](https://medium.com/@pedrouid/chainid-vs-networkid-how-do-they-differ-on-ethereum-eec2ed41635b).
We want to remove `networkId` from the NetworkController state to
encourage the replacement of networkId with chainId in any usage
downstream (extension, mobile, etc). It will still be possible to get
networkId using the rpc client to make a call to the `net_version`
method for cases that truly still rely on it.
## References
* Fixes
[mmp-1068](MetaMask/MetaMask-planning#1068)
## Changelog
### `@metamask/controller-utils`
- **BREAKING**: `NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP` renamed to
`CHAIN_ID_TO_ETHERS_NETWORK_NAME_MAP ` and is now a mapping of `Hex`
chain ID to `BuiltInNetworkName`
- **REMOVED**: `NetworkId` constant and type
### `@metamask/ens-controller`
- **CHANGED**: From Network state, uses `providerConfig.chainId` instead
of `networkId` to determine ENS compatability
### `@metamask/network-controller`
- **REMOVED**: `NetworkId` type
- **REMOVED**: From `NetworkState` removed `networkId` field
- **CHANGED**: No longer calls `net_version` to determine network status
(only relies on `eth_getBlockByNumber` now)
- **CHANGED**: For Built-in Infura Networks, `net_version` is no longer
locally resolved by the scaffold middleware
### `@metamask/transaction-controller`
- **BREAKING**: Uses `chainId` and `txParams.chainId` to determine if a
`TransactionMeta` object belongs to the current chain. No longer
considers `networkID`
- **BREAKING**: `TransactionMeta.chainId` is now a required field
- **REMOVED**: From `RemoteTransactionSourceRequest` removed
`currentNetworkId` field
- **CHANGED**: From `RemoteTransactionSource` updated
`isSupportedNetwork()` params to exclude networkId
- **DEPRECATED**: `TransactionMeta.networkID` is deprecated and marked
readonly
0 commit comments