-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
ledger/src/shred.rs
Outdated
self.common_header.fec_set_index | ||
} | ||
|
||
// Returns true if the shred sanity checks. |
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.
nit: if the shred passes sanity checks
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.
done!
ledger/src/shred.rs
Outdated
match self.shred_type() { | ||
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? |
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.
I think the call to this filter in window service will drop the shred
solana/core/src/window_service.rs
Line 167 in 0fd8e3c
Some(parent) => blockstore::verify_shred_slots(shred.slot(), parent, root), |
if parent_slot >= slot {
return false;
}
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.
done
5ddd4e9
to
0b38be9
Compare
0b38be9
to
eaca402
Compare
(cherry picked from commit 8063273)
(cherry picked from commit 8063273) Co-authored-by: behzad nouri <[email protected]>
(cherry picked from commit 8063273) # Conflicts: # ledger/src/blockstore.rs
* adds more sanity checks to shreds (#21675) (cherry picked from commit 8063273) # Conflicts: # ledger/src/blockstore.rs * removes mergify merge conflicts Co-authored-by: behzad nouri <[email protected]>
Problem
shreds inner fields need sanity checks.
Summary of Changes
added sanity checks