Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: eth_getLogs with large block range is slow and cause OOM #858

Closed
yihuang opened this issue Dec 28, 2021 · 0 comments · Fixed by #860
Closed

Problem: eth_getLogs with large block range is slow and cause OOM #858

yihuang opened this issue Dec 28, 2021 · 0 comments · Fixed by #860

Comments

@yihuang
Copy link
Contributor

yihuang commented Dec 28, 2021

System info: ethermint main

Steps to reproduce:

Currently, the max block range of eth_getLogs is 100000, and there's not other limitation, which could be too costly for public RPC nodes, even cause OOM.

Expected behavior: make it turnable for public node

Actual behavior: too costly for public node

Additional info:

  • Infura, https://infura.io/docs/ethereum/json-rpc/eth-getLogs

    To prevent queries from consuming too many resources, eth_getLogs requests are currently limited by two constraints:
    A max of 10,000 results can be returned by a single query
    Query duration must not exceed 10 seconds

yihuang added a commit to yihuang/ethermint that referenced this issue Dec 28, 2021
Closes: evmos#858

- add limit to number of logs of filter response
- make block limit and log limit configurable
fedekunze added a commit that referenced this issue Dec 29, 2021
* fix: OOM when eth_getLogs response too large

Closes: #858

- add limit to number of logs of filter response
- make block limit and log limit configurable

* return error if exceeds log limit

* Apply suggestions from code review

* parse from config

* read cli flags

* add to config template

* fix bloomFilter

* changelog

* add validation

Co-authored-by: Federico Kunze Küllmer <[email protected]>
yihuang added a commit to yihuang/ethermint that referenced this issue Dec 31, 2021
* fix: OOM when eth_getLogs response too large

Closes: evmos#858

- add limit to number of logs of filter response
- make block limit and log limit configurable

* return error if exceeds log limit

* Apply suggestions from code review

* parse from config

* read cli flags

* add to config template

* fix bloomFilter

* changelog

* add validation

Co-authored-by: Federico Kunze Küllmer <[email protected]>
yihuang added a commit to crypto-org-chain/ethermint that referenced this issue Feb 15, 2022
* fix: OOM when eth_getLogs response too large

Closes: evmos#858

- add limit to number of logs of filter response
- make block limit and log limit configurable

* return error if exceeds log limit

* Apply suggestions from code review

* parse from config

* read cli flags

* add to config template

* fix bloomFilter

* changelog

* add validation

Co-authored-by: Federico Kunze Küllmer <[email protected]>

fix lint

Update PR url in CHANGELOG
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant