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,
    sync_state: &Arc<RwLock<NeighborSyncState>>,
    allow_remote_prune_audits: bool,
) -> PruneResult
Expand description

Execute post-cycle responsibility pruning.

For each stored record K:

  • If self is within the storage-retention group (close_group_size + STORAGE_ADMISSION_MARGIN): clear RecordOutOfRangeFirstSeen.
  • If not in that group: set timestamp if not already set; delete if the timestamp is at least PRUNE_HYSTERESIS_DURATION old and all but one of the strict current close group prove they store the record.

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 and three quarters of the current paid close group (15 of 20 at production parameters) confirm the key in their own PaidForList.

Convenience wrapper over run_prune_pass_with_context with a throwaway repair-proof table (only used to drop proofs for deleted keys) and no responder commitment state (so no commitment-retention deletion veto). The replication engine calls run_prune_pass_with_context directly.