Skip to content

Does the order of nodes returned by getRepo (etc) matter? #872

Discussion options

You must be logged in to vote

Hey @snarfed!

When a generic CARv1 file is returned, it has a header which can indicate zero or more "root" CIDs. In the context of atproto, if there are one or more commit objects being returned, the "primary" commit (eg, the most recent or current commit for a repo), then the CID of that commit block should be the first element of the set of "root" CIDs. This gives receiving code a pointer to the "top" of the IPLD DAG.

As to the overall order of blocks, there are a couple interesting schemes for more or less efficiency in both generating and processing the repo DAG. But in general, clients/receivers probably need to be agnostic and handle any possible order of blocks.

We have a specs do…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@snarfed
Comment options

Answer selected by bnewbold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants