Skip to content

Add Opt-out Settings toggle for 4byte contract method names resolution#20098

Merged
vthomas13 merged 16 commits intodevelopfrom
privacy-4byte-toggle
Aug 4, 2023
Merged

Add Opt-out Settings toggle for 4byte contract method names resolution#20098
vthomas13 merged 16 commits intodevelopfrom
privacy-4byte-toggle

Conversation

@vthomas13
Copy link
Copy Markdown
Contributor

@vthomas13 vthomas13 commented Jul 19, 2023

Explanation

This change adds the option to disable contract method name resolution, which we retrieve through API calls to 4byte.directory. This new Opt-out should appear during onboarding and in the Privacy settings tab.

Fixes https://github.com/MetaMask/MetaMask-planning/issues/873
Progress: https://github.com/MetaMask/MetaMask-planning/issues/873#issuecomment-1640722284
See: Figma

Screenshots/Screencaps

Onboarding:

image

Extension Security&Privacy Settings:
image

Manual Testing Steps

"Decode smart contracts" setting ON:

Go to Test Dapp
Deploy a Piggybank contract
Click Deposit button
Verify that the contract method name shows as "DEPOSIT"

"Decode smart contracts" setting OFF:

Go to Privacy or Advanced Settings and turn off the "Decode smart contracts" setting
Go to Test Dapp
Deploy a Piggybank contract
Click Deposit button
Verify that the name does not appear and instead it shows as "CONTRACT INTERACTION"

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
Copy link
Copy Markdown
Contributor

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.

@vthomas13 vthomas13 changed the title WIP: Adding 4byte toggle to settings UI and preferences WIP: Add Opt-out Settings toggle for 4byte contract method names resolution Jul 19, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 19, 2023

Codecov Report

Merging #20098 (4fdfedb) into develop (8c2e85b) will increase coverage by 0.02%.
Report is 1 commits behind head on develop.
The diff coverage is 78.38%.

@@             Coverage Diff             @@
##           develop   #20098      +/-   ##
===========================================
+ Coverage    68.82%   68.84%   +0.02%     
===========================================
  Files          995      995              
  Lines        38239    38266      +27     
  Branches     10249    10250       +1     
