-
Notifications
You must be signed in to change notification settings - Fork 5k
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
feat: Add RPC Method Middleware params transform and tracking #23236
feat: Add RPC Method Middleware params transform and tracking #23236
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
Builds ready [5ca60dc]
Page Load Metrics (1417 ± 426 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
Builds ready [26c03a1]
Page Load Metrics (587 ± 400 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…-params-transform-whitelist
…-params-transform-whitelist
Builds ready [8722c2b]
Page Load Metrics (1199 ± 599 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…-params-transform-whitelist
Builds ready [20e5158]
Page Load Metrics (1252 ± 567 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #23236 +/- ##
========================================
Coverage 67.42% 67.42%
========================================
Files 1295 1295
Lines 50378 50383 +5
Branches 13047 13049 +2
========================================
+ Hits 33964 33969 +5
Misses 16414 16414 ☔ View full report in Codecov by Sentry. |
…-params-transform-whitelist
…-params-transform-whitelist
…-params-transform-whitelist
Builds ready [1dd2e46]
Page Load Metrics (1281 ± 580 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…-params-transform-whitelist
Builds ready [db630ed]
Page Load Metrics (520 ± 436 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…-params-transform-whitelist
Builds ready [004e189]
Page Load Metrics (1546 ± 581 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Currently we track a sample of most RPC method calls, but we do not include params. This is for good reason of course since many param values are sensitive and may identify an otherwise anonymous MetaMask Metrics user. There are some param values that are not sensitive yet are not tracked as well. Our goal is to glean additional insight into the usage of our RPC methods by including non-sensitive params in the events that track them.
This PR achieves that by including a map of method to transformation functions which accepts a request's params object (or array) and transforms it something that is acceptable for analytics. By default no params are included.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2167
Manual testing steps
createRPCMethodTrackingMiddleware.js
window.ethereum.request
to make some rpc method callswallet_watchAsset
should include thetype
param. All other methods should not include any params.NOTE: I recommend breakpoint and debugger over the network tab because I don't believe the tracking requests actually fire on dev.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist