-
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
Fix ledger-tool bigtable compare blocks #34373
Fix ledger-tool bigtable compare blocks #34373
Conversation
2fb7520
to
da3eacd
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34373 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 819 819
Lines 220919 220919
=======================================
+ Hits 180853 180874 +21
+ Misses 40066 40045 -21 |
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.
In general, things look pretty good to me. And I think it is a very nice improvement to return the superfluous slots too; the reference table could certainly be off as well so good to report all differences.
Just one or two minor things, I'm not dead set on either of them and I'd be happy with the PR as-is if you agree. I'll wait for you respond before giving a ship it tho
da3eacd
to
a86eb7e
Compare
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.
LGTM!
Problem
We received a report of
solana-ledger-tool bigtable compare-blocks
returning a list of missing blocks that did actually appear to be present when queried withsolana-ledger-tool bigtable block
.Upon deeper investigation, we discovered that the owned bigtable contained 12 extra blocks that weren't finalized and uploaded to the reference bigtable.
The reason for the erroneous response is that the
compare-blocks
method assumes that the responses fromget_confirmed_blocks()
against both bigtables represent the same slot range. But this is not the case.get_confirmed_blocks()
accepts a starting slot and a limit and always returns the same number of blocks if the bigtable instance holds that many. Thus if one bigtable contains blocks that are not present in the other, it will examine a small range of slots.Also, it's unfortunate that there was no indication about the extra blocks.
Summary of Changes
last_block
to limit the lists returned from both bigtables to ensure comparing identical slot ranges. This prevents the error described above.