-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getLogs Error: failed to meet quorum #841
Comments
Can you provide an example query you are using? This error happens when the backends disagree on the result. I may have to relax the response fuzzy matching for something in getLogs I'm not currently taking into account. This is something I likely need to address, but if you'd like more background, here are the docs. Any example you can provide that occasionally trigger this would be useful. |
Oh, never mind. I see your filter is present in the error. :) |
I found the bug. It has nothing to do with the fuzzy matching logic. I'll fix it asap. |
Oh nice, I was afraid it was a problem with infura. Thanks for the speedy response, this is why I love ethers!!! Seriously, I really appreciate it |
The has been fixed in 5.0.0-beta.188. Please try it out and let me know if you have any problems. I've also added stricter typing to the related utility function, so the compiler should catch these bugs in the future. Thanks! :) |
I'm trying it out, seems to be good so far. I'll monitor it throughout the day and if everything looks good I'll consider this fixed |
Working great for me all day |
Actually, I just ran into it again. It's been working like a champ all day. When this happened, I was refreshing the page I was working on a lot, which was pulling data from infura quite a bit: Uncaught (in promise) Error: failed to meet quorum (method="getBlockNumber", params={}, results=[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113361,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734401,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":43,"_internalBlockNumber":{},"_fastBlockNumber":10113361,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118734292,"result":10113361},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734458,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118734292,"result":10113366},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113365,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736415,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10113365,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118735368,"result":10113365},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736761,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"start":1590118735368,"result":10113366}], provider={"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":-1024,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":0,"providerConfigs":[{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734458,"connection":{"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"},"_nextId":43,"apiKey":"84842078b09946638c03157f83405213","projectId":"84842078b09946638c03157f83405213","projectSecret":null,"_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113365,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736415,"baseUrl":"https://api.etherscan.io","apiKey":"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB","_internalBlockNumber":{},"_fastBlockNumber":10113365,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113366,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118736761,"connection":{"url":"https://eth-mainnet.alchemyapi.io/jsonrpc/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"},"_nextId":43,"apiKey":"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC","_internalBlockNumber":{},"_fastBlockNumber":10113366,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1},{"provider":{"_isProvider":true,"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"_network":{"name":"homestead","chainId":1,"ensAddress":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},"_maxInternalBlockNumber":10113361,"_lastBlockNumber":-2,"_events":[],"_pollingInterval":4000,"_emitted":{"block":-2},"_fastQueryDate":1590118734401,"connection":{"url":"https://cloudflare-eth.com/"},"_nextId":43,"_internalBlockNumber":{},"_fastBlockNumber":10113361,"_fastBlockNumberPromise":{}},"weight":1,"stallTimeout":750,"priority":1}],"quorum":2,"_highestBlockNumber":-1,"_internalBlockNumber":{}}, code=SERVER_ERROR, version=providers/5.0.0-beta.168)
at Logger.makeError (ethers.esm.js:260)
at Logger.throwError (ethers.esm.js:260)
at FallbackProvider.<anonymous> (ethers.esm.js:1359)
at Generator.next (<anonymous>)
at fulfilled (ethers.esm.js:1308) |
I'm running into the same issue. Calling
when using a
when using I'm using:
|
Seeing this failure as well when calling
Edit: Apologies. This was my fault... My ABI was incorrect, which causes the error. Leaving for posterity. |
This issue has come back, and it's relentless now |
What version are you running? If you don’t mind reducing security, you can reduce the quorum. By default, the mainnet quorum is 50% of the number of backends (i.e. 2 of 4). But if you reduce that to 1, you should pretty much never see this. It does mean that if a backend is out of sync, you may get out-is-sync responses. |
I am using |
Try upgrading to the latest version. That one is quite old and still beta. There have been a lot of provider improvements added. :) |
Just upgraded to
|
If I reduce the quorum to 1, will I always get an out of sync error if the blocks are out of sync? Or is there a likely possibility of actually getting incorrect block information? |
Having the same issue:
Using quorum value of 1 |
In the logs given by @AugustoL, looks like using a fallback provider with three providers (probably Actually I saw this while solving an issue for my colleague who is working on a block explorer that queries blocks, transactions, receipts in a serial fashion. In a while, first 8-10 requests success, then boom. All following request error with |
@lastmjs, I just scrolled to the right in your logs, and I saw this text |
@zemse Oh. That is good to know. Was that from the AlchemyProvider? They told me they were making some changes to their log ranges. I may have to add custom logic to the FallbackProvider to be more lenient on getLogs when the range is beyond their range... |
I'm having a hard time debugging the missing response problem I'm facing. ethers.js/packages/web/src.ts/index.ts Lines 208 to 210 in 9640e86
I'm really surprised that the RPC response can be Just someone created an issue #993 as well as #841 (comment). This shows that people are experiencing the @ricmoo Is there any chance that the response is incorrectly parsed as |
Does this request body look like a I was calling block number repeatedly in an async. const provider = new InfuraProvider();
for (let i = 0; i < 500; i++) {
provider.getBlockNumber().then(console.log);
} The above code also gives one or two |
What URL are you hitting? This usually means the Try matching your curl user agent to that of the browser you are using and you might have better luck reproducing it. I have spent days with these sorts of errors to reproduce, only to find out Cloudflare had expanded the list of user-agents they more aggressively throttle (but not with a 429, but with a non-CORS 403). This is just an example, but it may help you with your null responses. :( |
(this can probably happen even on a private parity, if you are hitting it harder than it responds and it hiccups in its server event loop) |
I’m not at a computer right now, but that definitely looks like a Uint8array filled with plain text data (all the values are less than 128), so if you try using |
The request body was containing a simple json rpc request. I narrowed this down to these errors (by console.logging inside ethers.js dist codes):
These two errors (sometimes one, sometimes the other) causes the response variable to be set as Edit: In case of infura, I found these errors that make response null:
Edit: Also these errors came while high rate RPC shooting, might not represent actual thing. Maybe I should put this console.log in the server to see the actual error that causes missing response in our server (which I currently don't have access to, so I'll do it tom with my colleague). |
Hi @ricmoo, Is it possible for ethers.js to include actual error with the missing response error? |
This should be fixed now, in the sense that errors are more readable. I'm going to close this now to help clean up some older stale issues, but please re-open if this is still an issue. Thanks! :) |
@ricmoo
The problem is that Is react-native not supported by ethers.js? |
@ppianist are you including the react-native shims? The RN platform is missing important functionality that is shimmed by them. See: https://docs.ethers.io/v5/cookbook/react-native/ Let me know if that helps. :) |
@ricmoo Thanks! It works like a charm! |
I can't seem to find much information about this error on the internets, but when I run
getLogs
I very often receive this error:What I'm trying to do is filter through ERC20 transactions from the 0 address, to get mints. This does work, but this error is thrown so often it's not very usable.
I'm using
ethers v5.0.0-beta.187
The text was updated successfully, but these errors were encountered: