MetaMask / metamask-extension

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

Block and eth_call balance polling initiated by the account tracker continue after UI is closed #25951

Closed danjm closed 3 weeks ago

danjm commented 1 month ago

A bug was observed on testing v12.0.0 with the immediate symptom of:

On the 12.0.0 beta release, there is a periodic polling task that seems to be running every 20 seconds (including when the app is closed) that generates 1 API request to Etherscan and 3 to RPC provider

This results in many more requests going to the rpc provider than it should.

It turns out that some of those requests have different causes. This ticket is only concerned with the eth_call and eth_getblockbynumber requests that stem from the account tracker, and continue to occur after the UI is closed.

To repro:

  1. Build the v12.0.0 branch. A dist build gives the simplest repro
  2. Install and onboard
  3. Close the UI
  4. Open the service worker console and observe network requests to infura
danjm commented 1 month ago

This is partially addressed by https://github.com/MetaMask/metamask-extension/pull/25909, but a deeper root cause needs to be addressed as well, which https://github.com/MetaMask/metamask-extension/issues/26002 points at more directly

danjm commented 3 weeks ago

Fixed by #26141