Conversation
Keep the existing sourceUrl field and also accept optional urls and
provider {host, cids}. The receiving provider assembles these into the
same per-URL pull item list used today.
Co-authored-by: andy <andy@minimintfarm.com>
Return a clear validation error whenever cids are supplied without a host, including when other source URLs are also present. Co-authored-by: andy <andy@minimintfarm.com>
pieces[] stays the current {pieceCid, sourceUrl} form. urls and
provider live at the top level so there is no nested plural under
pieces. The receiving provider still assembles them into the same
per-URL pull item list.
Co-authored-by: andy <andy@minimintfarm.com>
snadrus
marked this pull request as ready for review
September 9, 2026 23:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1252
Summary
POST /pdp/piece/pullstill accepts the currentpieces: [{pieceCid, sourceUrl}]form. Additional sources are top-level so there is no nested plural underpieces[]:{ "pieces": [ { "pieceCid": "<CommP-v2-CID>", "sourceUrl": "https://example.com/piece/bafy..." } ], "urls": ["https://backup.example.com/piece/bafy..."], "provider": { "host": "sp.example.com", "cids": ["<optional-retrieval-CID>"] } }All three fields are optional. Curio assembles them into the same per-URL pull item list used today.
urlsentries must end in/piece/{cid}; the CID is taken from the path.https://{host}/piece/{cid}.provider.cidsis omitted, piece CIDs already collected frompiecesandurlsare used.provider.cidswithoutprovider.hostis rejected.Test plan
AssembledSources()covers legacypieces, top-levelurls, provider host/cids, host fallback to known CIDs, JSON form, and de-dupeprovider.cidswithoutprovider.hostreturns an errorgo test ./pdp -tags skifffor the non-DB pull cases)