-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve eth_getLogs performance for latest block #5680
Comments
@Arindam2407 what we should do here is implement multiple functions that fetch the range:
lmk if anything's unclear |
@mattsse So the cache calls should be there only in those cases:
|
yes, because we assume here that the targeted block is still cached if it's near the tip. I think we can use max_blocks or |
@Arindam2407 turns out @leontiad started working on this already |
@mattsse I can take this and #5677 if @leontiad and @Arindam2407 decide to discontinue working. |
I am on that - opening a WIP PR |
take a look |
Can't push my branch, am I authed to do that? @mattsse
|
@leontiad |
Thanks!That make it work! |
Just wanting some clarification, this
Also @mattsse would you be open to adding Footnotes |
yeah latest is the highest canonical block processed by the chain |
Describe the feature
Currently we're computing the range of matching blocks of a log filter:
reth/crates/rpc/rpc/src/eth/filter.rs
Lines 173 to 181 in f15e878
and then request that range:
reth/crates/rpc/rpc/src/eth/filter.rs
Lines 442 to 447 in f15e878
this is very inefficient for filters such as
[latest,latest]
which are only interested in the latest blocks, because this range query always hits the disk when the data is always cached (EthStateCache).so we should improve this
check the range arguments
reth/crates/rpc/rpc/src/eth/filter.rs
Lines 423 to 428 in f15e878
if this is a single block and Filter's upperbound is
Latest
use the state cache to fetch the block's datalike we do for the block hash variant:
reth/crates/rpc/rpc/src/eth/filter.rs
Lines 351 to 356 in f15e878
The
get_logs_in_block_range
function argument likely needs additional info now (for the currently latest block):reth/crates/rpc/rpc/src/eth/filter.rs
Lines 133 to 134 in f15e878
cc @Arindam2407
Additional context
No response
The text was updated successfully, but these errors were encountered: