-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Metrics for when Blockaid banner is shown. (#21396)
## **Description** Adding analytics to Blockaid will help us understand and evaluate the performance of this feature. For users that have the Blockaid feature enabled, on performing a dapp transaction, the following should happen 1. Add a security_alert_response property to Transactions and Signature events, the value of this property should be the [result_type parameter that is returned by Blockaid](https://wobbly-nutmeg-8a5.notion.site/PPOM-Validation-Schema-Attack-Types-555e7f6a5b6c4b6caa9ced59561c8667) (e.g. set_approval_for_all_famring). 2. Add a security_alert_reason property to Transactions and Signature events, the value of this property should be the [reason parameter that is returned by Blockaid](https://wobbly-nutmeg-8a5.notion.site/PPOM-Validation-Schema-Attack-Types-555e7f6a5b6c4b6caa9ced59561c8667). When there's no value for this property (because user has the feature disabled or Blockaid response does not contain a reason value), we should pass it the value not_applicable. Create ui_customizations list property for transactions and signatures events on mobile - this property should be similar to the one created here on extension [#17688](#17688). This property should be a type list property (more info [here](https://help.mixpanel.com/hc/en-us/articles/115004547063-Properties-Supported-Data-Types#list). 3. Whenever we display a warning to the user as a result of Blockaid flagging a request as malicious, we should add the flagged_as_malicious value to the ui_customizations property in the respective Transactions or Signature events ## **Manual testing steps** 1. Start metamask in flask mode `yarn start:flask` 2. Go to testdapp and click on any of the PPOM buttons 3. See that blockaid banner is shown 4. Check that the above properties are added to the metrics event for the particular page. ## **Related issues** **Issue** https://github.com/MetaMask/MetaMask-planning/issues/929 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained: - [x] What problem this PR is solving. - [x] How this problem was solved. - [x] How reviewers can test my changes. - [x] I’ve indicated what issue this PR is linked to: Fixes #??? - [x] I’ve included tests if applicable. - [x] I’ve documented any added code. - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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. --------- Signed-off-by: Akintayo A. Olusegun <[email protected]>
- Loading branch information
Showing
9 changed files
with
277 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.