From fec867539d771d98ff4a4cb58e3edef752b0fff6 Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Thu, 28 Feb 2019 12:18:11 -0700 Subject: [PATCH] More SlotMeta docs (#3011) --- src/blocktree.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/blocktree.rs b/src/blocktree.rs index 920e926e4..7c08441e3 100644 --- a/src/blocktree.rs +++ b/src/blocktree.rs @@ -123,20 +123,25 @@ pub trait LedgerColumnFamilyRaw { #[derive(Clone, Debug, Default, Deserialize, Serialize, Eq, PartialEq)] // The Meta column family pub struct SlotMeta { + // The number of slots above the root (the genesis block). The first + // slot has slot_height 0. pub slot_height: u64, - // The total number of consecutive blob starting from index 0 + // The total number of consecutive blobs starting from index 0 // we have received for this slot. pub consumed: u64, - // The entry height of the highest blob received for this slot. + // The index *plus one* of the highest blob received for this slot. Useful + // for checking if the slot has received any blobs yet, and to calculate the + // range where there is one or more holes: `(consumed..received)`. pub received: u64, - // The index of the blob that is flagged as the last blob for this slot + // The index of the blob that is flagged as the last blob for this slot. pub last_index: u64, - // The parent slot of this slot + // The slot height of the block this one derives from. pub parent_slot: u64, - // The list of slots that chains to this slot + // The list of slot heights, each of which contains a block that derives + // from this one. pub next_slots: Vec, - // True if every block from 0..slot, where slot is the slot index of this slot - // is full + // True if this slot is full (consumed == last_index + 1) and if every + // slot from 0..slot_height is also rooted. pub is_rooted: bool, }