MetaMask / eth-block-tracker

A JS module for keeping track of the latest Ethereum block by polling an ethereum provider
MIT License
129 stars 83 forks source link

Endless failed request polling loop #163

Open Gudahtt opened 12 months ago

Gudahtt commented 12 months ago

The polling block tracker has been observed being stuck in an endless loop (e.g. https://github.com/MetaMask/metamask-extension/issues/17040).

I was able to reproduce this scenario by using MetaMask extension to switch to a network that will fail to respond to requests. This results in an endless loop of failed requests, even after switching away (i.e. even after there are no more listeners). In the debugger I confirmed that the only active listeners were internal to the block tracker itself (specifically this listener).

Gudahtt commented 2 weeks ago

I was still able to reproduce this bug on v9.0.3

mcmire commented 1 week ago

In the PR that is linked to in the timeline above and was closed, I made this comment:

@Gudahtt and I had a discussion and we feel like we can solve this a different way that doesn't involve listening to latest in any form.

@Gudahtt Do you still think following that route would be a proper fix here?

Gudahtt commented 1 week ago

Unfortunately I don't recall the details of that solution