Skip to content
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

Optimize ERC20 retrieval by using Filters #41

Open
medvedev1088 opened this issue May 15, 2018 · 3 comments
Open

Optimize ERC20 retrieval by using Filters #41

medvedev1088 opened this issue May 15, 2018 · 3 comments

Comments

@medvedev1088
Copy link

medvedev1088 commented May 15, 2018

Using log filters instead of retrieving transaction receipts significantly improves performance of ERC20 retrieval https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterlogs

My tests show 100x improvement for some blocks. Here is an example implementation in python https://github.com/medvedev1088/ethereum-etl/blob/88fd6792707fa8c0fdfd5ff199bc3ff44b9a1aae/ethereumetl/jobs.py#L155

@xiaoyao1991
Copy link
Owner

Good point. I didn't choose to implement that way because Infura does not support this API call yet.

@medvedev1088
Copy link
Author

medvedev1088 commented May 16, 2018

What do you think about ERC20RetrievalStrategy with 2 implementations ReceiptRetrievalStrategy, LogFilterRetrievalStrategy? It can be configured with a property, erc20.retrieval-strategy=receipt|log-filter|auto.

BTW, do you know if Infura have plans to add support for filter APIs?

@xiaoyao1991
Copy link
Owner

I like that.

I don't know if Infura will support filter APIs. It's kinda hard cuz having filters makes their API stateful.

@medvedev1088 medvedev1088 changed the title Use web3j.ethNewFilter() and web3j.ethGetFilterLogs() to improve ERC20 retrieval performance Optimize ERC20 retrieval by using Filters May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants