Skip to content

IPFS uploads are orphaned when the proof commit fails after upload; no content-address dedup #69

Closed

Description

@cybermax4200

Why this matters now: Wasted storage/cost and a growing set of unreferenced CIDs; also a minor correctness gap (duplicate photos re-uploaded).

Problem / What: In submitProof (proofController.ts:111-145), files are hashed, metadata-extracted, and uploaded to IPFS before the DB transaction that creates the proof. If the commit (or the subsequent enqueueVerification) fails, the CIDs already in IPFS are never cleaned up. There is also no reuse of an already-stored CID for identical content.

Key Challenges: Defining an orphan-reclamation strategy (track uploaded CIDs per request, roll back on failure, or a periodic GC job), and optionally de-duplicating via the existing sha256 uniqueness.

Acceptance Criteria:

  • A failed proof submission does not leave referenced-but-uncommitted CIDs permanently orphaned (test injects a commit failure and asserts cleanup).
  • Identical content reuses the existing CID where desired.

Relevant files/functions: src/controllers/proofController.ts:100-236, src/services/ipfsService.ts:4-34, src/middleware/upload.ts:11-30.

Out of scope: IPFS pinning policy.

Labels: advanced, reliability, bug

Activity

  1. telemarkdigital-publisher commented on Aug 21, 2026

    @telemarkdigital-publisher

    I can take this. Plan: (1) trace the submitProof upload/transaction/enqueue path, (2) add explicit cleanup or durable orphan tracking for CIDs uploaded before a failed commit/enqueue, (3) add sha256/CID reuse for identical content where the existing model supports it, and (4) cover the failure and dedup paths with focused tests. Expected verification: run the repo's backend test command, any lint/typecheck script present, and a targeted proof-controller/IPFS test if available before opening the PR.

  2. Christopherdominic commented on Aug 21, 2026

    @Christopherdominic
    Contributor

    Can I work on this issue I can raise a pr within 2 days

  3. grantfox-oss commented on Aug 21, 2026

    @grantfox-oss

    🦊 GrantFox — @Christopherdominic has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #69)
    2. Your PR will be reviewed by the ecotask-network maintainers

    Good luck! Track your progress on GrantFox.

  4. added a commit that references this issue on Aug 24, 2026
    2a06c03
  5. grantfox-oss commented on Aug 24, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @Christopherdominic's PR #98 was approved and merged by @cybermax4200.

    🏆 @Christopherdominic: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (958 total points). Track your full progress on GrantFox.

    👏 Great work, @Christopherdominic! Keep contributing to ecotask-network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions