-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Remove redundant bounds check from getBlock and getBlockTime #33901
Conversation
@CriesofCarrots - This doesn't compile yet, but I think you should be able to get the gist. Hopefully my comments inline help illustrate why I think the call to One downside is that this function is no longer self contained as it relies on checks from the actual blockstore fetch. This is obviously not ideal, but saving the creation of the two extra iterators is pretty big I think. Also, thinking on it more, we likely don't even need to check for greater than max root in the helper; we explicitly check for lower than latest root at the top level when we decide to call get_rooted_block_time() |
3ccc0b8
to
95bfeab
Compare
Assume it is more likely for someone to request a slot that has already occurred but is not on disk rather than a slot that has not occurred yet. With this, take advantage of short circuiting && operator.
95bfeab
to
a2c49c1
Compare
Codecov Report
@@ Coverage Diff @@
## master #33901 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 811 811
Lines 219332 219318 -14
=======================================
+ Hits 179703 179707 +4
+ Misses 39629 39611 -18 |
…solana-labs#33901)" This reverts commit 03a456e.
…solana-labs#33901)" This reverts commit 03a456e.
Problem
See #33859 for some additional details but the TLDR is:
rpc.rs
looks up min/max roots from the Blockstore to perform bounds check for the sake of error reportingSummary of Changes
Remove / condense code to avoid repeating checks that have already occurred. Namely,
Blockstore::is_skipped()
, which was called by these two RPC methods, has been removed as it was redundantcheck_blockstore_root() ==> check_blockstore_bounds()
and add a bunch of comments about the handling ofBlockstore
errors at the RPC level