-
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
uses Option<Slot> for SlotMeta.parent_slot #21808
uses Option<Slot> for SlotMeta.parent_slot #21808
Conversation
SlotMeta.parent_slot for the head of a detached chain of slots is unknown and that is indicated by u64::MAX which lacks type-safety: https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205 The commit changes the type to Option<Slot>. Backward compatibility is maintained by customizing serde serialize/deserialize implementations.
Codecov Report
@@ Coverage Diff @@
## master #21808 +/- ##
=======================================
Coverage 81.3% 81.3%
=======================================
Files 515 515
Lines 144033 144029 -4
=======================================
+ Hits 117126 117149 +23
+ Misses 26907 26880 -27 |
// TODO use Option<Slot> instead. | ||
pub parent_slot: Slot, | ||
// The parent slot of the head of a detached chain of slots is None. | ||
#[serde(with = "serde_compat")] |
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.
This backwards compatibility looks good to me. cc @yhchiang-sol and @steviez for future blockstore changes
Looks good! Feel free to tag @yhchiang-sol and @steviez for future blockstore changes. They're working in this area and would like to keep abreast of developments in this area of the code |
SlotMeta.parent_slot for the head of a detached chain of slots is unknown and that is indicated by u64::MAX which lacks type-safety: https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205 The commit changes the type to Option<Slot>. Backward compatibility is maintained by customizing serde serialize/deserialize implementations. (cherry picked from commit 8d980f0) # Conflicts: # ledger-tool/src/main.rs
* uses Option<Slot> for SlotMeta.parent_slot (#21808) SlotMeta.parent_slot for the head of a detached chain of slots is unknown and that is indicated by u64::MAX which lacks type-safety: https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205 The commit changes the type to Option<Slot>. Backward compatibility is maintained by customizing serde serialize/deserialize implementations. (cherry picked from commit 8d980f0) # Conflicts: # ledger-tool/src/main.rs * removes backport merge conflicts Co-authored-by: behzad nouri <behzadnouri@gmail.com>
SlotMeta.parent_slot for the head of a detached chain of slots is unknown and that is indicated by u64::MAX which lacks type-safety: https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205 The commit changes the type to Option<Slot>. Backward compatibility is maintained by customizing serde serialize/deserialize implementations. (cherry picked from commit 8d980f0) # Conflicts: # core/src/repair_generic_traversal.rs # ledger-tool/src/main.rs # ledger/src/blockstore.rs
* uses Option<Slot> for SlotMeta.parent_slot (#21808) SlotMeta.parent_slot for the head of a detached chain of slots is unknown and that is indicated by u64::MAX which lacks type-safety: https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205 The commit changes the type to Option<Slot>. Backward compatibility is maintained by customizing serde serialize/deserialize implementations. (cherry picked from commit 8d980f0) # Conflicts: # core/src/repair_generic_traversal.rs # ledger-tool/src/main.rs # ledger/src/blockstore.rs * removes mergify merge conflicts Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Problem
SlotMeta.parent_slot for the head of a detached chain of slots is
unknown and that is indicated by u64::MAX which lacks type-safety:
https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205
Summary of Changes
The commit changes the type to Option. Backward compatibility is
maintained by customizing serde serialize/deserialize implementations.