Function: nextProvingPeriod(uint256 proofSetId, uint256 challengeEpoch, uint256, bytes)
This function can be called by the trusted PDPVerifier contract to set the next proving period. As a result, if a proof has not been provided for the current period, the current period will be counted as skipped.
Inputs
proofSetIdControl: Full control.
Constraints: No constraints.
Impact: The identifier of the proof set.
challengeEpochControl: Full control.
Constraints:
challengeEpochmust be within the nextchallengeWindow.Impact: PDPVerifier sets the desired
challengeEpoch, andnextProvingPeriodensures that this epoch falls within the nextchallengeWindow.
Branches and code coverage
Intended branches
If the current
provingDeadlines[proofSetId]is zero, the first deadline is calculated as expected.If the current
provingDeadlines[proofSetId]is not zero, the next deadline is calculated as expected.If several periods have been skipped, the next deadline is calculated as expected.
provenThisPeriod[proofSetId]is reset tofalse.If
faultPeriodsis not zero, theFaultRecordevent is emitted.If
challengeEpochis zero,provingDeadlines[proofSetId]is set to zero.
Negative behavior
The provided
challengeEpochis outside thechallengeWindow.The provided
challengeEpochis greater thanfirstDeadline.block.numberis less than the previous deadline.The caller is not a trusted PDPVerifier.