Skip to content

feat(pdp): add find_piece_ids_by_cid for efficient CID→ID lookup - #26

Merged
anjor merged 1 commit into
mainfrom
feat/port-find-piece-ids-by-cid
Apr 18, 2026
Merged

feat(pdp): add find_piece_ids_by_cid for efficient CID→ID lookup#26
anjor merged 1 commit into
mainfrom
feat/port-find-piece-ids-by-cid

Conversation

@anjor

@anjor anjor commented Apr 18, 2026

Copy link
Copy Markdown
Owner

Summary

Mirrors FilOzone/synapse-sdk#718.

Adds a direct on-chain findPieceIdsByCid call on both SyncPDPVerifier and AsyncPDPVerifier so callers can resolve a PieceCID to piece IDs in O(1) rather than scanning getActivePieces (which pages and fails on large datasets).

Signature:

pdp_verifier.find_piece_ids_by_cid(data_set_id, piece_cid, start_piece_id=0, limit=1) -> List[int]

Test plan

  • uv run pytest — 86 passed (2 new).

Mirrors FilOzone/synapse-sdk#718. Adds a direct on-chain
findPieceIdsByCid call on SyncPDPVerifier and AsyncPDPVerifier so
callers can resolve a PieceCID to piece IDs in O(1) rather than
scanning getActivePieces (which pages and fails on large datasets).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant