Skip to content

PDPVerifier compatibility broken after extsload refactor #163

@rvagg

Description

@rvagg

Specifically, we need to conform to IPDPProvingSchedule to make a PDP server (Curio) happy:

  1. PDPVerifier stores a listener address for each data set (FilecoinWarmStorageService) as instructed by the client
  2. Curio retrieves this listener address via pdpVerifier.GetDataSetListener(dataSetId)
  3. Curio then binds this listener address as an IPDPProvingSchedule interface
  4. Curio calls these methods on the listener:
  • getMaxProvingPeriod() - to know the proving period duration
  • challengeWindow() - to know the challenge window size
  • nextChallengeWindowStart(setId) - to calculate timing
  • initChallengeWindowStart() - for initialisation
  • getChallengesPerProof() - 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 on FilecoinWarmStorageService and teach Curio to use that to find its IPDPProvingSchedule (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

No labels
No labels

Type

No type

Projects

Status

🎉 Done

Relationships

None yet

Development

No branches or pull requests

Issue actions