Skip to content

Conversation

@jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Dec 8, 2025

Explanation

wallet_requestExecutionPermissions and wallet_revokeExecutionPermissions (although the latter is not implemented in Extension) require the origin of the request in order to forward to the implementing snap.

When these methods were upgraded to JsonRpcMiddleware 2, the context was swallowed, so the origin became inaccessible. This change includes the context: WalletContext parameter in the call to the "process" function.

References

Required for MetaMask/metamask-extension#38616
Fixes MetaMask/metamask-extension#38618

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

Pass WalletMiddlewareContext to the processing hooks for wallet_requestExecutionPermissions and wallet_revokeExecutionPermission, updating tests and changelog.

  • Middleware (EIP-7715):
    • createWalletRequestExecutionPermissionsHandler and createWalletRevokeExecutionPermissionHandler now receive context and pass WalletMiddlewareContext to their respective process hooks.
    • Update hook signatures: ProcessRequestExecutionPermissionsHook and ProcessRevokeExecutionPermissionHook now include context.
  • Tests:
    • Update tests to provide context and assert hooks are called with (params, request, context).
  • Changelog:
    • Add Fixed entry: Include WalletContext in EIP-7715 requests.

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

@jeffsmale90 jeffsmale90 force-pushed the fix/wallet-request-execution-permissions-context branch from af03362 to bf38f0f Compare December 8, 2025 05:31
@jeffsmale90 jeffsmale90 force-pushed the fix/wallet-request-execution-permissions-context branch from bf38f0f to 0f08865 Compare December 8, 2025 05:44
@jeffsmale90 jeffsmale90 changed the title Pass WalletContext to Advanced Permissions methods fix: Include WalletContext in EIP-7715 requests Dec 8, 2025
@jeffsmale90 jeffsmale90 marked this pull request as ready for review December 8, 2025 05:45
@jeffsmale90 jeffsmale90 requested review from a team as code owners December 8, 2025 05:45
…ing wallet_requestExecutionPermissions and wallet_revokeExecutionPermissions
@jeffsmale90 jeffsmale90 force-pushed the fix/wallet-request-execution-permissions-context branch from 0f08865 to 4d3ebb2 Compare December 8, 2025 08:06
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@jeffsmale90 jeffsmale90 added this pull request to the merge queue Dec 8, 2025
Merged via the queue into main with commit 5c9a270 Dec 8, 2025
281 checks passed
@jeffsmale90 jeffsmale90 deleted the fix/wallet-request-execution-permissions-context branch December 8, 2025 17:36
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.

[Bug]: wallet_requestExecutionPermissions fails with Snap Error

4 participants