metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: using dapp request JSON RPC id for unique identification

Open jpuri opened this issue 2 weeks ago • 2 comments

Description

The PR has 2 changes:

  1. passing requestId to transaction controller when creating dapp transaction
  2. using this requestId in dapp swap comparison for unique identification of dapp request

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6345

Manual testing steps

  1. Submit swap
  2. Check dapp swap comparison works as expected

Screenshots/Recordings

NA

Pre-merge author checklist

Pre-merge reviewer checklist

  • [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

jpuri avatar Dec 10 '25 14:12 jpuri

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.

github-actions[bot] avatar Dec 10 '25 14:12 github-actions[bot]

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (4 files, +4 -2)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 transaction/
          • 📄 util.test.ts +1 -0
          • 📄 util.ts +1 -0
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 transactions/
            • 📁 dapp-swap-comparison/
              • 📄 useDappSwapComparisonInfo.test.ts +1 -1
              • 📄 useDappSwapComparisonInfo.ts +1 -1

📜 @MetaMask/policy-reviewers (5 files, +5 -137)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +1 -34
      • 📁 experimental/
        • 📄 policy.json +1 -34
      • 📁 flask/
        • 📄 policy.json +1 -34
      • 📁 main/
        • 📄 policy.json +1 -34
    • 📁 webpack/
      • 📁 mv2/
        • 📄 policy.json +1 -1

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

metamaskbot avatar Dec 10 '25 14:12 metamaskbot

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​eip-5792-middleware@​2.0.0 ⏵ 2.1.09910076 +194100
Updated@​metamask/​transaction-controller@​62.5.0 ⏵ 62.7.09610081 +198 +1100

View full report

socket-security[bot] avatar Dec 15 '25 15:12 socket-security[bot]

@metamaskbot update-policies

jpuri avatar Dec 16 '25 07:12 jpuri

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 avatar Dec 16 '25 07:12 metamaskbot

Builds ready [5c1d2cc]
UI Startup Metrics (1272 ± 113 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12721034153511313471492
load1064876129510111221262
domContentLoaded1058871128510111171257
domInteractive261498202190
firstPaint53383127041210301158
backgroundConnect21219625012216240
firstReactRender1483851424
getState371898124162
initialActions104112
loadScripts85367110701009221054
setupStore1172931219
numNetworkReqs171173161165
BrowserifyPower User HomeuiStartup18131491229415519062105
load1099906143211311681283
domContentLoaded1088899141311311571276
domInteractive34191422728118
firstPaint55599144743610661276
backgroundConnect266208644101244571
firstReactRender15112921618
getState19514734331210249
initialActions103112
loadScripts86769811931119391061
setupStore1874591642
numNetworkReqs66521341764119
WebpackStandard HomeuiStartup79464611161038341048
load636573100079641809
domContentLoaded63156899478635805
domInteractive2715120222289
firstPaint214911009159215602
backgroundConnect285159284490
firstReactRender15103741625
getState3414124184670
initialActions104112
loadScripts62856699177633796
setupStore1253871334
numNetworkReqs181178181170
WebpackPower User HomeuiStartup13221016196220314391725
load746619111698780928
domContentLoaded739614110698773919
domInteractive33181652928109
firstPaint2871041001200266758
backgroundConnect103867018392557
firstReactRender17142421721
getState16514323716170193
initialActions103012
loadScripts735611109697771913
setupStore15104071437
numNetworkReqs65501291862123
FirefoxBrowserifyStandard HomeuiStartup14571145250723915281884
load1178946211820912271503
domContentLoaded1177941211820912261496
domInteractive9232100813494167
firstPaint------
backgroundConnect682034061104194
firstReactRender13102531322
getState1265471425
initialActions102122
loadScripts1135931208519411651357
setupStore13476121336
numNetworkReqs20983201476
BrowserifyPower User HomeuiStartup26361574392063031163605
load17561023294760322902652
domContentLoaded17551023294660322892652
domInteractive12332136119499388
firstPaint------
backgroundConnect3522512334014111183
firstReactRender20136072227
getState134731135120139264
initialActions4137638
loadScripts1480988275951120282525
setupStore495109611743192
numNetworkReqs72531452566131
WebpackStandard HomeuiStartup15701272208517916801931
load13111139165111513931558
domContentLoaded13111139165111513931558
domInteractive842828240114133
firstPaint------
backgroundConnect58172514575155
firstReactRender15105651624
getState166220261533
initialActions104122
loadScripts12751084162610213451450
setupStore2352373817122
numNetworkReqs20988201376
WebpackPower User HomeuiStartup27571646379959832263497
load19951163292357925092807
domContentLoaded19951163292257925082806
domInteractive942997612786402
firstPaint------
backgroundConnect3152513703723681209
firstReactRender2314172182430
getState1164824133134179
initialActions217227
loadScripts17581139275049522762591
setupStore605121119023196
numNetworkReqs71511432469128
📊 Page Load Benchmark Results

Current Commit: 5c1d2cc | Date: 12/16/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 714ms (±36ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±10ms) 🟢 | historical mean value: 76ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 37ms 1.00s 1.30s 1.06s 1.30s
domContentLoaded 714ms 36ms 696ms 970ms 747ms 970ms
firstPaint 75ms 10ms 60ms 156ms 84ms 156ms
firstContentfulPaint 75ms 10ms 60ms 156ms 84ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -215.92 KiB (-4.23%)
  • ui: -61 Bytes (0%)
  • common: 4.14 KiB (0.05%)

metamaskbot avatar Dec 16 '25 08:12 metamaskbot

Builds ready [5eaad25]
UI Startup Metrics (1309 ± 107 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13091043160010713851497
load109188913279211571245
domContentLoaded108588313239111521239
domInteractive261696192385
firstPaint5008312804099961224
backgroundConnect22420027715233254
firstReactRender1483041525
getState371880124364
initialActions1014213
loadScripts8686801093919351016
setupStore1283351425
numNetworkReqs171182171167
BrowserifyPower User HomeuiStartup18001513249218019302096
load1024850168513810931310
domContentLoaded1014841167313510821281
domInteractive2916104222594
firstPaint5569213484049881301
backgroundConnect23918559291220509
firstReactRender14112631519
getState19514867655213241
initialActions102112
loadScripts81465814181318811084
setupStore1564991539
numNetworkReqs67541412064124
WebpackStandard HomeuiStartup812663121594853990
load65157594078705790
domContentLoaded64657293578701783
domInteractive2616100192383
firstPaint23886857180223741
backgroundConnect3251363441105
firstReactRender14102631620
getState3115110163856
initialActions102111
loadScripts64356992776699773
setupStore1274581337
numNetworkReqs181189181174
WebpackPower User HomeuiStartup1283962189621213431750
load7325871101108843911
domContentLoaded7265821096107836904
domInteractive31171312825115
firstPaint296104905224328809
backgroundConnect70761214551573
firstReactRender16132321620
getState16113626215167184
initialActions102011
loadScripts7225791086106833901
setupStore171046101539
numNetworkReqs65511422062123
FirefoxBrowserifyStandard HomeuiStartup14381121226121515441856
load1127948190214211901403
domContentLoaded1126948190214211901402
domInteractive82339479687158
firstPaint------
backgroundConnect62206167469188
firstReactRender14104561325
getState146116131429
initialActions103122
loadScripts1092935188212711431321
setupStore233804801362
numNetworkReqs19982191375
BrowserifyPower User HomeuiStartup24931546402152828763057
load1655991248950721472315
domContentLoaded1654991248950721472314
domInteractive82364356696241
firstPaint------
backgroundConnect3722311033868751054
firstReactRender19124862129
getState1026125332116161
initialActions3132427
loadScripts1370975224040118852138
setupStore975104824248949
numNetworkReqs70491382185111
WebpackStandard HomeuiStartup15751277241220516671985
load13081087162211713831526
domContentLoaded13081087162111713821526
domInteractive782827445109135
firstPaint------
backgroundConnect62192485079189
firstReactRender15115861626
getState205227331573
initialActions103122
loadScripts12711073156010813321475
setupStore204251331677
numNetworkReqs20985201579
WebpackPower User HomeuiStartup27071649482861031583409
load20041117345656324512692
domContentLoaded20041116345656324512692
domInteractive9828202221074326
firstPaint------
backgroundConnect2882411743273331135
firstReactRender20136562228
getState1137524035122185
initialActions208227
loadScripts17851096323551022742566
setupStore36410241072392
numNetworkReqs71471392374121
📊 Page Load Benchmark Results

Current Commit: 5eaad25 | Date: 12/16/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±73ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±70ms) 🟢 | historical mean value: 713ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 76ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 73ms 1.01s 1.35s 1.26s 1.35s
domContentLoaded 734ms 70ms 700ms 1.01s 942ms 1.01s
firstPaint 76ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 76ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -215.92 KiB (-4.23%)
  • ui: -61 Bytes (0%)
  • common: 4.14 KiB (0.05%)

metamaskbot avatar Dec 16 '25 11:12 metamaskbot

Builds ready [d1015e6]
UI Startup Metrics (1265 ± 123 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12651013170612313151494
load1061859142111011211295
domContentLoaded1055856141511011131288
domInteractive261598192278
firstPaint5088114394159981159
backgroundConnect2131952478217230
firstReactRender1393231520
getState34186093849
initialActions104112
loadScripts84866011981109051081
setupStore1172941221
numNetworkReqs171177171166
BrowserifyPower User HomeuiStartup17851431231816418782114
load1058881170113211381290
domContentLoaded1048877169013211251281
domInteractive2917114212593
firstPaint53097170841210091200
backgroundConnect25220061793240563
firstReactRender14112021517
getState18714271458192235
initialActions103112
loadScripts83567614581299101084
setupStore17760101637
numNetworkReqs65531301663117
WebpackStandard HomeuiStartup8296721054868751012
load67358686378728835
domContentLoaded66858185877720829
domInteractive271697212391
firstPaint26699814191239726
backgroundConnect2551433133118
firstReactRender16114151725
getState3312123174366
initialActions108113
loadScripts66557985576717821
setupStore1355381434
numNetworkReqs181178181271
WebpackPower User HomeuiStartup1233967209519112971641
load7205941139102809902
domContentLoaded7145891135101800894
domInteractive31161502526109
firstPaint28296896206297814
backgroundConnect62763811964380
firstReactRender15122521619
getState16113920614171192
initialActions102112
loadScripts7115871126100797891
setupStore14103971335
numNetworkReqs65511382061122
FirefoxBrowserifyStandard HomeuiStartup13201076187716013831677
load105489813829711221220
domContentLoaded105489813819711221220
domInteractive64311383185128
firstPaint------
backgroundConnect54183675360183
firstReactRender13103451324
getState11696101123
initialActions102012
loadScripts102388413618410711183
setupStore164183271144
numNetworkReqs19983191376
BrowserifyPower User HomeuiStartup26701574426961430813522
load17401021276655622122502
domContentLoaded17391021276655622112502
domInteractive953097111495289
firstPaint------
backgroundConnect3822812093864511141
firstReactRender2212160162138
getState137661230154135213
initialActions3128437
loadScripts1460992256748419892287
setupStore716112520044203
numNetworkReqs72521272296114
WebpackStandard HomeuiStartup15641302292921216421884
load13221120273318213741532
domContentLoaded13211119273318213741532
domInteractive90271432139100137
firstPaint------
backgroundConnect56202004162155
firstReactRender14112831520
getState175149251489
initialActions103122
loadScripts12861098271717313421454
setupStore194206291373
numNetworkReqs20984201376
WebpackPower User HomeuiStartup27751647435358031693372
load20041146287654825032672
domContentLoaded20041140287654825032671
domInteractive823097311680318
firstPaint------
backgroundConnect3672212293794141131
firstReactRender21128192328
getState1166932040142180
initialActions217127
loadScripts17521124268647122092480
setupStore364105511122112
numNetworkReqs71441582588126
📊 Page Load Benchmark Results

Current Commit: d1015e6 | Date: 12/16/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±52ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±49ms) 🟢 | historical mean value: 716ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 52ms 1.01s 1.31s 1.08s 1.31s
domContentLoaded 722ms 49ms 701ms 991ms 769ms 991ms
firstPaint 76ms 11ms 60ms 160ms 88ms 160ms
firstContentfulPaint 76ms 11ms 60ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -215.74 KiB (-4.22%)
  • ui: -61 Bytes (0%)
  • common: 4.19 KiB (0.05%)

metamaskbot avatar Dec 16 '25 16:12 metamaskbot