MetaMask / MetaMask/internal-snaps
[solana-wallet-snap] Performance improvements
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 2
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 105
Description
1 - The loop inside `createAccounts` can be parallelized using `Promise.all`
```ts
await Promise.all(indicesToCreate.map(async (groupIndex) => { ... });
```
2 - Instead of`#listAccounts()` it could use an "index cache" and avoid deserializing the entire `keyringAccounts` blob
```ts
const keyringAccounts =
(await this.#state.getKey(
'keyringAccounts',
)) ?? {};
for (const account of Object.values(keyringAccounts)) { ... }
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the solana-wallet-snap entry points for createAccounts and #listAccounts, then inspect how keyringAccounts is stored and deserialized. Compare the account-creation flow with the proposed Promise.all and index-cache approaches, and verify that account creation remains correct while avoiding unnecessary full-blob deserialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100