Skip to content

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Nov 4, 2025

Preview. e2e tests are passing on mobile: MetaMask/metamask-mobile#22154

@rekmarks rekmarks added the DO-NOT-MERGE Pull requests that should not be merged label Nov 4, 2025
@metamaskbot metamaskbot added the team-ocap-kernel The Ocap Kernel team label Nov 4, 2025
@github-actions github-actions bot added the size-S label Nov 4, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 4, 2025

✨ Files requiring CODEOWNER review ✨

🧩 @MetaMask/extension-devs (5 files, +210 -25)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +42 -5
      • 📁 experimental/
        • 📄 policy.json +42 -5
      • 📁 flask/
        • 📄 policy.json +42 -5
      • 📁 main/
        • 📄 policy.json +42 -5
    • 📁 webpack/
      • 📄 policy.json +42 -5

📜 @MetaMask/policy-reviewers (5 files, +210 -25)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +42 -5
      • 📁 experimental/
        • 📄 policy.json +42 -5
      • 📁 flask/
        • 📄 policy.json +42 -5
      • 📁 main/
        • 📄 policy.json +42 -5
    • 📁 webpack/
      • 📄 policy.json +42 -5

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.


🔗 @MetaMask/supply-chain (5 files, +210 -25)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +42 -5
      • 📁 experimental/
        • 📄 policy.json +42 -5
      • 📁 flask/
        • 📄 policy.json +42 -5
      • 📁 main/
        • 📄 policy.json +42 -5
    • 📁 webpack/
      • 📄 policy.json +42 -5

🔄 @MetaMask/swaps-engineers (1 files, +2 -2)
  • 📁 app/
    • 📁 scripts/
      • 📁 controllers/
        • 📁 swaps/
          • 📄 swaps.test.ts +2 -2

