feat(profile-metrics-controller): add batched proof-of-ownership signing - #10142
Open
hmalik88 wants to merge 6 commits into
Open
feat(profile-metrics-controller): add batched proof-of-ownership signing#10142hmalik88 wants to merge 6 commits into
hmalik88 wants to merge 6 commits into
Conversation
hmalik88
marked this pull request as ready for review
September 8, 2026 12:35
hmalik88
temporarily deployed
to
default-branch
September 8, 2026 12:35 — with
GitHub Actions
Inactive
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
hmalik88
marked this pull request as draft
September 8, 2026 13:11
hmalik88
marked this pull request as ready for review
September 10, 2026 15:44
hmalik88
temporarily deployed
to
default-branch
September 10, 2026 15:45 — with
GitHub Actions
Inactive
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 936c3ce. Configure here.
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
This PR adds batched proof-of-ownership signing to
@metamask/profile-metrics-controller. Previously,ProfileMetricsControllerrequested one proof signature per queued account by callingProofOfOwnershipService:signfor each account. For snap-backed non-EVM accounts, that meant oneSnapController:handleRequestcall per account, causing large proof-signing fan-out during profile metrics sync.This PR adds
ProofOfOwnershipService:signBatchand updatesProfileMetricsControllerto call it once per entropy-source batch. The service keeps EVM behavior unchanged by signing each EVM account throughKeyringController:signPersonalMessage, but groups snap-backed non-EVM accounts bysnapIdand sends onesignProofOfOwnershipBatchrequest per snap.Batch responses preserve input order. Per-item snap errors are handled per account, so successful proofs in the same batch are still submitted. Whole snap batch failures or malformed responses are allowed to throw, so the sync queue is not cleared on a broken batch integration.
References
Requires wallet snaps to support
signProofOfOwnershipBatch:Breaking Change
ProfileMetricsControllernow callsProofOfOwnershipService:signBatchwhen attaching ownership proofs during profile metrics sync.Consumers must update their controller messenger wiring to delegate
ProofOfOwnershipService:signBatchtoProfileMetricsController. Clients must also ensure the involved wallet snaps support thesignProofOfOwnershipBatchJSON-RPC method before adopting this core version, because this change does not fall back to singletonsignProofOfOwnershipcalls.Checklist
Note
Medium Risk
Changes how ownership proofs are collected during metrics sync and introduces a hard dependency on snap batch signing without singleton fallback; miswired messengers or outdated snaps can block sync batches from clearing.
Overview
Profile metrics sync now attaches ownership proofs via
ProofOfOwnershipService:signBatchinstead of onesigncall per account, reducing snap RPC fan-out during poll batches.ProofOfOwnershipServiceadds batch types andsignProofOfOwnershipBatch: EVM accounts still sign individually through the keyring; snap-backed accounts are grouped bysnapIdand sent one batch request per snap, with per-item proofs or errors returned in input order.ProfileMetricsControllermaps batch results onto queued accounts, still submits when only some items fail to sign, and leaves the sync queue intact when the whole batch rejects or returns the wrong result count (no fallback to singleton snap signing).This is a breaking change: messengers must delegate
ProofOfOwnershipService:signBatch, and wallet snaps must implementsignProofOfOwnershipBatchbefore upgrading.Reviewed by Cursor Bugbot for commit e377b45. Bugbot is set up for automated code reviews on this repo. Configure here.