Closed Gozala closed 5 months ago
Please note: today we write these indexes on upload/add
https://github.com/w3s-project/w3up/blob/main/packages/upload-api/src/upload/add.js#L40
My first inclination was, we should remove that from upload/add
and add here. But then we break the old store/add
flow . Probably we will need to consider upload/add
to receive both CARLink as shards and multihashes and distinct what to do there? as in, one does as of today, while new writes the b58btc
encoded multihash after dataCID
What do you think @Gozala ?
I have not considered upload/add
and now I wonder if index/add
subsumes that functionality or if we do need both 🤔 In terms of what to do I see following options to choose from:
upload/add
without any shards from new clients as they will be using blob/add
& index/add
anyway.upload/add
but with RAW cid shards and than in the handler we can omit non CAR links.upload/add
, but surface things added via index/add
from upload/list
. From where I stand first option seems most rational, but given a good argument I can see a second as good candidate also. Third option seems too drastic and I would prefer to do 1st or 2nd now and consider doing 3rd in the future followup.
Thinking bit more about it I think in the future upload list should simply be a list of CBOR objects like { root: Link, parts: Link<BlobAddReceipt>[] }
where root is a DAG root and parts are receipts for it's parts. Perhaps parts
should be links to invocations instead of receipts so it could represent in-progress uploads also.
Note: we decided to not do this, and freeway uses materialized location claims instead.
Context
Freeway utilizes set of R2 buckets to provide read interface
CARPARK
- CAR file storage area. Key format<CAR_CID>/<CAR_CID>.car
SATNAV
- Indexes of block offsets within CARs. Key format<CAR_CID>/<CAR_CID>.car.idx
, index format MultihashIndexSorted.DUDEWHERE
- Mapping of root data CIDs to CAR shard CID(s). Key format<DATA_CID>/<CAR_CID>
.How it works:
DATA_CID
from URL.CAR_CID
(s) inDUDEWHERE
.SATNAV
CARPARK
using index data to locate block positions.What
Derive and write
DUDEWHERE
index records from the dag index passed into #1401Why
Otherwise uploads content uploaded through blob/add will be readable via Freeway