From fe3e960b62e65e3179e628cc0c1754d151507bfe Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 18 Jul 2023 20:05:06 -0230 Subject: [PATCH] Fix invalid state persistence error (#20080) * Fix invalid state persistence error We have been seeing Sentry errors showing that state persistence has been failing for some users that have invalid `NetworkController` state. This has been fixed by updating to `@metamask/base-controller@v3.2.0`, which is more tolerant of unexpected state properties. * Update LavaMoat policies --------- Co-authored-by: MetaMask Bot --- lavamoat/browserify/beta/policy.json | 4 ++++ lavamoat/browserify/desktop/policy.json | 8 ++++++++ lavamoat/browserify/flask/policy.json | 8 ++++++++ lavamoat/browserify/main/policy.json | 4 ++++ lavamoat/browserify/mmi/policy.json | 4 ++++ package.json | 2 +- yarn.lock | 21 +++++++++++---------- 7 files changed, 40 insertions(+), 11 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index dd153b616..53e7a1a35 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1535,6 +1535,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1777,6 +1778,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1879,6 +1881,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1914,6 +1917,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index a4fa515be..682b9ad41 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -1282,6 +1282,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1299,6 +1300,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1661,6 +1663,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1999,6 +2002,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2164,6 +2168,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2333,6 +2338,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2370,6 +2376,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2403,6 +2410,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index a4fa515be..682b9ad41 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1282,6 +1282,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1299,6 +1300,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1661,6 +1663,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1999,6 +2002,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2164,6 +2168,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2333,6 +2338,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2370,6 +2376,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2403,6 +2410,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index dd153b616..53e7a1a35 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1535,6 +1535,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1777,6 +1778,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1879,6 +1881,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -1914,6 +1917,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index ea5f0334f..a3468ca3a 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1763,6 +1763,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2005,6 +2006,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2107,6 +2109,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, @@ -2142,6 +2145,7 @@ "TextEncoder": true }, "packages": { + "@metamask/key-tree>@noble/hashes": true, "browserify>buffer": true, "nock>debug": true, "semver": true, diff --git a/package.json b/package.json index 07044eea8..b85099d4c 100644 --- a/package.json +++ b/package.json @@ -229,7 +229,7 @@ "@metamask/announcement-controller": "^4.0.0", "@metamask/approval-controller": "^3.4.0", "@metamask/assets-controllers": "^9.2.0", - "@metamask/base-controller": "^3.1.0", + "@metamask/base-controller": "^3.2.0", "@metamask/browser-passworder": "^4.1.0", "@metamask/contract-metadata": "^2.3.1", "@metamask/controller-utils": "^4.2.0", diff --git a/yarn.lock b/yarn.lock index 1e7e44d71..3dbfe1c3d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3930,13 +3930,13 @@ __metadata: languageName: node linkType: hard -"@metamask/base-controller@npm:^3.0.0, @metamask/base-controller@npm:^3.1.0": - version: 3.1.0 - resolution: "@metamask/base-controller@npm:3.1.0" +"@metamask/base-controller@npm:^3.0.0, @metamask/base-controller@npm:^3.1.0, @metamask/base-controller@npm:^3.2.0": + version: 3.2.0 + resolution: "@metamask/base-controller@npm:3.2.0" dependencies: - "@metamask/utils": ^5.0.2 + "@metamask/utils": ^6.2.0 immer: ^9.0.6 - checksum: fc1597a099e6d28bd089df936ca349d6c38c2e1b0f0737385cba30c34a5239241519eb172d77c70f8db2604f4dc5724f6893affe42bdd104cef98f9cfd6f1db8 + checksum: 3be6f2594309c013e07f83c4bb8271e1e99f02b6ff829c18b5e7218fbab4e6a9e03bcb49056704ce47f84ae2f38b1bc1c10284ec538aad56ed7b554ef2d3e189 languageName: node linkType: hard @@ -5068,16 +5068,17 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^6.0.0, @metamask/utils@npm:^6.0.1, @metamask/utils@npm:^6.1.0": - version: 6.1.0 - resolution: "@metamask/utils@npm:6.1.0" +"@metamask/utils@npm:^6.0.0, @metamask/utils@npm:^6.0.1, @metamask/utils@npm:^6.1.0, @metamask/utils@npm:^6.2.0": + version: 6.2.0 + resolution: "@metamask/utils@npm:6.2.0" dependencies: "@ethereumjs/tx": ^4.1.2 + "@noble/hashes": ^1.3.1 "@types/debug": ^4.1.7 debug: ^4.3.4 semver: ^7.3.8 superstruct: ^1.0.3 - checksum: d4eac3ce3c08674b8e9ef838d1661a5025690c6f266c26ebdb8e8d0da11fce786e54c326b5d9c6d33b262f37e7057e31d6545a3715613bd0a5bfa10e7755643a + checksum: 0bc675358ecc09b3bc04da613d73666295d7afa51ff6b8554801585966900b24b8545bd93b8b2e9a17db867ebe421fe884baf3558ec4ca3199fa65504f677c1b languageName: node linkType: hard @@ -24191,7 +24192,7 @@ __metadata: "@metamask/approval-controller": ^3.4.0 "@metamask/assets-controllers": ^9.2.0 "@metamask/auto-changelog": ^2.1.0 - "@metamask/base-controller": ^3.1.0 + "@metamask/base-controller": ^3.2.0 "@metamask/browser-passworder": ^4.1.0 "@metamask/contract-metadata": ^2.3.1 "@metamask/controller-utils": ^4.2.0