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.
This commit is contained in:
@@ -201,7 +201,7 @@ fn output_slot(
|
||||
println!(" Slot Meta {:?} is_full: {}", meta, is_full);
|
||||
} else {
|
||||
println!(
|
||||
" num_shreds: {}, parent_slot: {}, num_entries: {}, is_full: {}",
|
||||
" num_shreds: {}, parent_slot: {:?}, num_entries: {}, is_full: {}",
|
||||
num_shreds,
|
||||
meta.parent_slot,
|
||||
entries.len(),
|
||||
|
Reference in New Issue
Block a user