Skip to content

Commit

Permalink
Merge pull request #25025 from MetaMask/Version-v11.16.6
Browse files Browse the repository at this point in the history
Version v11.16.6
  • Loading branch information
danjm authored Jun 5, 2024
2 parents c699439 + 155b20c commit d90cb71
Show file tree
Hide file tree
Showing 209 changed files with 4,388 additions and 1,066 deletions.
287 changes: 214 additions & 73 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .circleci/scripts/bundle-stats-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ git clone [email protected]:MetaMask/extension_bundlesize_stats.git temp

{
echo " '${CIRCLE_SHA1}': ";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
cat test-artifacts/chrome/bundle_size_stats.json;
echo ", ";
} >> temp/stats/bundle_size_data.temp.js

Expand All @@ -57,14 +57,14 @@ if [ -f temp/stats/bundle_size_data.json ]; then
{
echo "},";
echo "\"$CIRCLE_SHA1\":";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
cat test-artifacts/chrome/bundle_size_stats.json;
echo "}";
} >> bundle_size_stats.temp.json
else
{
echo "{";
echo "\"$CIRCLE_SHA1\":";
cat test-artifacts/chrome/mv3/bundle_size_stats.json;
cat test-artifacts/chrome/bundle_size_stats.json;
echo "}";
} > bundle_size_stats.temp.json
fi
Expand Down
2 changes: 2 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ ignores:
- 'jest-environment-jsdom'
# babel
- '@babel/plugin-transform-logical-assignment-operators'
# trezor
- 'ts-mixer'

# files depcheck should not parse
ignorePatterns:
Expand Down
3 changes: 2 additions & 1 deletion .metamaskrc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ BLOCKAID_PUBLIC_KEY=
; SELENIUM_HEADLESS=
; Set this to 1 to make chrome e2e tests disable DoH/DoT and use system DNS
; SELENIUM_USE_SYSTEM_DNS=

; Set this to true to enable the snap path for the Firefox WebDriver (Linux)
; FIREFOX_SNAP=

ENABLE_CONFIRMATION_REDESIGN=

