Remove explicit assert in Blockstore::get_slot_entries_in_block() #1258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
This is a private function and the callers should NOT be calling with an empty completed range vector. Regardless, it is safer to just return an empty Entry vector should an empty CompletedRanges be provided as input.
I was initially worried about something downstream not handling an empty
Vec<Entry>
gracefully. However, I found the concern to invalid for the two current callers ofget_slot_entries_in_block()
:agave/ledger/src/blockstore.rs
Lines 3597 to 3605 in 8a55087
Blockstore::get_entries_in_block()
iterates over the the entries, so no concerns with emptyVec
agave/ledger/src/blockstore.rs
Lines 3371 to 3397 in 8a55087
Blockstore::get_slot_entries_with_shred_info()
checks ifcompleted_ranges
is empty before callingBlockstore::get_slot_entries_in_block()
This is (long overdue) followup to this comment: solana-labs#34768 (comment)