Skip to content

Add an integrity check to blob list #2

Description

@rikettsie

Context

rdrop blob list shows all imported blobs and their transfer tickets, but currently does not verify that the underlying files are still present and readable on disk. This implies a blob entry becomes silently stale when the original file is deleted or moved after import, producing a ticket that will fail at transfer time (!).

Goal

Show broken blob entries at blob list time so the user knows to remove and re-import them. Expose the check as a reusable function so the daemon can apply it before serving a transfer and anywhere else it's useful before manipulating a blob.

Acceptance criteria

  • A is_blob_readable(hash) -> bool function is exposed on Node to check whether a blob's backing file is present and readable;
  • This check is "best-effort": any I/O failure accessing the file is valid to mark the blob as "broken";
  • For directory blobs, the check verifies that every file in the collection is present and readable (a single missing or unreadable file marks the whole blob as broken);
  • rdrop blob list calls this function for each entry and marks broken blobs in the output with [broken];
  • A hint is printed when at least one broken blob is found, suggesting rdrop blob remove <hash> to clean up the registry;
  • The daemon rejects any transfer requests for a broken blob with a clear error to the requesting peer, rather than failing mid-transfer;
  • Healthy blobs are unaffected in output and behaviour.

Out of scope

  • Automatic removal of broken entries;
  • Deep content verification (re-hashing the file against the stored BLAKE3 hash);
  • Watching for file changes at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement of existing function/behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions