-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Background
Currently, validateIPNIAdvertisement is checking for a 200 response from filecoinpin.contact. The response isn't inspected to confirm that a given SP is in the response.
Why this is potentially a problem
If I do filecoin-pin add foo.txt --provider-id A and then sometime later do filecoin-pin add foo.txt --provider-id B, the validateIPNIAdvertisement step will return very quickly becuase provider A will likely already exist as a provider for foo.txt's IPFS Root CID in filecoinpin.contact.
That's probably ok if foo.txt is retrievable from provider A still, but this is a bad experience if it isn't because we'd be showing a IPFS Mainnet retrieveable URL that isn't retrievable (yet).
As a result, we should give ourself the option to "validate IPNI advertisement has provider B". This means inspecting the response beyond the status code.
Notes
This kind of deeper response checking is happening in https://github.com/FilOzone/dealbot/blob/ae5619d0faf738baff524d8f9453d4c9a55dc281/src/deal-addons/strategies/ipni.strategy.ts#L341.