Sentinel Audits & Self-Healing
Without active verification, silent disk rot or lazy hosts dropping shards would go unnoticed until you try to restore. Backdit pairs continuous Sentinel Merkle audits with an anti-flapping, local-first repair pipeline.
1. Risk-Tiered Merkle Proof-of-Storage Audits
Section titled “1. Risk-Tiered Merkle Proof-of-Storage Audits”Sentinel runs an initial file-health reconciliation immediately on startup, then wakes every 10 minutes (DEFAULT_AUDIT_INTERVAL with +-10% jitter), running up to 4 concurrent checks capped at 256 audits per cycle (audit_bandwidth_bytes_per_sec = 512 KiB/s default):
| Peer Risk Tier (Web UI) | Criteria | Audit Cadence | Shards / Peer | Full-Fetch Rate |
|---|---|---|---|---|
Degraded (internal Suspect) |
score < 0 |
Every 30m |
10 shards |
100% |
New Host (internal Intern) |
successful_audits < 20 |
Every 4h |
5 shards |
20% |
Trusted (internal Tenured) |
successful_audits >= 20 & score >= 0 |
Every 12h |
1 shard |
5% |
(Incoming peers that store shards on your node without holding your backups appear as Peer Client in the Nodes table.)
- Challenge Verification: Sends an
AuditChallengewith a random64 KiB(BLOCK_BYTES = 65_536) block index and300santi-replay timestamp (MAX_CHALLENGE_AGE_SECS). The host returns the actual64 KiBblock plusrs_merklesibling proofs verified againstStorageReceipt.sealed_audit_root. Bounded full-fetch spot checks (<= 10per cycle,<= 2per peer) verify the entire unwrapped object end-to-end. - Fair Penalties & Local-Only Bans:
- Pass:
+1score, resetsconsecutive_timeouts = 0. - Reachable Proof Failure (corrupt bytes, invalid Merkle proof, missing shard):
-10score and immediate repair observation. - Unreachable Timeout /
RemoteError::Evicted:0cryptographic penalty (offline tracking uses graduated soft/hard thresholds: Fresh12h/24h, Mature24h/7d). score < -20triggers a local soft ban (cleared after3consecutive passes);score < -50triggers a10-day local hard ban. Bans are never gossiped across the network.
- Pass:
2. Anti-Flapping & Urgency-Scaled Repair
Section titled “2. Anti-Flapping & Urgency-Scaled Repair”Transient network blips should not trigger expensive shard rebuilds. Before queueing a repair, StripeRepairState requires required_confirmations = 2 independent failure observations spaced by at least confirmation_spacing_secs = 30s.
| Surviving Hosts | Urgency Tier | Grace Window | Metered Mode |
|---|---|---|---|
12..=13 |
Healthy |
24h (86,400s) |
Paused |
10..=11 |
Watch |
30m (1,800s) |
Paused |
8..=9 |
Urgent |
5m (300s) |
Bypasses metered pause |
< 8 |
Critical |
60s |
Bypasses metered pause |
The repair worker polls due_repairs every 5s (max_concurrent_jobs = 2, 1 job per physical file, 2 MiB/s default repair budget) with exponential retry backoff (30s up to 6h).
3. Local-Source Zero-WAN Reconstruction
Section titled “3. Local-Source Zero-WAN Reconstruction”When you upload via CLI or Web UI Direct Local-Path, Backdit records the local filesystem path in TABLE_LOCAL_SOURCES (strictly local to metadata.redb and never published in Recovery Capsules):
- Before downloading
8shards from peers,try_encode_stripe_from_local_sourcechecks whether the source file still exists on disk with matching byte length. - It reads only the affected
64 MiBstripe, re-runsvault::process_chunk, and verifies every shard hash againstexpected_hashes. - On exact match, missing shards upload straight to replacement peers with zero WAN download bandwidth (
backdit_repairs_from_local_source_total). - If the file moved or changed, repair seamlessly falls back to hedged
8-of-14P2P reconstruction (backdit_repairs_from_p2p_total).
Every placement transition writes through an atomic redb JournalState::Prepared -> Applying -> Committed crash journal (Durability::Immediate) so mid-repair power loss never leaks orphaned commitments or skews bilateral ledgers.