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 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 and the current close group proves it stores 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.

Compatibility wrapper for callers that have not adopted repair-proof tracking. It preserves the original public signature, but it has no proof table or advanced sync epoch to pass into record prune-confirmation audits. Out-of-range records are therefore marked/deferred rather than deleted via remote confirmation. The replication engine calls run_prune_pass_with_context so it can pass real repair proofs.