Skip to content

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.

Sentinel Merkle Audits and Zero-WAN Self-HealingSentinel runs risk-tiered 64 KiB Merkle Proof-of-Storage challenges, feeds an anti-flap urgency queue from 60s to 24h, and repairs missing shards from local disk first before falling back to 8-of-14 P2P reconstruction.3. Sentinel Merkle Audits & Local-First Self-Healing10m audit cycle · 512 KiB/s audit cap · 2 MiB/s repair cap01 · MERKLE CHALLENGES64 KiB Block ProofsDegraded (score < 0)Every 30m · 10 shards · 100% full-fetchNew Host (< 20 passes)Every 4h · 5 shards · 20% full-fetchTrusted (>= 20 passes)Every 12h · 1 shard · 5% full-fetchPass +1 · Bad proof -10 · Timeout 0Local bans only (never gossiped)02 · URGENCY QUEUE2 Checks, 30s ApartCritical (< 8) · 60s · BypassUrgent (8-9) · 5m · BypassWatch (10-11) · 30m graceHealthy (12-13) · 24h graceUrgent/Critical bypass metered pause03 · ZERO-WAN REPAIRLocal-Source Fast PathPath A: Untouched Local DiskVerify hash in local_sources,re-encode only missing shard.0 B WAN downloadPath B: P2P Fallback (8 of 14)If moved or edited, hedge-fetchany 8 shards and RS-rebuild.2-phase crash-safe redb journal

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 AuditChallenge with a random 64 KiB (BLOCK_BYTES = 65_536) block index and 300s anti-replay timestamp (MAX_CHALLENGE_AGE_SECS). The host returns the actual 64 KiB block plus rs_merkle sibling proofs verified against StorageReceipt.sealed_audit_root. Bounded full-fetch spot checks (<= 10 per cycle, <= 2 per peer) verify the entire unwrapped object end-to-end.
  • Fair Penalties & Local-Only Bans:
    • Pass: +1 score, resets consecutive_timeouts = 0.
    • Reachable Proof Failure (corrupt bytes, invalid Merkle proof, missing shard): -10 score and immediate repair observation.
    • Unreachable Timeout / RemoteError::Evicted: 0 cryptographic penalty (offline tracking uses graduated soft/hard thresholds: Fresh 12h/24h, Mature 24h/7d).
    • score < -20 triggers a local soft ban (cleared after 3 consecutive passes); score < -50 triggers a 10-day local hard ban. Bans are never gossiped across the network.

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

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):

  1. Before downloading 8 shards from peers, try_encode_stripe_from_local_source checks whether the source file still exists on disk with matching byte length.
  2. It reads only the affected 64 MiB stripe, re-runs vault::process_chunk, and verifies every shard hash against expected_hashes.
  3. On exact match, missing shards upload straight to replacement peers with zero WAN download bandwidth (backdit_repairs_from_local_source_total).
  4. If the file moved or changed, repair seamlessly falls back to hedged 8-of-14 P2P 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.