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
Event Filtering Query is very slow #21778
Comments
Infura has a separate log index that allows it to search logs much more quickly than a conventional node can. A conventional node has to check your queries against the bloom filters for every block, and the receipts of any blocks where there is a hit on the bloom filters. For millions of blocks, that takes a long time. My team has developed Flume - which is an open source version of Infura's log indexer. It takes a long while and several hundred gigs of disk to index all the data, but once you have the index built up responses are blazing fast. |
Do you need to search 76 days worth of logs or can you make the span a bit shorter? Can you specify how slow exactly it is on your setup? |
Some probably relevant context: the filter range is to from |
The receipt lookup is a bit suboptimal. We do use a bloom filter to deduce which blocks are even interesting. That's pretty fast. Afterwards, we need to go through the However, the initial loading of receipts is not a simple "load from disk". It's a three-step process:
So what we could do is
That would probably reduce the time, a little bit. YMMV |
I need to know the address of the latest implementation of the Upgradable Contract (OpenZeppelin Upgradable interface). I haven't find any other way to do it. So yeah basically scan the blocks from the latest
To be honest it was something well above 5/10 minutes so I stopped the query. |
System information
Geth version:
Geth is running as a daemon and is fully synced.
The server is behind a firewall so no port are accessible from the outside. Another machine will do the call on the RPC server.
OS & Version: Ubuntu 20.04
Expected behaviour
The goal is to fetch the latest implementation address for a proxy ERC-20 following OpenZeppelin Upgradable interface.
Hence the way that I found is to get the latest
Upgraded(address)
event.The code below does just that with the USDC contract (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48). It works with Infura but does not work with my local geth node.
The
BlockByHash
method was to test that the node was responding properly. The block query works almost instantly however theethereum.FilterQuery
is extremely slow and hang for a long time without response. Any advice?Actual behaviour
The query just hang for a very long time.
Steps to reproduce the behaviour
Thank you.
The text was updated successfully, but these errors were encountered: