MetaMask / metamask-extension

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

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

Open desi opened 1 month ago

desi commented 1 month 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 4 weeks 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.