question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CPU spinning + browser unresponsiveness on network switch

See original GitHub issue

In our dapp that uses ethers 5.0.0-beta.187 + Metamask + Chrome or Firefox, we are observing the following:

  1. Load the dapp with Metamask pointed to local ganache.
  2. Switch Metamask to Ropsten.
  3. Observe CPU of the tab go to 100%.
  4. 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.

Screen Shot 2020-06-01 at 12 17 15 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Jun 5, 2020

Glad to hear it! 😃

Closing now, but reach out if there are any further issues.

Thanks! 😃

1reaction
kerzhnercommented, Jun 5, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found