You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. The SP MUST provide retrieval of the IPFS/IPLD payload blocks via the [IPFS Trustless HTTP Gateway protocol](https://specs.ipfs.tech/http-gateways/trustless-gateway/).
102
101
102
+
103
+
### Retrieval Checking Process
104
+
105
+
The on-chain state does not provide any information about payload stored in a deal. Observers like
106
+
retrieval checking networks can see only miner (provider) ID, `PieceCID` and `PieceSize`. Retrieval
107
+
checkers need a way to sample payload block in a given deal. In this FRC, we assume the following algorithm leveraging IPNI:
108
+
109
+
1. Start with a tuple `(MinerID, PieceCID, PieceSize)` identifying an active storage deal (sector).
110
+
2. Map `MinerID` to IPNI index `ProviderID`.
111
+
3. Map `(PieceCID, PieceSize)` to IPNI `ContextID` value.
112
+
4. Query IPNI reverse index for a sample of payload blocks advertised by `ProviderID` with
6. Query IPNI to obtain retrieval providers for the selected payload CID.
117
+
7. Find the record advertised by the SP under test using the `Provider.ID` field.
118
+
8. Request the payload CID at the advertised address.
119
+
103
120
### Retrieval Checking Requirements
104
121
105
122
In addition to the above [retrieval requirements](#retrieval-requirements), SPs are asked to meet the following:
@@ -281,11 +298,47 @@ Not applicable, but see the examples in [Specification](#specification).
281
298
## Security Considerations
282
299
<!--All FIPs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. FIP submissions missing the "Security Considerations" section will be rejected. A FIP cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.-->
283
300
284
-
301
+
(1)
285
302
286
303
We trust SPs to honestly advertise Piece payload blocks to IPNI. Attack vector: a malicious SP can always advertise the same payload block for all pieces persisted.
287
304
288
-
TODO: describe our plan to mitigate this risk.
305
+
We see this as a broader problem with the lack of trust & verifiability in the IPNI architecture.
306
+
How can the network verify that parties storing content (Filecoin SPs, IPFS nodes) are honestly advertising
307
+
all content?
308
+
309
+
To flag Filecoin SPs that are not advertising all deal payload, we can build a small network of validator nodes performing the following algorithm:
310
+
311
+
1. Let's assume the maximum CAR block size is 4 MB and we have deal's `PieceCID` and `PieceSize`.
312
+
313
+
_(E.g. validators can walk IPNI advertisement chains and extract piece information by parsing `ContextID`.)_
314
+
315
+
2. Pick a random offset $o$ in the piece so that $0 <= o <= PieceSize - (2*4 MB)$.
316
+
317
+
3. Send an HTTP range-retrieval request to retrieve the bytes in the range $[o, o+(2*4MB)]$.
318
+
319
+
_We need the server to return an inclusion proof up to the PieceCID root._
320
+
321
+
4. Parse the bytes to find a sequence that looks like a CARv1 block header.
322
+
323
+
5. Extract the CID from the CARv1 block header.
324
+
325
+
6. Hash the block's payload bytes and verify that the digest equals to the CID.
326
+
327
+
7. Verify that the discovered payload CID was advertised to IPNI.
328
+
329
+
8. If the payload CID was not advertised, then submit a report flagging the SP and include the following information:
330
+
- Provider identification, PieceCID, PieceSize,
331
+
- Byte range requested
332
+
- Server response (the inclusion proof)
333
+
- Offset of the CARv1 block header and the payload CID discovered
334
+
335
+
9. Collect and aggregate these records to produce a reputation score for each SP.
336
+
337
+
10. Implement incentives penalizing non-compliant SPs. In the extreme, IPNI can even de-list
338
+
non-compliant index providers.
339
+
340
+
341
+
(2)
289
342
290
343
Free-rider problem when a piece is stored with more than one SP.
291
344
Attack vector: When a piece is stored with SP1 and SP2, then SP1 can advertise retrievals with metadata pointing to SP2's multiaddr.
@@ -342,8 +395,7 @@ The service-level indicators produced by retrieval checker networks can be integ
342
395
## TODO
343
396
<!--A section that lists any unresolved issues or tasks that are part of the FIP proposal. Examples of these include performing benchmarking to know gas fees, validate claims made in the FIP once the final implementation is ready, etc. A FIP can only move to a “Last Call” status once all these items have been resolved.-->
344
397
345
-
How do we want to mitigate the following attack vector(s):
346
-
- We trust SPs to honestly advertise Piece payload blocks to IPNI.
398
+
- Find out whether Venus Droplet supports retrieval using [IPFS Trustless HTTP Gateway protocol](https://specs.ipfs.tech/http-gateways/trustless-gateway/).
347
399
348
400
## Copyright
349
401
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
0 commit comments