Skip to content
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 signature tracing #11453

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

OGPoyraz
Copy link
Member

Description

  • Adding createTracingMiddleware to start tracing for defined type of messages.
  • Adding trace callback to SignatureController.
  • End Notification Display trace after signature confirmation landed on users screen.

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/1883

Manual testing steps

  1. Set MM_SENTRY_DSN_DEV to developer Sentry dsn, see the value here https://github.com/MetaMask/metamask-extension/blob/develop/.metamaskrc.dist
  2. Go test-dapp in app, trigger and personal signature
  3. If you used the mentioned dsn above, your Signature trace will appear on this link: https://metamask.sentry.io/traces/?project=273496&query=signature%3ATransaction&source=traces&statsPeriod=1h

Screenshots/Recordings

Before

After

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.

@OGPoyraz OGPoyraz requested review from a team as code owners September 26, 2024 08:11
@github-actions github-actions bot added the team-confirmations Push issues to confirmations team label Sep 26, 2024
@OGPoyraz OGPoyraz added the No QA Needed Apply this label when your PR does not need any QA effort. label Sep 26, 2024
@OGPoyraz OGPoyraz added the Run Smoke E2E Triggers smoke e2e on Bitrise label Sep 26, 2024
Copy link
Contributor

github-actions bot commented Sep 26, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 7e7823e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/66431eff-be4e-4076-86ff-2ac6ffcf169c

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

vinistevam
vinistevam previously approved these changes Sep 26, 2024
jpuri
jpuri previously approved these changes Sep 26, 2024
@@ -14,6 +16,11 @@ const SignatureApproval = () => {
});
}, [onConfirm]);

useAsyncResult(async () => await endTrace({
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need useAsyncResult here as endTrace isn't asynchronous?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right, fixed

useAsyncResult(async () => await endTrace({
name: TraceName.NotificationDisplay,
id: approvalRequest?.requestData?.requestId,
}), [approvalRequest?.requestData?.requestId]);
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth defining a local variable such as signatureRequestId?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -659,7 +680,12 @@ export const getRpcMethodMiddleware = ({
eth_signTypedData_v4: async () => {
const data = JSON.parse(req.params[1]);
const chainId = data.domain.chainId;
PPOMUtil.validateRequest(req);

trace(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not in this PR, but I wonder if we'd avoid a lot of duplication by using a generic function for all the signing methods?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that in the beginning but it was looking load of changes so didn't proceed. I definitely agree that it's worth doing some cleaning up on these rpc methods.

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Sep 30, 2024
Copy link
Contributor

github-actions bot commented Sep 30, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 3971aa6
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/45fbcbca-a5f6-4e8e-b51e-d1757b6ee559

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: c6109d4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5c30026b-809c-4eea-8b1f-379d3bcc98cd

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 7a78eaf
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/178f38c0-a9a2-400c-ab14-604bbb21033d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz requested a review from a team as a code owner October 4, 2024 09:46
@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 4, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: db91a0d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c72eecba-d70b-4521-ba12-8c83550c4a8a

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link

sonarcloud bot commented Oct 4, 2024

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No QA Needed Apply this label when your PR does not need any QA effort. Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations Push issues to confirmations team
Projects
Status: Needs more work from the author
Development

Successfully merging this pull request may close these issues.

5 participants