[providers] Fallback provider hangs
See original GitHub issueDescribe the bug
When using a FallbackProvider
if you have an RPC that hangs, the entire request will hang even if other RPCs are returning quickly without issue.
Important usage note: this issue was reproduced with a quorum of 1 (either because there are only 2 provider URLs used, or quorum
is explicitly set to 1.
Reproduction steps
import { JsonRpcProvider, FallbackProvider } from "@ethersproject/providers";
// Must use a list of URLs where one does not return quickly.
// This is the exhibited error behavior for some invalid or overloaded RPCs :(
const urls = ["http://....", "http://...."];
const providers = urls.map(url => new JsonRpcProvider(url));
const fallback = new FallbackProvider(providers, 1);
const promise = fallback.getBlockNumber();
await promise; // Hangs!
Environment:
Reproducible in a node repl, difficult part is finding a URL that hangs! Using "ethers": "^5.4.6"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:10
Top Results From Across the Web
The Importance of Web3 Provider Redundancy
When the main provider stops responding, the backup provider takes over. Your app has minimal to zero downtime. You might also consider using...
Read more >Unable to set provider in web3 object - Stack Overflow
I have tried replacing App.web3Provider = new Web3.providers.HttpProvider(App.url) from the "new" version with App.web3Provider = new Web3.
Read more >NiFi System Administrator's Guide - Apache NiFi
stop : stops NiFi that is running in the background ... The default login-identity-providers.xml includes a blank provider definition:.
Read more >Fax Problem 3CX T38 / G771 is not supported by 3CX via ...
The SIP trunk provider is not to blame either, it is due to the 3CX ... still supports T38 we still test it...
Read more >sssd.conf(5): config file for SSSD - Linux man page
For some ID providers there are also default regular expressions. ... to reconnect in the event of a Data Provider crash or restart...
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
We noticed the same issue
Any updates on this? I’m having the same issue. Also, more detailed information overall (and perhaps even a quality recovery mechanism) would be nice.
I receive the call that timed out (e.g.
method:eth_blockNumber
), but no indication as to why the timeout occurred. I realize you can really only provide whatever info the node sends back, but perhaps some info on why every fallback provider failed would be useful.Timing out (when you have 3 endpoints configured) then receiving
noNetwork
afterward (perpetually) while still being able to manuallygeth attach
to every single endpoint listed (or run separate simultaneous scripts that use the same nodes) is 🤯 to say the least.