-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(rpc): specialise contiguous receipt queries for logs #16441
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
base: main
Are you sure you want to change the base?
Conversation
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.
some early nits
crates/rpc/rpc/src/eth/filter.rs
Outdated
|
||
// cache miss - fallback to storage to ensure correctness | ||
if let Some(receipts) = | ||
self.filter_inner.provider().receipts_by_block(block_hash.into())? |
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.
we have this fn
reth/crates/storage/provider/src/providers/database/mod.rs
Lines 515 to 518 in badbe3d
fn receipts_by_tx_range( | |
&self, | |
range: impl RangeBounds<TxNumber>, | |
) -> ProviderResult<Vec<Self::Receipt>> { |
which I think we could adapt to return Vec of Vec for blocks as well this would likely be more efficient for entire block ranges
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.
makes sense, will prepare a separate PR for this
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.
proposed here #16449
Closes #16437
RangeMode
enum withCached
andRange
variants and types associated to eachCached
variant and specialization, fetching blocks from the cache (falling back to storage on miss)