-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Specifically, we need to conform to IPDPProvingSchedule
to make a PDP server (Curio) happy:
PDPVerifier
stores a listener address for each data set (FilecoinWarmStorageService
) as instructed by the client- Curio retrieves this listener address via
pdpVerifier.GetDataSetListener(dataSetId)
- Curio then binds this listener address as an
IPDPProvingSchedule
interface - Curio calls these methods on the listener:
getMaxProvingPeriod()
- to know the proving period durationchallengeWindow()
- to know the challenge window sizenextChallengeWindowStart(setId)
- to calculate timinginitChallengeWindowStart()
- for initialisationgetChallengesPerProof()
- to know how many challenges needed
We currently need to provide the writable FilecoinWarmStorageService
address as the listener (we tell Curio this is the recordKeeper
for our data set when we make one), and it gets calls from PDPVerifier
, so it has to be our writable contract. Unfortunately, these methods got moved over to FilecoinWarmStorageServiceStateView
in our refactor, so they're no longer available and we no longer conform to IPDPProvingSchedule
and Curio can't figure out what to do.
So we have to come up with a way to make this all work again.
- Put those methods back and somehow bind that interface so we know we're not going to break in future, and just accept these are necessary bloat?
- Pass two contract addresses to Curio, read/write? (this would be very trusting of Curio to accept but we are already talking about whitelisting).
- Expose a
getViewAddress()
method or similar onFilecoinWarmStorageService
and teach Curio to use that to find itsIPDPProvingSchedule
(this would be neat for the SDK too so we don't have to hardcode two addresses). - Some other creative solution.
Additionally, this exposes an error condition that has no way of feeding back to the client and as far as the client is concerned it succeeds. PDPVerifier says "yep, all good, you have a data set now with that listener", but Curio realises too late that it can't talk to this listener to figure out what it needs.
I think we could achieve a basic check in PDPVerifier
?
if (listenerAddr != address(0)) {
try IPDPProvingSchedule(listenerAddr).getMaxProvingPeriod() returns (uint64) {
// goodo, this smells right
} catch {
revert("Listener must implement IPDPProvingSchedule");
}
}
Curio could probably also do the same thing before it even gets there, but I think that IPDPProvingSchedule
is a PDPVerifier
opinion so a check in there makes sense.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status