-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix for issue 4205 (optimize eth_getLogs) #4662
Conversation
@leonardchinonso rawdb read from db only, but when |
you can use another method of |
I checked out the |
By _blockReader can iterate over transactions (like in db). |
Fair enough. In that case, the changes should work for this. Any tests I need to add or rerun? |
|
||
body, err := api._blockReader.BodyWithTransactions(ctx, tx, blockHash, blockNumber) | ||
if err != nil || body == nil { | ||
return nil, fmt.Errorf("block not found %d", blockNumber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or return error message or log it
I used
rawdb.ReadCanonicalBodyWithTransactions
to get the list of Transactions associated with the block hash and number. Then used thetxLogIndex
for the particular transaction. Apart from the overhead of using theapi
compared torawdb
, I do not see any other optimization. Did I do it wrong?