@rekmarks rekmarks force-pushed the rekm/preview-ejrpcp-6.0 branch from fd7cc59 to 8f1fb4a Compare November 4, 2025 19:57
@rekmarks rekmarks changed the title preview: Bump eth-json-rpc-provider and related deps refactor: Bump eth-json-rpc-provider and related deps Nov 4, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [fdb280b]
UI Startup Metrics (1213 ± 87 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1213106715318712511376
load103986212898210781189
domContentLoaded103385612828010741181
domInteractive211482141857
firstPaint62286128642410411165
backgroundConnect2302182709234246
firstReactRender2817145143042
getState228105122541
initialActions71366821
loadScripts810642104679850954
setupStore1072731116
numNetworkReqs1367620673
BrowserifyPower User HomeuiStartup20291803293331922712933
load1037903146018711641460
domContentLoaded1029899144918711591449
domInteractive281665175265
firstPaint4809514864029291486
backgroundConnect25022627714262277
firstReactRender27253322833
getState18015922421200224
initialActions538268
loadScripts79867311821749201182
setupStore1393771137
numNetworkReqs15310032074226320
WebpackStandard HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
WebpackPower User HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
FirefoxBrowserifyStandard HomeuiStartup14651269193413115181748
load1239108315388912991395
domContentLoaded1238108315378912981394
domInteractive1173433752134207
firstPaint------
backgroundConnect4325153224893
firstReactRender26215452639
getState74456613
initialActions6119720414
loadScripts1212106415168712711363
setupStore146181181233
numNetworkReqs1266915760
BrowserifyPower User HomeuiStartup25712267369138226573691
load14211252169414615311694
domContentLoaded14211252169414615311694
domInteractive24795682191410682
firstPaint------
backgroundConnect1042932482168324
firstReactRender43315795057
getState1376721139172211
initialActions812371123
loadScripts13831214166614215111666
setupStore3051413243141
numNetworkReqs1536933687195336
WebpackStandard HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
WebpackPower User HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
📊 Page Load Benchmark Results

Current Commit: fdb280b | Date: 11/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±68ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±89ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±65ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 68ms 1.01s 1.57s 1.08s 1.57s
domContentLoaded 729ms 89ms 698ms 1.52s 761ms 1.52s
firstPaint 82ms 65ms 60ms 728ms 84ms 728ms
firstContentfulPaint 82ms 65ms 60ms 728ms 84ms 728ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 8.99 KiB (0.19%)
  • ui: 8.86 KiB (0.12%)
  • common: 44.79 KiB (0.52%)

rekmarks added a commit to MetaMask/core that referenced this pull request Nov 5, 2025
## Explanation

Per #6327, migrates `@metamask/eth-json-rpc-provider` to
`JsonRpcEngineV2` following its recent introduction. Intended to be
closely followed by #6976 and subsequently released.

The `InternalProvider` is updated to use `JsonRpcServer` under the hood.
It can be constructed with a `JsonRpcServer` or legacy engine, but the
latter will be wrapped by a `JsonRpcServer` in order to ensure
consistent behavior across all internal providers. Meanwhile,
`providerFromEngine()` is removed, it being a useless wrapper over the
`InternalProvider` constructor.

Elsewhere in the monorepo, these changes revealed a discrepancy in
behavior between the error handling of the legacy engine and
`asV2Middleware()`, which the latter is amended to resolve.

In addition, the changes to the `InternalProvider` revealed that the
legacy engine tolerates responses with `{ result: undefined }`. This is
impossible to express using the V2 engine, which caused some
`NetworkController` tests reliant on the legacy behavior to fail.
Further investigation proved that these `undefined` results would error
elsewhere in our JSON-RPC pipelines, so we simply remove these test
cases. The upshot is that we no longer retry `undefined` results for
"child requests" in the `retryOnEmpty` middleware. It is unclear if this
was occurring in practice, and it ought to be treated as a breach of
contract by the RPC endpoint if it does.

## References

- Progresses: #6327

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
- Not intended to be shipped without #6976, but it appears we could if
we wanted to:
    - MetaMask/metamask-extension#37521
    - MetaMask/metamask-mobile#22154

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Migrates provider to JsonRpcEngineV2 with updated InternalProvider and
helpers, adjusts error/empty-result handling, and updates dependent
packages/tests.
> 
> - **eth-json-rpc-provider**:
> - Migrate to `JsonRpcEngineV2`; `InternalProvider` now wraps legacy
engines via `asV2Middleware`/`JsonRpcEngineV2` and returns results
directly.
> - Add `providerFromMiddlewareV2`; deprecate `providerFromMiddleware`;
remove `providerFromEngine`.
> - Switch ID generation from `uuid` to `nanoid`; update exports/tests
accordingly.
> - **json-rpc-engine (v2)**:
> - Add/expand V2 types and exports (`MiddlewareConstraint`,
`MergedContextOf`, etc.).
> - Update `asV2Middleware` to deserialize errors and ignore `{ error:
undefined }` while forwarding results; add tests.
> - Rename `unserializeError` to `deserializeError` and adjust
usage/tests.
> - **eth-json-rpc-middleware**:
> - Change `retryOnEmpty` to treat only `null` and `"<nil>"` as empty
(stop retrying `undefined`).
> - **network-controller**:
> - Replace `providerFromEngine` usage with `new InternalProvider({
engine })`.
> - Align tests with new empty-result behavior and provider
construction.
> - **eth-block-tracker tests**:
> - Construct providers via `InternalProvider` instead of
`providerFromEngine`.
> - **Tooling/Config**:
>   - Add TS/Jest path mapping for `@metamask/json-rpc-engine/v2`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4a63eea. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@rekmarks rekmarks force-pushed the rekm/preview-ejrpcp-6.0 branch from fdb280b to 3e486aa Compare November 5, 2025 21:07
@rekmarks rekmarks changed the title refactor: Bump eth-json-rpc-provider and related deps refactor: Bump eth-json-rpc-middleware and related deps Nov 5, 2025
@rekmarks

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@rekmarks rekmarks force-pushed the rekm/preview-ejrpcp-6.0 branch from 9d0528a to 4fecebc Compare November 5, 2025 21:55
@rekmarks

This comment was marked as outdated.

@rekmarks rekmarks changed the title refactor: Bump eth-json-rpc-middleware and related deps refactor: Bump eth-json-rpc-provider and related deps Nov 5, 2025
@metamaskbot

This comment was marked as outdated.

@metamaskbot

This comment was marked as outdated.

@rekmarks
Copy link
Member Author

rekmarks commented Nov 5, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Builds ready [5659eb8]
📊 Page Load Benchmark Results

Current Commit: 5659eb8 | Date: 11/5/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±75ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 751ms (±72ms) 🟢 | historical mean value: 723ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±12ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 75ms 1.03s 1.36s 1.30s 1.36s
domContentLoaded 751ms 72ms 712ms 1.03s 966ms 1.03s
firstPaint 81ms 12ms 64ms 180ms 92ms 180ms
firstContentfulPaint 81ms 12ms 64ms 180ms 92ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 8.97 KiB (0.19%)
  • ui: 9.29 KiB (0.13%)
  • common: 44.83 KiB (0.52%)

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

Builds ready [c35ec24]
UI Startup Metrics (1286 ± 116 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12861105169811613451530
load1094915149010711611301
domContentLoaded1088911148310611551285
domInteractive2515278312074
firstPaint52991131640810431218
backgroundConnect2382202658243250
firstReactRender28177893242
getState2384892745
initialActions805581020
loadScripts85568212611069341052
setupStore1263551322
numNetworkReqs1367620673
BrowserifyPower User HomeuiStartup20171739338142923013381
load1040892166221412111662
domContentLoaded1031887162620712051626
domInteractive301492235292
firstPaint67217116764859321676
backgroundConnect24222033627242336
firstReactRender28254242942
getState17415720413183204
initialActions724610646
loadScripts79866113171889521317
setupStore1392761327
numNetworkReqs1177025074242250
WebpackStandard HomeuiStartup8487111242948571106
load61856895781611868
domContentLoaded61156293978605853
domInteractive17125181540
firstPaint18958940180175578
backgroundConnect261277152659
firstReactRender30185983539
getState1162831216
initialActions41405510
loadScripts60856092875603841
setupStore1162831315
numNetworkReqs1367419869
WebpackPower User HomeuiStartup12251066165519614631655
load59853289397643893
domContentLoaded57552079680601796
domInteractive221356143756
firstPaint245115654167300654
backgroundConnect661722976176229
firstReactRender26242712627
getState1378715824149158
initialActions51215921
loadScripts57151778777593787
setupStore1052771227
numNetworkReqs1086821856164218
FirefoxBrowserifyStandard HomeuiStartup14561301175911715111721
load1236109515419312871434
domContentLoaded1236109515409312871433
domInteractive1183434857118254
firstPaint------
backgroundConnect4325123184881
firstReactRender25214842632
getState74294713
initialActions6210012415
loadScripts1210107915008812621396
setupStore147205201230
numNetworkReqs1266515759
BrowserifyPower User HomeuiStartup25382158343236727563432
load13711162183120715721831
domContentLoaded13701161183120615711831
domInteractive21490603181364603
firstPaint------
backgroundConnect12637402109163402
firstReactRender40306094760
getState1407429948137299
initialActions1201242910124
loadScripts13421141178620415471786
setupStore30111042549104
numNetworkReqs1316530673202306
WebpackStandard HomeuiStartup16031393229817316181992
load13651194171311514021671
domContentLoaded13641194171311514011671
domInteractive1063134449114222
firstPaint------
backgroundConnect48241712751125
firstReactRender302289132871
getState8413914718
initialActions7116221323
loadScripts13351177166410513791585
setupStore177232311252
numNetworkReqs1267116764
WebpackPower User HomeuiStartup26362208344935229363449
load15291229186618216761866
domContentLoaded15291228186618216761866
domInteractive15847384113253384
firstPaint------
backgroundConnect993128978146289
firstReactRender423198174898
getState1418633458140334
initialActions171216517216
loadScripts14941210179717016341797
setupStore30696276396
numNetworkReqs1326832186226321
📊 Page Load Benchmark Results

Current Commit: c35ec24 | Date: 11/5/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±43ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 737ms (±66ms) 🟢 | historical mean value: 723ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±46ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 43ms 1.03s 1.39s 1.09s 1.39s
domContentLoaded 737ms 66ms 711ms 1.34s 758ms 1.34s
firstPaint 81ms 46ms 60ms 532ms 84ms 532ms
firstContentfulPaint 81ms 46ms 60ms 532ms 84ms 532ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 8.97 KiB (0.19%)
  • ui: 9.29 KiB (0.13%)
  • common: 44.83 KiB (0.52%)

@rekmarks
Copy link
Member Author

rekmarks commented Nov 6, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

No policy changes

@rekmarks
Copy link
Member Author

rekmarks commented Nov 6, 2025

It's a rousing success.

@rekmarks rekmarks closed this Nov 6, 2025
@rekmarks rekmarks deleted the rekm/preview-ejrpcp-6.0 branch November 6, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO-NOT-MERGE Pull requests that should not be merged size-S team-ocap-kernel The Ocap Kernel team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants