• Findings
-
The PDS serves repository exports only through com.atproto.sync.getRepo, which opens the actor’s SQLite DB, instantiates a SqlRepoReader, and streams the CAR via writeCarStream (
packages/pds/src/api/com/atproto/sync/getRepo.ts:14-57). Because the stream is produced on the fly, no Content-Length or other size calculation is performed in this path. -
Each DAG-CBOR block that can appear in a CAR file is persisted in the actor DB’s repo_block table with an explicit size column (
packages/pds/src/actor-store/db/schema/repo-block.ts:3-8). The transactor always records the raw byte length of the block when inserting rows (packages/pds/src/actor-store/repo/sql-repo-transactor.ts:33-61), so the DB already knows the exact payload size per block. -
SqlRepoReader simply pages through those rows (respecting since) and feeds their content blobs into writeCarStream (
packages/pds/src/actor-store/repo/sql-repo-reader.ts:79-138). The only auxiliary method there, countBlocks, is unused; there is no