Module solana_ledger::blockstore
source · Expand description
The blockstore
module provides functions for parallel verification of the
Proof of History ledger as well as iterative read, append write, and random
access read to a persistent file-based ledger…..
Re-exports
pub use crate::blockstore_db::BlockstoreError;
pub use crate::blockstore_meta::OptimisticSlotMetaVersioned;
pub use crate::blockstore_meta::SlotMeta;
pub use crate::blockstore_metrics::BlockstoreInsertionMetrics;
pub use blockstore_purge::PurgeType;
Modules
- Properties
Structs
- A “complete data set” is a range of
Shred
s that combined in sequence carry a single serializedVec<Entry>
. - The in-memory data structure for updating entries in the column family
cf::SlotMeta
.
Enums
Constants
Functions
- For each slot in the slot_meta_working_set which has any change, include corresponding updates to cf::SlotMeta via the specified
write_batch
. Thewrite_batch
will later be atomically committed to the blockstore. - Returns the
SlotMeta
with the specifiedslot_index
. The resultingSlotMeta
could be either from the cache or from the DB. Specifically, the function: - Returns the
SlotMeta
of the specifiedslot
from the two cached states:working_set
andchained_slots
. If both contain theSlotMeta
, then the latest one from theworking_set
will be returned. - A helper function to
find_slot_meta_else_create
that searches theSlotMeta
based on the specifiedslot
indb
and updatesinsert_map
. - Obtain the SlotMeta from the in-memory slot_meta_working_set or load it from the database if it does not exist in slot_meta_working_set.
- For each entry in
working_set
whosedid_insert_occur
is true, this function handles its chaining effect by updating the SlotMeta of both the slot and its parent slot to reflect the slot descends from the parent slot. In addition, when a slot is newly connected, it also checks whether any of its direct and indirect children slots are connected or not. - A helper function of handle_chaining which handles the chaining based on the
SlotMetaWorkingSetEntry
of the specifiedslot
. Specifically, it handles the following two things: - Returns a boolean indicating whether a slot has received additional shreds that can be replayed since the previous update to the slot’s SlotMeta.
- Traverse all the children (direct and indirect) of
slot_meta
, and applyslot_function
to each of the children (but notslot_meta
).