-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 anonymized signature metrics #27298
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. |
Builds ready [801a531]
Page Load Metrics (1754 ± 45 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [b2139e1]
Page Load Metrics (1765 ± 94 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [256f2a4]
Page Load Metrics (1835 ± 172 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [ace801e]
Page Load Metrics (1733 ± 74 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
properties: { ...DEFAULT_EVENT_PROPERTIES }, | ||
}); | ||
}); | ||
}); |
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.
[non-blocking] we could DRY these up by looping the tests together
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.
done
@@ -222,8 +224,7 @@ export default function createRPCMethodTrackingMiddleware({ | |||
) { | |||
const { origin, method, params } = req; | |||
|
|||
const rateLimitType = | |||
RATE_LIMIT_MAP[method] ?? RATE_LIMIT_TYPES.RANDOM_SAMPLE; |
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.
why did we remove the RATE_LIMIT_TYPES.RANDOM_SAMPLE
fallback?
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.
the switch has a default condition that falls back to the RANDOM_SAMPLE anyhow, so this is redundant
const parsedMessageData = parseTypedDataMessage(data); | ||
sensitiveEventProperties = {}; | ||
|
||
eventProperties.eip712_primary_type = parsedMessageData.primaryType; | ||
sensitiveEventProperties.eip712_verifyingContract = | ||
parsedMessageData.domain.verifyingContract; | ||
sensitiveEventProperties.eip712_domain_version = | ||
parsedMessageData.domain.version; | ||
sensitiveEventProperties.eip712_domain_name = | ||
parsedMessageData.domain.name; |
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.
could do something like this. Would need to update primaryType again if this suggestion is accepted
const parsedMessageData = parseTypedDataMessage(data); | |
sensitiveEventProperties = {}; | |
eventProperties.eip712_primary_type = parsedMessageData.primaryType; | |
sensitiveEventProperties.eip712_verifyingContract = | |
parsedMessageData.domain.verifyingContract; | |
sensitiveEventProperties.eip712_domain_version = | |
parsedMessageData.domain.version; | |
sensitiveEventProperties.eip712_domain_name = | |
parsedMessageData.domain.name; | |
const { domain, primaryType } = parseTypedDataMessage(data); | |
sensitiveEventProperties = { | |
eip712_verifyingContract: domain.verifyingContract, | |
eip712_domain_version: domain.version, | |
eip712_domain_name: domain.name, | |
}; | |
eventProperties.eip712_primary_type = primaryType; |
Builds ready [cdec7d9]
Page Load Metrics (1644 ± 47 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Quality Gate passedIssues Measures |
Builds ready [1a84558]
Page Load Metrics (1703 ± 70 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -3,7 +3,7 @@ sonar.organization=consensys | |||
|
|||
# Source | |||
sonar.sources=app,development,offscreen,shared,test,types,ui | |||
sonar.exclusions=**/*.test.**,**/*.spec.**,app/images | |||
sonar.exclusions=**/*.test.**,**/*.spec.**,app/images,test/** |
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.
👍🏼
Missing release label release-12.5.0 on PR. Adding release label release-12.5.0 on PR and removing other release labels(release-12.6.0), as PR was added to branch 12.5.0 when release was cut. |
Description
Adds logic to send Signature Requested Anon, Signature Approved Anon and Signature Rejected Anon events when the signature is of type signTypedData_v4 with additional anonymous properties.
Updates the e2e to check the correct Anon events are sent with the additional properties
Added additional unit tests to increase sonar coverage
Exclude the test folder from sonar checks
Related issues
Fixes: 3009
Manual testing steps
Go to test dapp
Under the Permit section, click on Sign
This should trigger the Signature Anon events with:
Go to test dapp
Under the SignTypedData_v4 section, click on Sign
This should trigger the Signature Anon events with:
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist