fn handle_chaining(
    db: &Database,
    write_batch: &mut WriteBatch<'_>,
    working_set: &mut HashMap<u64, SlotMetaWorkingSetEntry>
) -> Result<()>
Expand description

For each entry in working_set whose did_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.

This function may update column families cf::SlotMeta and cf::Orphans.

For more information about the chaining, check the previous discussion here: https://github.com/solana-labs/solana/pull/2253

Arguments:

  • db: the blockstore db that stores both shreds and their metadata.
  • write_batch: the write batch which includes all the updates of the the current write and ensures their atomicity.
  • working_set: a slot-id to SlotMetaWorkingSetEntry map. This function will remove all entries which insertion did not actually occur.