MetaMask / MetaMask/snaps

Refactor `MultichainRouter` to not use `withKeyring`

Open
#3,338 0 comments 0 reactions 0 assignees View on GitHub
snaps-enhancement snaps-refined-backlog
Dominant language
TypeScript
Stars
853
Forks
662
Avg merge
2d 8h
Merged PRs (30d)
8

Description

`withKeyring` acquires a mutex lock when sending a request, that means that anything that requires the `withKeyring` in one of the Snap RPC calls (like `snap_getBip32Entropy`) will be hanging due to the deadlock that the router creates.

As of today, a temporary fix has been done on the extension side to avoid that issue: https://github.com/MetaMask/metamask-extension/pull/32120

Contributor guide

Open the contributing guide

Research direction

Start by tracing MultichainRouter's use of withKeyring and the mutex acquired during request sending. Reproduce or inspect the deadlock involving the snap_getBip32Entropy RPC call, using the linked extension pull request for context. Done means the router no longer deadlocks when a Snap RPC call requires withKeyring.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.