@@ -1172,43 +1172,6 @@ contract FilecoinWarmStorageService is
11721172 return (epoch - activationEpoch) / maxProvingPeriod;
11731173 }
11741174
1175- /**
1176- * @notice Checks if a specific epoch has been proven
1177- * @dev Returns true only if the epoch belongs to a proven proving period
1178- * @param dataSetId The ID of the data set to check
1179- * @param epoch The epoch to check
1180- * @return True if the epoch has been proven, false otherwise
1181- */
1182- function isEpochProven (uint256 dataSetId , uint256 epoch ) public view returns (bool ) {
1183- // Check if data set is active
1184- if (provingActivationEpoch[dataSetId] == 0 ) {
1185- return false ;
1186- }
1187-
1188- // Check if this epoch is before activation
1189- if (epoch < provingActivationEpoch[dataSetId]) {
1190- return false ;
1191- }
1192-
1193- // Check if this epoch is in the future (beyond current block)
1194- if (epoch > block .number ) {
1195- return false ;
1196- }
1197-
1198- // Get the period this epoch belongs to
1199- uint256 periodId = getProvingPeriodForEpoch (dataSetId, epoch);
1200-
1201- // Special case: current ongoing proving period
1202- uint256 currentPeriod = getProvingPeriodForEpoch (dataSetId, block .number );
1203- if (periodId == currentPeriod) {
1204- // For the current period, check if it has been proven already
1205- return provenThisPeriod[dataSetId];
1206- }
1207-
1208- // For past periods, check the provenPeriods bitmapping
1209- return 0 != provenPeriods[dataSetId][periodId >> 8 ] & (1 << (periodId & 255 ));
1210- }
1211-
12121175 function max (uint256 a , uint256 b ) internal pure returns (uint256 ) {
12131176 return a > b ? a : b;
12141177 }
@@ -1593,11 +1556,14 @@ contract FilecoinWarmStorageService is
15931556 }
15941557
15951558 function _isPeriodProven (uint256 dataSetId , uint256 periodId , uint256 currentPeriod ) private view returns (bool ) {
1596- // if (periodId == currentPeriod) {
1597- // return provenThisPeriod[dataSetId];
1598- // }
1559+ if (periodId == currentPeriod) {
1560+ return provenThisPeriod[dataSetId];
1561+ }
15991562 // return provenPeriods[dataSetId][periodId];
1600-
1563+ uint256 isProven = provenPeriods[dataSetId][periodId >> 8 ] & (1 << (periodId & 255 ));
1564+ if (isProven == 1 ){
1565+ return true ;
1566+ }
16011567 return false ;
16021568 }
16031569
0 commit comments