Skip to content

feat(storage): add batch piece deletion - #898

Open
hugomrdias wants to merge 3 commits into
masterfrom
hugomrdias/551-batch-piece-deletions
Open

feat(storage): add batch piece deletion#898
hugomrdias wants to merge 3 commits into
masterfrom
hugomrdias/551-batch-piece-deletions

Conversation

@hugomrdias

@hugomrdias hugomrdias commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • add batched deletePieces and schedulePieceDeletions operations to synapse-core
  • expose StorageContext.deletePieces() while preserving the existing singular API as a compatibility wrapper
  • deduplicate IDs before signing and submission, enforce Curio batch/range limits, and preserve bigint precision in JSON requests
  • document PDPVerifier’s cumulative pending-removal limit and add core/SDK coverage

Why

The EIP-712 SchedulePieceRemovals authorization already supports multiple piece IDs, but the SDK only submitted one piece at a time. Curio PR filecoin-project/curio#1309 added a compatible pieceIds request field, allowing one authorization and one on-chain transaction to schedule up to 500 removals.

Closes #551.

Developer impact

Consumers can now call:

await context.deletePieces({ pieces: [1n, 2n, pieceCid] })

The existing deletePiece() and schedulePieceDeletion() APIs remain available and delegate to the plural implementations.

Validation

  • pnpm run build
  • pnpm test
  • pnpm run lint:fix in packages/synapse-core and packages/synapse-sdk
  • core: 836 passing
  • SDK: 277 passing, 7 pending

The root lint command still reports pre-existing accessibility errors in documentation SVG assets; no documentation assets are changed by this PR.

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jul 22, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
synapse-dev f083d5a Commit Preview URL

Branch Preview URL
Aug 06 2026, 12:06 PM

@hugomrdias
hugomrdias marked this pull request as ready for review July 22, 2026 16:49
@hugomrdias
hugomrdias requested a review from rvagg as a code owner July 22, 2026 16:49
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Jul 22, 2026
@rjan90 rjan90 added this to the M4.5: GA Fast Follows milestone Jul 22, 2026
Comment thread packages/synapse-core/src/sp/schedule-piece-deletion.ts
Comment thread packages/synapse-core/src/utils/constants.ts Outdated
Comment thread packages/synapse-sdk/src/storage/context.ts Outdated
Comment thread packages/synapse-core/src/sp/schedule-piece-deletion.ts Outdated
@hugomrdias
hugomrdias force-pushed the hugomrdias/551-batch-piece-deletions branch from b35b371 to f083d5a Compare August 6, 2026 11:56
@hugomrdias
hugomrdias requested a review from rvagg August 6, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting review

Development

Successfully merging this pull request may close these issues.

Add delete multiple pieces in one go

3 participants