Expand Down
10 changes: 10 additions & 0 deletions .vscode/package.json-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
"description": "Defines which dependencies' scripts are allowed to run upon install. If this setting is true, the scripts are allowed. If false, the scripts are not allowed. Run `yarn allow-scripts auto` to add a dependency to this list (defaults to false)."
}
}
},
"resolutions": {
"type": "object",
"required": ["ts-mixer@npm:^6.0.3"],
"properties": {
"ts-mixer@npm:^6.0.3": {
"type": "string",
"description": "ts-mixer exports a `browser` field that points to the ESM version, but our build system can't process it. This resolution and patch file forces the CommonJS version to be used instead."
}
}
}
}
}
Expand Down
206 changes: 206 additions & 0 deletions .yarn/patches/@metamask-snaps-controllers-npm-8.0.0-7e59688855.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
diff --git a/dist/chunk-IRVUYBSV.mjs b/dist/chunk-IRVUYBSV.mjs
index 499574e7ffa925674ce2685f00742e15007df102..7926d9f03d5e6711944d0620dae9fc625c9fc2ab 100644
--- a/dist/chunk-IRVUYBSV.mjs
+++ b/dist/chunk-IRVUYBSV.mjs
@@ -31,14 +31,15 @@ import {
import { nanoid } from "nanoid";
import { pipeline } from "readable-stream";
var controllerName = "ExecutionService";
-var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn;
+var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _usePing, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn;
var AbstractExecutionService = class {
constructor({
setupSnapProvider,
messenger,
initTimeout = inMilliseconds(60, Duration.Second),
pingTimeout = inMilliseconds(2, Duration.Second),
- terminationTimeout = inMilliseconds(1, Duration.Second)
+ terminationTimeout = inMilliseconds(1, Duration.Second),
+ usePing = true
}) {
__privateAdd(this, _removeSnapHooks);
__privateAdd(this, _createSnapHooks);
@@ -51,6 +52,7 @@ var AbstractExecutionService = class {
__privateAdd(this, _initTimeout, void 0);
__privateAdd(this, _pingTimeout, void 0);
__privateAdd(this, _terminationTimeout, void 0);
+ __privateAdd(this, _usePing, void 0);
__privateSet(this, _snapRpcHooks, /* @__PURE__ */ new Map());
this.jobs = /* @__PURE__ */ new Map();
this.setupSnapProvider = setupSnapProvider;
@@ -60,6 +62,7 @@ var AbstractExecutionService = class {
__privateSet(this, _initTimeout, initTimeout);
__privateSet(this, _pingTimeout, pingTimeout);
__privateSet(this, _terminationTimeout, terminationTimeout);
+ __privateSet(this, _usePing, usePing);
this.registerMessageHandlers();
}
/**
@@ -268,16 +271,18 @@ var AbstractExecutionService = class {
const timer = new Timer(__privateGet(this, _initTimeout));
const job = await this.initJob(jobId, timer);
__privateMethod(this, _mapSnapAndJob, mapSnapAndJob_fn).call(this, snapId, job.id);
- const pingResult = await withTimeout(
- this.command(job.id, {
- jsonrpc: "2.0",
- method: "ping",
- id: nanoid()
- }),
- __privateGet(this, _pingTimeout)
- );
- if (pingResult === hasTimedOut) {
- throw new Error("The Snaps execution environment failed to start.");
+ if (__privateGet(this, _usePing)) {
+ const pingResult = await withTimeout(
+ this.command(job.id, {
+ jsonrpc: "2.0",
+ method: "ping",
+ id: nanoid()
+ }),
+ __privateGet(this, _pingTimeout)
+ );
+ if (pingResult === hasTimedOut) {
+ throw new Error("The Snaps execution environment failed to start.");
+ }
}
const rpcStream = job.streams.rpc;
this.setupSnapProvider(snapId, rpcStream);
@@ -341,6 +346,7 @@ _messenger = new WeakMap();
_initTimeout = new WeakMap();
_pingTimeout = new WeakMap();
_terminationTimeout = new WeakMap();
+_usePing = new WeakMap();
_removeSnapHooks = new WeakSet();
removeSnapHooks_fn = function(snapId) {
__privateGet(this, _snapRpcHooks).delete(snapId);
diff --git a/dist/chunk-JZCXZEFV.js b/dist/chunk-JZCXZEFV.js
index 1ace9d2de3101797650c7d1be19c184b782b4163..9142d804a6acbe2bb0d961c5a5bb1e633f377a92 100644
--- a/dist/chunk-JZCXZEFV.js
+++ b/dist/chunk-JZCXZEFV.js
@@ -31,14 +31,15 @@ var _utils = require('@metamask/utils');
var _nanoid = require('nanoid');
var _readablestream = require('readable-stream');
var controllerName = "ExecutionService";
-var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn;
+var _snapRpcHooks, _snapToJobMap, _jobToSnapMap, _messenger, _initTimeout, _pingTimeout, _terminationTimeout, _usePing, _removeSnapHooks, removeSnapHooks_fn, _createSnapHooks, createSnapHooks_fn, _mapSnapAndJob, mapSnapAndJob_fn, _removeSnapAndJobMapping, removeSnapAndJobMapping_fn;
var AbstractExecutionService = class {
constructor({
setupSnapProvider,
messenger,
initTimeout = _utils.inMilliseconds.call(void 0, 60, _utils.Duration.Second),
pingTimeout = _utils.inMilliseconds.call(void 0, 2, _utils.Duration.Second),
- terminationTimeout = _utils.inMilliseconds.call(void 0, 1, _utils.Duration.Second)
+ terminationTimeout = _utils.inMilliseconds.call(void 0, 1, _utils.Duration.Second),
+ usePing = true
}) {
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _removeSnapHooks);
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _createSnapHooks);
@@ -51,6 +52,7 @@ var AbstractExecutionService = class {
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _initTimeout, void 0);
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _pingTimeout, void 0);
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _terminationTimeout, void 0);
+ _chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _usePing, void 0);
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _snapRpcHooks, /* @__PURE__ */ new Map());
this.jobs = /* @__PURE__ */ new Map();
this.setupSnapProvider = setupSnapProvider;
@@ -60,6 +62,7 @@ var AbstractExecutionService = class {
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _initTimeout, initTimeout);
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _pingTimeout, pingTimeout);
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _terminationTimeout, terminationTimeout);
+ _chunkEXN2TFDJjs.__privateSet.call(void 0, this, _usePing, usePing);
this.registerMessageHandlers();
}
/**
@@ -268,16 +271,18 @@ var AbstractExecutionService = class {
const timer = new (0, _chunkBOFPNIRXjs.Timer)(_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _initTimeout));
const job = await this.initJob(jobId, timer);
_chunkEXN2TFDJjs.__privateMethod.call(void 0, this, _mapSnapAndJob, mapSnapAndJob_fn).call(this, snapId, job.id);
- const pingResult = await _chunk4DPX4O3Tjs.withTimeout.call(void 0,
- this.command(job.id, {
- jsonrpc: "2.0",
- method: "ping",
- id: _nanoid.nanoid.call(void 0, )
- }),
- _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _pingTimeout)
- );
- if (pingResult === _chunk4DPX4O3Tjs.hasTimedOut) {
- throw new Error("The Snaps execution environment failed to start.");
+ if (_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _usePing)) {
+ const pingResult = await _chunk4DPX4O3Tjs.withTimeout.call(void 0,
+ this.command(job.id, {
+ jsonrpc: "2.0",
+ method: "ping",
+ id: _nanoid.nanoid.call(void 0, )
+ }),
+ _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _pingTimeout)
+ );
+ if (pingResult === _chunk4DPX4O3Tjs.hasTimedOut) {
+ throw new Error("The Snaps execution environment failed to start.");
+ }
}
const rpcStream = job.streams.rpc;
this.setupSnapProvider(snapId, rpcStream);
@@ -341,6 +346,7 @@ _messenger = new WeakMap();
_initTimeout = new WeakMap();
_pingTimeout = new WeakMap();
_terminationTimeout = new WeakMap();
+_usePing = new WeakMap();
_removeSnapHooks = new WeakSet();
removeSnapHooks_fn = function(snapId) {
_chunkEXN2TFDJjs.__privateGet.call(void 0, this, _snapRpcHooks).delete(snapId);
diff --git a/dist/chunk-M2NMZ4ER.js b/dist/chunk-M2NMZ4ER.js
index 5e56452ad179871bb8e9580437f53016c0094273..a634cc4a0b2012cf3af314bd3d72131e971046cd 100644
--- a/dist/chunk-M2NMZ4ER.js
+++ b/dist/chunk-M2NMZ4ER.js
@@ -32,7 +32,8 @@ var ProxyExecutionService = class extends _chunkJZCXZEFVjs.AbstractExecutionServ
}) {
super({
messenger,
- setupSnapProvider
+ setupSnapProvider,
+ usePing: false
});
_chunkEXN2TFDJjs.__privateAdd.call(void 0, this, _stream, void 0);
_chunkEXN2TFDJjs.__privateSet.call(void 0, this, _stream, stream);
@@ -63,6 +64,13 @@ var ProxyExecutionService = class extends _chunkJZCXZEFVjs.AbstractExecutionServ
stream: _chunkEXN2TFDJjs.__privateGet.call(void 0, this, _stream),
jobId
});
+ await new Promise((resolve) => {
+ stream.once("data", resolve);
+ stream.write({
+ name: "command",
+ data: { jsonrpc: "2.0", method: "ping", id: _nanoid.nanoid.call(void 0, ) }
+ });
+ });
return { worker: jobId, stream };
}
};
diff --git a/dist/chunk-MB23XAVD.mjs b/dist/chunk-MB23XAVD.mjs
index 3a31a241bd689e480f2cf573d894e6aefc4dc672..6467cdf0893ff4b0f0a71b28f6b4d7603c5257eb 100644
--- a/dist/chunk-MB23XAVD.mjs
+++ b/dist/chunk-MB23XAVD.mjs
@@ -32,7 +32,8 @@ var ProxyExecutionService = class extends AbstractExecutionService {
}) {
super({
messenger,
- setupSnapProvider
+ setupSnapProvider,
+ usePing: false
});
__privateAdd(this, _stream, void 0);
__privateSet(this, _stream, stream);
@@ -63,6 +64,13 @@ var ProxyExecutionService = class extends AbstractExecutionService {
stream: __privateGet(this, _stream),
jobId
});
+ await new Promise((resolve) => {
+ stream.once("data", resolve);
+ stream.write({
+ name: "command",
+ data: { jsonrpc: "2.0", method: "ping", id: nanoid() }
+ });
+ });
return { worker: jobId, stream };
}
};
43 changes: 43 additions & 0 deletions .yarn/patches/@trezor-connect-web-npm-9.2.2-a4de8e45fc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/lib/index.js b/lib/index.js
index 82a21b70dc18597fdbb1c5bfdbebb10f615c723d..04edf4b3a8a5a2bebda8bf907225b502ab5c30ad 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -109,7 +109,9 @@ const init = async (settings = {}) => {
_log.enabled = !!_settings.debug;
window.addEventListener('message', handleMessage);
window.addEventListener('unload', dispose);
- await iframe.init(_settings);
+ var modifiedSettings = Object.assign({}, _settings);
+ modifiedSettings.env = 'webextension';
+ await iframe.init(modifiedSettings);
if (_settings.sharedLogger !== false) {
iframe.initIframeLogger();
}
@@ -125,7 +127,9 @@ const call = async (params) => {
}
_popupManager.request();
try {
- await init(_settings);
+ var modifiedSettings = Object.assign({}, _settings);
+ modifiedSettings.env = 'webextension';
+ await init(modifiedSettings);
}
catch (error) {
if (_popupManager) {
diff --git a/lib/popup/index.js b/lib/popup/index.js
index 6948bdb73b381bb72fb8b87fe2006d0046b65acb..d8f80f77728a18a851da3f03a5ed956cb46fe8e6 100644
--- a/lib/popup/index.js
+++ b/lib/popup/index.js
@@ -272,9 +272,11 @@ class PopupManager extends events_1.default {
this.popupPromise.resolve();
}
(_b = this.iframeHandshakePromise) === null || _b === void 0 ? void 0 : _b.promise.then(payload => {
+ var modifiedSettings = Object.assign({}, this.settings);
+ modifiedSettings.env = 'webextension';
this.channel.postMessage({
type: events_2.POPUP.INIT,
- payload: Object.assign(Object.assign({}, payload), { settings: this.settings }),
+ payload: Object.assign(Object.assign({}, payload), { settings: modifiedSettings }),
});
});
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/lib/index.js b/lib/index.js
index b7a810396d6c0dad839fc08f1e192f5df134879f..93cb54be0f33c77e9f801f1c23330eb0fc65bb38 100644
index b7a810396d6c0dad839fc08f1e192f5df134879f..14c6b3afaf1ca1d2805bea6c136cf9e48881db33 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -4,7 +4,7 @@ exports.Optional = exports.Type = exports.AssertWeak = exports.Assert = exports.
Expand Down
12 changes: 12 additions & 0 deletions .yarn/patches/ts-mixer-npm-6.0.4-5d9747bdf5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index 0f83178c00d4168f35241589d2e77c8a874ed4bd..f0ff8911f5366f9cb05c64e73fe38c4b3e9a74a7 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,6 @@
"description": "A very small TypeScript library that provides tolerable Mixin functionality.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
- "browser": "dist/esm/index.js",
"unpkg": "dist/esm/index.min.js",
"types": "dist/types/index.d.ts",
"files": [
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [11.16.6]
### Added
- Add a Basic Functionality Toggle to settings, enabling users to opt-out of some features that send network requests to external services ([#23456](https://github.com/MetaMask/metamask-extension/pull/23456))

### Changed
- Update MetaMask Chrome builds to Manifest V3 ([#24746](https://github.com/MetaMask/metamask-extension/pull/24746))

### Fixed
- Ensure network requests are not made during onboarding
- ([#24890](https://github.com/MetaMask/metamask-extension/pull/24890))
- ([#24891](https://github.com/MetaMask/metamask-extension/pull/24891))
- ([#24887](https://github.com/MetaMask/metamask-extension/pull/24887))

## [11.16.5]
### Changed
- Re-enable the opt-in modal (2df1eb566b)
Expand Down Expand Up @@ -4768,7 +4781,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
- Added the ability to restore accounts from seed words.


[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.5...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.6...HEAD
[11.16.6]: https://github.com/MetaMask/metamask-extension/compare/v11.16.5...v11.16.6
[11.16.5]: https://github.com/MetaMask/metamask-extension/compare/v11.16.4...v11.16.5
[11.16.4]: https://github.com/MetaMask/metamask-extension/compare/v11.16.3...v11.16.4
[11.16.3]: https://github.com/MetaMask/metamask-extension/compare/v11.16.2...v11.16.3
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ Before running e2e tests, ensure you've run `yarn install` to download dependenc
- `yarn build:test` for main build
- `yarn build:test:flask` for flask build
- `yarn build:test:mmi` for mmi build
- `yarn build:test:mv3` for mv3 build
- `yarn build:test:mv2` for mv2 build
3. Start a test build with live changes: `yarn start:test` is particularly useful for development. It starts a test build that automatically recompiles application code upon changes. This option is ideal for iterative testing and development. This command also allows you to generate test builds for various types, including:
- `yarn start:test` for main build
- `yarn start:test:flask` for flask build
- `yarn start:test:mv3` for mv3 build
- `yarn start:test:mv2` for mv2 build

Note: The `yarn start:test` command (which initiates the testDev build type) has LavaMoat disabled for both the build system and the application, offering a streamlined testing experience during development. On the other hand, `yarn build:test` enables LavaMoat for enhanced security in both the build system and application, mirroring production environments more closely.

Expand All @@ -133,6 +133,7 @@ Note: The `yarn start:test` command (which initiates the testDev build type) has
Once you have your test build ready, choose the browser for your e2e tests:

- For Firefox, run `yarn test:e2e:firefox`.
- Note: If you are running Firefox as a snap package on Linux, ensure you enable the appropriate environment variable: `FIREFOX_SNAP=true yarn test:e2e:firefox`
- For Chrome, run `yarn test:e2e:chrome`.

These scripts support additional options for debugging. Use `--help`to see all available options.
Expand Down Expand Up @@ -179,7 +180,7 @@ Different build types have different e2e tests sets. In order to run them look i
```console
"test:e2e:chrome:mmi": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --mmi",
"test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps",
"test:e2e:chrome:mv3": "ENABLE_MV3=true SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:e2e:firefox": "ENABLE_MV3=false SELENIUM_BROWSER=firefox node test/e2e/run-all.js",
```

#### Note: Running MMI e2e tests
Expand Down
Loading

0 comments on commit d90cb71

Please sign in to comment.