Commit c06ea78
authored
Remove
## 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
readonlynetworkId from NetworkController (#1633)1 parent 1d71da3 commit c06ea78
File tree
23 files changed
+3501
-6052
lines changed- packages
- assets-controllers/src
- controller-utils/src
- ens-controller/src
- gas-fee-controller/src
- network-controller
- src
- tests
- provider-api-tests
- selected-network-controller/tests
- transaction-controller
- src
23 files changed
+3501
-6052
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
523 | 522 | | |
524 | 523 | | |
525 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
137 | 143 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 64 | | |
77 | 65 | | |
78 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
448 | | - | |
449 | 447 | | |
450 | 448 | | |
451 | 449 | | |
| |||
464 | 462 | | |
465 | 463 | | |
466 | 464 | | |
467 | | - | |
468 | 465 | | |
469 | | - | |
| 466 | + | |
470 | 467 | | |
471 | 468 | | |
472 | 469 | | |
| |||
490 | 487 | | |
491 | 488 | | |
492 | 489 | | |
493 | | - | |
494 | 490 | | |
495 | 491 | | |
496 | 492 | | |
| |||
514 | 510 | | |
515 | 511 | | |
516 | 512 | | |
517 | | - | |
518 | 513 | | |
519 | 514 | | |
520 | 515 | | |
| |||
537 | 532 | | |
538 | 533 | | |
539 | 534 | | |
540 | | - | |
541 | 535 | | |
542 | 536 | | |
543 | 537 | | |
| |||
563 | 557 | | |
564 | 558 | | |
565 | 559 | | |
566 | | - | |
567 | 560 | | |
568 | 561 | | |
569 | 562 | | |
| |||
589 | 582 | | |
590 | 583 | | |
591 | 584 | | |
592 | | - | |
593 | 585 | | |
594 | 586 | | |
595 | 587 | | |
| |||
617 | 609 | | |
618 | 610 | | |
619 | 611 | | |
620 | | - | |
621 | 612 | | |
622 | 613 | | |
623 | 614 | | |
| |||
644 | 635 | | |
645 | 636 | | |
646 | 637 | | |
647 | | - | |
648 | 638 | | |
649 | 639 | | |
650 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 24 | | |
39 | 25 | | |
40 | 26 | | |
| |||
118 | 104 | | |
119 | 105 | | |
120 | 106 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 107 | + | |
124 | 108 | | |
125 | 109 | | |
126 | 110 | | |
| |||
136 | 120 | | |
137 | 121 | | |
138 | 122 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 123 | + | |
| 124 | + | |
144 | 125 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
148 | 131 | | |
149 | 132 | | |
150 | 133 | | |
| |||
269 | 252 | | |
270 | 253 | | |
271 | 254 | | |
272 | | - | |
| 255 | + | |
273 | 256 | | |
274 | | - | |
275 | | - | |
| 257 | + | |
| 258 | + | |
276 | 259 | | |
277 | | - | |
278 | | - | |
| 260 | + | |
| 261 | + | |
279 | 262 | | |
280 | 263 | | |
281 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments