-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IPIP-0461: Ipfs-Path-Affinity on Gateways
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
title: "IPIP-0462: Ipfs-Path-Affinity on Gateways" | ||
date: 2024-02-16 | ||
ipip: proposal | ||
editors: | ||
- name: Marcin Rataj | ||
github: lidel | ||
url: https://lidel.org/ | ||
affiliation: | ||
name: IP Shipyard | ||
url: https://ipshipyard.com | ||
relatedIssues: | ||
- https://github.com/ipfs/kubo/issues/10251 | ||
- https://github.com/ipfs/kubo/issues/8676 | ||
order: 462 | ||
tags: ['ipips'] | ||
--- | ||
|
||
## Summary | ||
|
||
This IPIP adds gateway support for optional `Ipfs-Path-Affinity` HTTP request header. | ||
|
||
## Motivation | ||
|
||
Endpoints that implement :cite[trustless-gateway] may receive requests for a | ||
single block, or a CAR request sub-DAG of a biger tree. | ||
|
||
Not every CID is announced today, some providers limit announcements to | ||
top-level root CIDs due to time and cost. | ||
|
||
What this mean for ecosystem? It should adapt. Over time, both clients and | ||
servers should leverage the concept of "affinity". | ||
|
||
## Detailed design | ||
|
||
Introduce `Ipfs-Path-Affinity` HTTP request header to allow HTTP client to | ||
inform gateway about the context of block/CAR request. | ||
|
||
Client asking gateway for a block SHOULD provide a hint about the DAG the block | ||
belongs to, if such information is available. | ||
|
||
Gateway being unable to find providers for internal block should be | ||
able to leverage affinity information sent by client and use CIDs of parent | ||
path segments as additional content routing lookup hints. | ||
|
||
## Design rationale | ||
|
||
### User benefit | ||
|
||
When supported by both client and server: | ||
|
||
- Light clients are able to use trustless HTTP gateway endpoints more | ||
efficiently, resume downloads faster. | ||
- Gateway operators are able to leverage the hint and save resources related to | ||
provider lookup. | ||
- Content providers are able to implement smarter announcement mechanisms, | ||
without worrying that internal blocks are not announced. | ||
|
||
### Compatibility | ||
|
||
This is an optional HTTP header which makes it backward-compatible with | ||
existing ecosystem of HTTP clients and IPGS Gateways. | ||
|
||
### Security | ||
|
||
The client is in control when the affinity information is sent in the header, | ||
and implementation SHOULD allow end user to disable it in context where parent | ||
content path information is considered sensitive information. | ||
|
||
### Alternatives | ||
|
||
N/A | ||
|
||
## Test fixtures | ||
|
||
N/A | ||
|
||
### Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |