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

Optimize eth_getLogs efficiency #303

Closed
thomas-nguy opened this issue Jul 16, 2021 · 5 comments
Closed

Optimize eth_getLogs efficiency #303

thomas-nguy opened this issue Jul 16, 2021 · 5 comments
Assignees
Labels
C:JSON-RPC JSON-RPC client enhancement New feature or request help wanted Extra attention is needed

Comments

@thomas-nguy
Copy link
Contributor

thomas-nguy commented Jul 16, 2021

Proposal:

GetLogs performance is quite bad at the moment. It will try to find logs matching the criterias by looping through all the blocks and transactions
It won't work well when the chain grow significantly.

We should use the bloom filter to avoid checking block which are tested negative.

Current behavior: [What currently happens]

Loop through all blocks/transactions/logs

Desired behavior: [What you would like to happen]

Check only blocks which bloom filter returns positive

@leejw51crypto
Copy link
Contributor

which part, can i see the source?

@thomas-nguy
Copy link
Contributor Author

thomas-nguy commented Jul 16, 2021

https://github.com/tharsis/ethermint/blob/main/ethereum/rpc/namespaces/eth/filters/filters.go#L87

It seems bloom filter is used only for single block search (when blockhash is specifiied) but not for range

@leejw51crypto
Copy link
Contributor

i see, check bloom filter for each block?

@leejw51crypto leejw51crypto added the enhancement New feature or request label Jul 16, 2021
@fedekunze
Copy link
Contributor

yeah, the whole filter API needs to be refactored, this could be a great start

@fedekunze fedekunze added C:JSON-RPC JSON-RPC client help wanted Extra attention is needed labels Jul 26, 2021
@JayT106 JayT106 self-assigned this Sep 8, 2021
@fedekunze
Copy link
Contributor

will close this one in favor of #563

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C:JSON-RPC JSON-RPC client enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants