CPU spinning + browser unresponsiveness on network switch
See original GitHub issueIn our dapp that uses ethers 5.0.0-beta.187 + Metamask + Chrome or Firefox, we are observing the following:
- Load the dapp with Metamask pointed to local ganache.
- Switch Metamask to Ropsten.
- Observe CPU of the tab go to 100%.
- Pause script execution in Chrome. The execution pauses on the following in
base-provider.js
:
for (let i = this._emitted.block + 1; i <= blockNumber; i++) {
this.emit("block", i);
} // The emitted block was updated, check for obsolete events
One example of values int he loop are this._emitted.block
of 54 and blockNumber
of 8,012,600. With these values, the loop will iterate 8 million times.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Computer unresponsive to power switch
Unplugg the system and let it sit unpowered for 10 minutes. Start. if it does not start, make sure everything internally is tight....
Read more >How to Fix a “Page Unresponsive” Error in Google Chrome
Go to Chrome's Settings screen and select Advanced > System on the sidebar. Then, turn off the switch next to Use hardware acceleration...
Read more >Firefox hangs or is not responding - How to fix
Interactions between certain Internet security software (firewall or anti-virus) can cause Firefox startup hangs on some systems.
Read more >Computer Unresponsive? What to Do if Your Laptop Freezes
If your computer has slowed to a near-crawl, or become unresponsive entirely, here's how to see if it's an easy fix or something...
Read more >How to fix WindowServer high CPU and memory usage on Mac
If the machine's hardware is upgradeable, one decent workaround is to install more RAM and replace the standard “spinning” storage media with a ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad to hear it! 😃
Closing now, but reach out if there are any further issues.
Thanks! 😃
Tried out listening to the
network
event and triggering a page reload using ethers 5.0.0-beta.191. Works like a charm. Thanks @ricmoo!