This repository was archived by the owner on Jan 22, 2025. It is now read-only.
adds more sanity checks to shreds#21675
Merged
behzadnouri merged 1 commit intosolana-labs:masterfrom Dec 9, 2021
Merged
Conversation
ed452ef to
4ea9de6
Compare
Codecov Report
@@ Coverage Diff @@
## master #21675 +/- ##
=========================================
- Coverage 81.6% 81.4% -0.3%
=========================================
Files 511 511
Lines 143320 143453 +133
=========================================
- Hits 116976 116795 -181
- Misses 26344 26658 +314 |
4ea9de6 to
5ddd4e9
Compare
carllin
reviewed
Dec 9, 2021
| self.common_header.fec_set_index | ||
| } | ||
|
|
||
| // Returns true if the shred sanity checks. |
Contributor
There was a problem hiding this comment.
nit: if the shred passes sanity checks
carllin
reviewed
Dec 9, 2021
| ShredType::Data => { | ||
| let parent_offset = Slot::try_from(self.data_header.parent_offset); | ||
| self.slot().checked_sub(parent_offset.ok()?) | ||
| // TODO What if parent_offset is zero and slot != 0? |
Contributor
There was a problem hiding this comment.
I think the call to this filter in window service will drop the shred
solana/core/src/window_service.rs
Line 167 in 0fd8e3c
if parent_slot >= slot {
return false;
}
carllin
previously approved these changes
Dec 9, 2021
5ddd4e9 to
0b38be9
Compare
0b38be9 to
eaca402
Compare
mergify Bot
pushed a commit
that referenced
this pull request
Dec 9, 2021
(cherry picked from commit 8063273)
Closed
mergify Bot
pushed a commit
that referenced
this pull request
Feb 1, 2022
(cherry picked from commit 8063273) # Conflicts: # ledger/src/blockstore.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
shreds inner fields need sanity checks.
Summary of Changes
added sanity checks