FILCAT / pdp

Smart contracts and utilities for Proof of Data Possession
Other
2 stars 2 forks source link

behaviour of `nextProving period` in simplePDP #65

Open irenegia opened 6 days ago

irenegia commented 6 days ago
if (!provenThisPeriod[proofSetId]) {
            uint256 periodsSkipped = 1;
            if (provingDeadlines[proofSetId] < block.number) {
                periodsSkipped = 1 + ((block.number - provingDeadlines[proofSetId]) / getMaxProvingPeriod());
            }
            emit FaultRecord(FaultType.SKIPPED, periodsSkipped);

@ZenGround0, I believe that when nextProvingPeriod is called before a proof is received, the DPD service should revert the removals done by the PDPverifier function and do nothing else. All the faults accounting should be done in the pdp service possesionProven function

cc @lucaniz

https://github.com/FILCAT/pdp/blob/14fd1c9225471aab4a517abdaf4791c8d9963fd4/contracts/src/SimplePDPService.sol#L169

anorth commented 4 days ago

I chatted with @irenegia and team about this. They're attempting to avoid a caller being marked faulty potentially unnecessarily (they made a mistake?), before the deadline has elapsed. One possible change would be to disallow this method before the deadline has passed.

This would add a little complexity and reduce freedom. At the moment I don't think it's quite worth it, but it's something to consider.