Skip to content
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

chore: update controllers as of core release v244 #28781

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/PATCH.txt b/PATCH.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ce3b18534f055ee00aa5821793f855fd300fb72c
--- /dev/null
+++ b/PATCH.txt
@@ -0,0 +1,4 @@
+We remove lookupNetwork from initializeProvider in the network controller to prevent network requests before user onboarding is completed.
+The network lookup is done after onboarding is completed, and when the extension reloads if onboarding has been completed.
+This patch is part of a temporary fix that will be reverted soon to make way for a more permanent solution. https://github.com/MetaMask/metamask-extension/pull/23005
+You can see the changes before compilation on this branch: https://github.com/MetaMask/core/compare/pnf/ext-23622-review?expand=1
\ No newline at end of file
diff --git a/dist/NetworkController.cjs b/dist/NetworkController.cjs
index b85de6f29620feecf6f1e395f3d25c96fb10f204..68c894de3975ab917e8320b5937b19a9b3ddd4ca 100644
--- a/dist/NetworkController.cjs
+++ b/dist/NetworkController.cjs
@@ -408,7 +408,6 @@ class NetworkController extends base_controller_1.BaseController {
*/
async initializeProvider() {
__classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
- await this.lookupNetwork();
}
/**
* Refreshes the network meta with EIP-1559 support and the network status
diff --git a/dist/NetworkController.mjs b/dist/NetworkController.mjs
index 966da694324513857dc6766590a4c965dedc2e3d..eb2fe95f9d77fa781d2bce97b7007d4676a3bede 100644
--- a/dist/NetworkController.mjs
+++ b/dist/NetworkController.mjs
@@ -383,7 +383,6 @@ export class NetworkController extends BaseController {
*/
async initializeProvider() {
__classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
- await this.lookupNetwork();
}
/**
* Refreshes the network meta with EIP-1559 support and the network status
165 changes: 22 additions & 143 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@
"@ethersproject/contracts": true,
"@ethersproject/providers": true,
"@metamask/abi-utils": true,
"@metamask/assets-controllers>@metamask/polling-controller": true,
"@metamask/base-controller": true,
"@metamask/contract-metadata": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/metamask-eth-abis": true,
"@metamask/name-controller>async-mutex": true,
"@metamask/polling-controller": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"bn.js": true,
Expand All @@ -692,18 +692,6 @@
"uuid": true
}
},
"@metamask/assets-controllers>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
},
"@metamask/base-controller": {
"globals": {
"setTimeout": true
Expand Down Expand Up @@ -796,25 +784,10 @@
"@ethersproject/providers": true,
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/ens-controller>@metamask/utils": true,
"@metamask/utils": true,
"punycode": true
}
},
"@metamask/ens-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/eth-json-rpc-filters": {
"globals": {
"console.error": true
Expand Down Expand Up @@ -1737,69 +1710,35 @@
"packages": {
"@metamask/base-controller": true,
"@metamask/controller-utils": true,
"@metamask/eth-json-rpc-middleware": true,
"@metamask/eth-json-rpc-provider": true,
"@metamask/eth-query": true,
"@metamask/eth-token-tracker>@metamask/eth-block-tracker": true,
"@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-block-tracker": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura": true,
"@metamask/network-controller>@metamask/eth-json-rpc-middleware": true,
"@metamask/network-controller>@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/rpc-errors": true,
"@metamask/network-controller>@metamask/swappable-obj-proxy": true,
"@metamask/network-controller>@metamask/utils": true,
"@metamask/network-controller>reselect": true,
"@metamask/rpc-errors": true,
"@metamask/utils": true,
"browserify>assert": true,
"browserify>util": true,
"uri-js": true,
"uuid": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura": {
"@metamask/network-controller>@metamask/eth-block-tracker": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/eth-json-rpc-provider": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/rpc-errors": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"node-fetch": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/eth-json-rpc-provider": {
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/json-rpc-engine": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/json-rpc-engine": {
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/rpc-errors": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/eth-query>json-rpc-random-id": true,
"@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/rpc-errors": {
"packages": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/rpc-errors>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/rpc-errors>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": {
"@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -1814,52 +1753,19 @@
"semver": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-middleware": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura": {
"globals": {
"URL": true,
"console.error": true,
"fetch": true,
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>klona": true,
"@metamask/eth-json-rpc-middleware>safe-stable-stringify": true,
"@metamask/eth-sig-util": true,
"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils": true,
"@metamask/network-controller>@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/rpc-errors": true,
"bn.js": true,
"pify": true
}
},
"@metamask/network-controller>@metamask/eth-json-rpc-middleware>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/network-controller>@metamask/json-rpc-engine": {
"packages": {
"@metamask/network-controller>@metamask/rpc-errors": true,
"@metamask/network-controller>@metamask/utils": true,
"@metamask/safe-event-emitter": true
}
},
"@metamask/network-controller>@metamask/rpc-errors": {
"packages": {
"@metamask/network-controller>@metamask/utils": true,
"@metamask/rpc-errors>fast-safe-stringify": true
"@metamask/eth-json-rpc-provider": true,
"@metamask/json-rpc-engine": true,
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": true,
"@metamask/rpc-errors": true
}
},
"@metamask/network-controller>@metamask/utils": {
"@metamask/network-controller>@metamask/eth-json-rpc-infura>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand Down Expand Up @@ -2439,9 +2345,9 @@
"@ethersproject/bytes": true,
"@metamask/controller-utils": true,
"@metamask/eth-query": true,
"@metamask/polling-controller": true,
"@metamask/smart-transactions-controller>@ethereumjs/tx": true,
"@metamask/smart-transactions-controller>@ethereumjs/util": true,
"@metamask/smart-transactions-controller>@metamask/polling-controller": true,
"@metamask/smart-transactions-controller>bignumber.js": true,
"@metamask/transaction-controller": true,
"browserify>buffer": true,
Expand Down Expand Up @@ -2473,18 +2379,6 @@
"crypto.getRandomValues": true
}
},
"@metamask/smart-transactions-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
"console.error": true,
"setTimeout": true
},
"packages": {
"@metamask/base-controller": true,
"@metamask/snaps-utils>fast-json-stable-stringify": true,
"uuid": true
}
},
"@metamask/smart-transactions-controller>bignumber.js": {
"globals": {
"crypto": true,
Expand Down Expand Up @@ -2787,29 +2681,14 @@
"@metamask/polling-controller": true,
"@metamask/rpc-errors": true,
"@metamask/transaction-controller": true,
"@metamask/user-operation-controller>@metamask/utils": true,
"@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true,
"bn.js": true,
"lodash": true,
"uuid": true,
"webpack>events": true
}
},
"@metamask/user-operation-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down
Loading
Loading