===========================================
+ Hits         26317    26342      +25     
- Misses       11922    11924       +2     
Files Changed Coverage Δ
app/scripts/metamask-controller.js 65.49% <ø> (ø)
ui/ducks/metamask/metamask.js 78.06% <ø> (ø)
ui/helpers/constants/settings.js 33.77% <33.33%> (-0.01%) ⬇️
...nfirm-transaction/confirm-transaction.component.js 75.00% <33.33%> (+0.32%) ⬆️
ui/helpers/utils/transactions.util.js 53.09% <66.67%> (+1.19%) ⬆️
ui/store/actions.ts 43.56% <80.00%> (+0.27%) ⬆️
app/scripts/controllers/preferences.js 70.17% <100.00%> (+0.33%) ⬆️
...boarding-flow/privacy-settings/privacy-settings.js 92.16% <100.00%> (+0.32%) ⬆️
...es/settings/security-tab/security-tab.component.js 77.17% <100.00%> (+0.94%) ⬆️
...es/settings/security-tab/security-tab.container.js 86.36% <100.00%> (+1.36%) ⬆️
... and 2 more

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d1cf7b8]
Page Load Metrics (1922 ± 84 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1162081612211
domContentLoaded15352145192217584
load15352146192217584
domInteractive15352145192217584
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 148 Bytes (0.00%)
  • ui: 2.4 KiB (0.03%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 8419687 to 0f37bc8 Compare July 20, 2023 19:36
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [0f37bc8]
Page Load Metrics (1552 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint113186132189
domContentLoaded1423186115529144
load1423186115529144
domInteractive1423186115529144
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.73 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 0f37bc8 to 1ca5140 Compare July 21, 2023 13:38
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [1ca5140]
Page Load Metrics (1543 ± 39 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint108154126136
domContentLoaded1430171515428240
load1430171515438239
domInteractive1430171515428240
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.73 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 1ca5140 to bb4f6fb Compare July 21, 2023 15:55
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [bb4f6fb]
Page Load Metrics (1642 ± 124 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1062381312914
domContentLoaded146925961642259124
load146925961642259124
domInteractive146925961642259124
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.92 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [e9c060c]
Page Load Metrics (1691 ± 63 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1151831462110
domContentLoaded14761977169113163
load14771977169113163
domInteractive14761976169113163
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.92 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from e9c060c to 6589511 Compare July 24, 2023 16:01
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [6589511]
Page Load Metrics (1527 ± 21 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint102191128199
domContentLoaded1441161515274521
load1441161515274521
domInteractive1441161515274521
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.92 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 marked this pull request as ready for review July 24, 2023 18:32
@vthomas13 vthomas13 requested a review from a team as a code owner July 24, 2023 18:32
@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 78e8392 to 2868176 Compare July 24, 2023 18:32
@vthomas13 vthomas13 changed the title WIP: Add Opt-out Settings toggle for 4byte contract method names resolution Add Opt-out Settings toggle for 4byte contract method names resolution Jul 24, 2023
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [2868176]
Page Load Metrics (1539 ± 35 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint108164131178
domContentLoaded1426169515387235
load1426169615397235
domInteractive1426169515387235
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.93 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [8e2828b]
Page Load Metrics (2045 ± 55 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1473771914722
domContentLoaded19092324204311354
load19092324204511455
domInteractive19092324204311354
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.93 KiB (0.04%)
  • common: 403 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 8e2828b to e0beff1 Compare July 27, 2023 14:54
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [e0beff1]
Page Load Metrics (1577 ± 55 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1192891464019
domContentLoaded14221839157711455
load14221839157711455
domInteractive14221839157711455
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.93 KiB (0.04%)
  • common: 512 Bytes (0.01%)

@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from e0beff1 to b4f0a7e Compare July 27, 2023 19:30
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [b4f0a7e]
Page Load Metrics (1514 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint109179137199
domContentLoaded13921855151311354
load13921855151411254
domInteractive13921855151311354
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 1.92 KiB (0.02%)
  • common: 512 Bytes (0.01%)

@vthomas13 vthomas13 requested a review from darkwing July 27, 2023 21:04
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [00c8de2]
Page Load Metrics (1533 ± 29 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint104194133199
domContentLoaded1418168115336029
load1418168115336029
domInteractive1418168115336029
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 268 Bytes (0.01%)
  • ui: 2.12 KiB (0.03%)
  • common: 512 Bytes (0.01%)

NidhiKJha
NidhiKJha previously approved these changes Aug 4, 2023
Copy link
Copy Markdown
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vthomas13 vthomas13 dismissed stale reviews from NidhiKJha and pedronfigueiredo via 66ef6c3 August 4, 2023 16:31
@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from a538205 to 66ef6c3 Compare August 4, 2023 16:31
@vthomas13 vthomas13 force-pushed the privacy-4byte-toggle branch from 66ef6c3 to 4fdfedb Compare August 4, 2023 16:32
@vthomas13 vthomas13 merged commit 2ff289e into develop Aug 4, 2023
@vthomas13 vthomas13 deleted the privacy-4byte-toggle branch August 4, 2023 17:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2023
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [4fdfedb]
Page Load Metrics (1465 ± 25 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint104160123136
domContentLoaded1371155414655225
load1371155414655325
domInteractive1371155414655325
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 148 Bytes (0.00%)
  • ui: 2.05 KiB (0.03%)
  • common: 512 Bytes (0.01%)

@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Aug 4, 2023
@Gudahtt Gudahtt added release-11.1.0 Issue or pull request that will be included in release 11.1.0 and removed release-10.36.0 Issue or pull request that will be included in release 10.36.0 labels Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-privacy release-11.1.0 Issue or pull request that will be included in release 11.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants