Skip to main content

run_prune_pass

Function run_prune_pass 

Source
pub async fn run_prune_pass(
    self_id: &PeerId,
    storage: &Arc<LmdbStorage>,
    paid_list: &Arc<PaidList>,
    p2p_node: &Arc<P2PNode>,
    config: &ReplicationConfig,
) -> PruneResult
Expand description

Execute post-cycle responsibility pruning.

For each stored record K:

  • If IsResponsible(self, K): clear RecordOutOfRangeFirstSeen.
  • If not responsible: set timestamp if not already set; delete if the timestamp is at least PRUNE_HYSTERESIS_DURATION old.

For each PaidForList entry K:

  • If self is in PaidCloseGroup(K): clear PaidOutOfRangeFirstSeen.
  • If not in group: set timestamp if not already set; remove entry if the timestamp is at least PRUNE_HYSTERESIS_DURATION old.