MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.08k stars 4.93k forks source link

Stop caching non-persisted controller state to reduce disk and potentially memory usage #26066

Open desi opened 4 months ago

desi commented 4 months ago

What is this about?

We currently cache a lot of non-persisted controller state as persisted state. This state was meant only to be used for service worker restarts, but that doesn't happen right now due to our service worker keepalive strategy. We should stop caching this non-persisted state, which would reduce disk usage.

It's possible that reducing the size of persisted state would also reduce memory usage. I am not certain if this would hold true once we clear getMostRecentPersistedState, but it might, and it's a nice disk usage optimization regardless.

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

No response

Stakeholder review needed before the work gets merged

References

No response

Gudahtt commented 3 months ago

I have recategorized this as Sev2 because the impact isn't significant enough on its own to meet the criteria for Sev1. This is related to a Sev1 issue about reports of extreme slowness and crashes, but we don't have any reason to suspect that this specific bug is a major contributor to that problem. It's likely a small contributor.

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.