@@ -1141,43 +1141,6 @@ contract FilecoinWarmStorageService is
11411141 return (epoch - activationEpoch) / maxProvingPeriod;
11421142 }
11431143
1144- /**
1145- * @notice Checks if a specific epoch has been proven
1146- * @dev Returns true only if the epoch belongs to a proven proving period
1147- * @param dataSetId The ID of the data set to check
1148- * @param epoch The epoch to check
1149- * @return True if the epoch has been proven, false otherwise
1150- */
1151- function isEpochProven (uint256 dataSetId , uint256 epoch ) public view returns (bool ) {
1152- // Check if data set is active
1153- if (provingActivationEpoch[dataSetId] == 0 ) {
1154- return false ;
1155- }
1156-
1157- // Check if this epoch is before activation
1158- if (epoch < provingActivationEpoch[dataSetId]) {
1159- return false ;
1160- }
1161-
1162- // Check if this epoch is in the future (beyond current block)
1163- if (epoch > block .number ) {
1164- return false ;
1165- }
1166-
1167- // Get the period this epoch belongs to
1168- uint256 periodId = getProvingPeriodForEpoch (dataSetId, epoch);
1169-
1170- // Special case: current ongoing proving period
1171- uint256 currentPeriod = getProvingPeriodForEpoch (dataSetId, block .number );
1172- if (periodId == currentPeriod) {
1173- // For the current period, check if it has been proven already
1174- return provenThisPeriod[dataSetId];
1175- }
1176-
1177- // For past periods, check the provenPeriods bitmapping
1178- return 0 != provenPeriods[dataSetId][periodId >> 8 ] & (1 << (periodId & 255 ));
1179- }
1180-
11811144 function max (uint256 a , uint256 b ) internal pure returns (uint256 ) {
11821145 return a > b ? a : b;
11831146 }
@@ -1559,11 +1522,14 @@ contract FilecoinWarmStorageService is
15591522 }
15601523
15611524 function _isPeriodProven (uint256 dataSetId , uint256 periodId , uint256 currentPeriod ) private view returns (bool ) {
1562- // if (periodId == currentPeriod) {
1563- // return provenThisPeriod[dataSetId];
1564- // }
1525+ if (periodId == currentPeriod) {
1526+ return provenThisPeriod[dataSetId];
1527+ }
15651528 // return provenPeriods[dataSetId][periodId];
1566-
1529+ uint256 isProven = provenPeriods[dataSetId][periodId >> 8 ] & (1 << (periodId & 255 ));
1530+ if (isProven == 1 ){
1531+ return true ;
1532+ }
15671533 return false ;
15681534 }
15691535
0 commit comments