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
proofSetId
Control: Full control.
Constraints: No constraints.
Impact: The identifier of the proof set.
challengeEpoch
Control: Full control.
Constraints:
challengeEpoch
must be within the nextchallengeWindow
.Impact: PDPVerifier sets the desired
challengeEpoch
, andnextProvingPeriod
ensures 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
faultPeriods
is not zero, theFaultRecord
event is emitted.If
challengeEpoch
is zero,provingDeadlines[proofSetId]
is set to zero.
Negative behavior
The provided
challengeEpoch
is outside thechallengeWindow
.The provided
challengeEpoch
is greater thanfirstDeadline
.block.number
is less than the previous deadline.The caller is not a trusted PDPVerifier.