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

eth/filters: reduce database read when handling eth_getLogs #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented Jan 11, 2024

While profiling, we see that when bloom filter hits, 1/3 CPU time in check log
match routine is used to get the corresponding block number from block hash.
This is redundant as this information is available already and can be passed via
function argument.

@minh-bq
Copy link
Contributor Author

minh-bq commented Jan 11, 2024

Before this PR, around 1/3 CPU time when GetLogs is used to rawdb.ReadHeaderNumber, the other is used to rawdb.ReadLogs
get_logs

After this PR, most of CPU time when GetLogs is used to rawdb.ReadLogs
get_logs_v2

@minh-bq minh-bq requested review from DNK90 and andicrypt January 12, 2024 03:28
@minh-bq minh-bq force-pushed the feat/improve-get-logs branch from 50f8c38 to 438af62 Compare September 25, 2024 06:34
While profiling, we see that when bloom filter hits, 1/3 CPU time in check log
match routine is used to get the corresponding block number from block hash.
This is redundant as this information is available already and can be passed via
function argument. This commit adds block number parameter to GetLogs interface
to pass the available block number information.
@minh-bq minh-bq force-pushed the feat/improve-get-logs branch from 438af62 to 15ef4fa Compare September 25, 2024 06:54
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

Successfully merging this pull request may close these issues.

1 participant