feat(profile-metrics-controller): tag, canonicalize, and dedupe hardware, imported, and non-mnemonic snap accounts - #10107
Open
mathieuartu wants to merge 4 commits into
Open
feat(profile-metrics-controller): tag, canonicalize, and dedupe hardware, imported, and non-mnemonic snap accounts#10107mathieuartu wants to merge 4 commits into
mathieuartu wants to merge 4 commits into
Conversation
…re, imported, and non-mnemonic snap accounts
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
References
Related to: https://consensyssoftware.atlassian.net/browse/MUL-2216
Checklist
Note
Medium Risk
Changes persisted controller state and the auth API profile-accounts payload; behavior depends on the backend accepting
account_source, and upgrade backfill re-submits known accounts.Overview
Profile metrics submissions now carry account source metadata and canonical addresses for every queued account, not only when a proof of ownership is signed.
Each account gets an optional
accountSource(mnemonic,hardware,imported, orsnap) from entropy and keyring type; unknown keyrings stay untagged so the auth API is not sent invalidaccount_sourcevalues.ProfileMetricsServicemaps that field toaccount_sourceonPUT /profile/accounts.Canonicalization moves to enqueue time, so hardware, imported, and non-mnemonic Snap accounts are stored and submitted in canonical form even without proofs. Proof signing now matches live accounts to queued entries by canonical address instead of re-canonicalizing during poll.
New persisted state
reportedAccountsskips re-enqueuing addresses already submitted successfully, andaccountSourceBackfillEnqueueddrives a one-time re-sync on first unlock after upgrade (alongside existing proof backfill) so older records pick up source tags and canonical addresses. Poll also no-ops when the sync queue is empty.Reviewed by Cursor Bugbot for commit 1a56bca. Bugbot is set up for automated code reviews on this repo. Configure here.