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-admission 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.

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.