You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cache: wire iroh-blobs GC into runtime — partial-import bytes (hash-mismatch, mid-stream cap breach) currently leak disk indefinitely #518
After #271 landed (streaming origin pull-through), the cache engine commits a partial blob to iroh-blobs whenever the origin stream errors mid-flight (cap breach, idle timeout, decoder failure) or when the upstream returns bytes whose BLAKE3 doesn't match the requested hash. The pull_through path drops the resulting TempTag without promoting it to a named tag, so iroh-blobs treats the bytes as unprotected and GC-eligible — but the deCDN node does not currently run iroh-blobs GC.
Verified: zero invocations of iroh_blobs::store::gc::run_gc / gc_run_once / equivalent in crates/cache or crates/node (grep -r 'gc_' crates/). Until GC is wired into the runtime, every mid-stream failure strands disk bytes for the lifetime of the process — and likely across restarts (FsStore persists).
Threat model
A hostile origin can amplify disk usage:
Stream max_blob_size_mb - 1 of garbage, then close the connection / send a body cap breach. The bytes are committed under whatever hash they accidentally produce, dropped from TempTag, and sit on disk.
Repeat. Each iteration adds ~max_blob_size_mb of garbage to the blob store. Default cap is 1 GB; a few thousand requests fill the disk.
Cache-poisoning component is mitigated at the engine layer (#271 PR4 added `self.evict(actual)` on hash mismatch so `engine.has(actual)` returns false), but the bytes still occupy disk and `Blobs::has(actual)` would return true to any direct iroh-blobs consumer.
Acceptance
iroh-blobs GC runs on a scheduled interval (configurable, default e.g. 5 min) inside the `decdn-node` runtime.
Manual `decdn admin cache gc` admin RPC for on-demand reclamation.
Test: stream a known-bad-hash response, assert `Blobs::has(actual_hash)` becomes false within one GC interval.
Activity
fixup(cache): rename gc counter fields; clarify gc-interval bound (#518)
fixup(cache): correct gc cycle-break docs + orphan ratio framing (#518)
feat(cache): wire iroh-blobs GC into runtime (#518) (#521)
fix(cache): restore mid-stream retry classification (#519) (#526)