Skip to content

Conversation

@V00D00-child
Copy link
Member

@V00D00-child V00D00-child commented Dec 15, 2025

Explanation

This PR extends the GatorPermissionsController to allow attaching metadata when submitting a revocation to the permission provider snap. Metadata includes:

  • The transaction hash
  • The block timestamp

References

Requires(gator snap): feat: Store metadata when revoking a permission
Required by(MM client): chore: Bump @metamask/gator-permissions-controller to 0.9.0

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Introduces metadata attachment for permission revocations and updates API accordingly.

  • BREAKING: RevocationParams now requires revocationMetadata; controller parses transactionConfirmed to include txHash and forwards it to permissionsProvider_submitRevocation
  • Verifies post-revocation refresh by calling permissionsProvider_getGrantedPermissions
  • Updates tests to pass revocationMetadata and validate new behavior; exports RevocationMetadata; changelog updated

Written by Cursor Bugbot for commit 6b0625d. This will update automatically on new commits. Configure here.

@V00D00-child V00D00-child changed the title [DRAFT] Attach metadata when submitting a revocation to the permission provider snap feat: Attach metadata when submitting a revocation to the permission provider snap Dec 17, 2025
@V00D00-child V00D00-child marked this pull request as ready for review December 17, 2025 22:26
@V00D00-child V00D00-child requested review from a team as code owners December 17, 2025 22:26
Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

Should we also add revocationMetadata to StoredGatorPermission (and as per my comments on the related PR, perhaps remove the isRevoked flag?

This would probably require some changes to how we load the permission from storage also, but IMO worthwhile,

Copy link
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

One nit that I'm not especially concerned about, but might be a nice tidy up.

I am keen to understand the behaviour regarding failed transactions - we definitely don't want to be marking a permission as revoked if the transaction has failed.

// Handle confirmed transaction - submit revocation
handlers.confirmed = (transactionMeta) => {
if (transactionMeta.id === txId) {
controllerLog('Transaction confirmed, submitting revocation', {
Copy link
Contributor

Choose a reason for hiding this comment

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

not strictly related to this PR - but do we need to check transactionMeta.status here?

When a transaction is confirmed, do we explicitly guard against failed transactions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants