Skip to content

Commit

Permalink
ipip-0412: clarify dups CAR parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed May 16, 2023
1 parent 63ea4ff commit e216ea9
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/ipips/ipip-0412.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ CAR flavour is returned with the response.
The proposed solution introduces two new parameters for the content type headers
in HTTP requests and responses: `order` and `dups`.

The `order` parameter allows the client to indicate its preference for a
specific block order in the CAR response, and the `dups` parameter specifies
whether duplicate blocks are allowed in the response.
The `order` parameter lets the client specify the desired block order in the
CAR response, while the `dups` parameter determines if a block is sent multiple
times when it appears more than once in the requested DAG.

### Signaling in Request

Expand Down Expand Up @@ -95,15 +95,23 @@ The `order` parameter accepts the following values:

The `dups` parameter specifies whether duplicate blocks (the same block
occuring multiple times in the requested DAG) will be present in the CAR
response.
response. Useful when a deterministic block order is used.

It accepts two values:
- `y`: duplicate blocks are allowed
- `n`: duplicates are not allowed
- `y`: Duplicate blocks MUST be sent every time they occur during the DAG walk.
- `n`: Duplicate blocks MUST be sent only once.

When allowed (`y`), light clients are able to discard blocks after
When set to `y`, light clients are able to discard blocks after
reading them, removing the need for caching in-memory or on-disk.

Setting to `n` allows for more efficient data transfer of certain types of data,
but introduces additional resource cost on the receiving end.

If the `dups` parameter is not present in the `Content-Type` header, the
behavior is unspecified, and the CAR response includes an arbitrary list of
blocks. In this case, the client should assume `n` as the default, but ignore
duplicates if they are present.

<!-- TODO: do we need a parameter for inclusion of identity CIDs?
It seems to be only relevant in Filecoin due to legacy hiccup:
https://github.com/ipfs/specs/pull/330#issuecomment-1274106892 -->
Expand Down

0 comments on commit e216ea9

Please sign in to comment.