You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: simplify dataset status to two-state lifecycle (Inactive/Active)
Implement simplified dataset status system as specified in issue #169.
Replaces the 3-state system (NotFound/Active/Terminating) with a clearer
2-state system (Inactive/Active).
Key changes:
- Updated DataSetStatus enum from 3 states to 2 states (Inactive/Active)
- Status now reflects data existence, not operational state
- Inactive = Dataset doesn't exist or has no pieces
- Active = Dataset has data and proving history (including terminated)
- Updated contract logic, tests, subgraph, and documentation
BREAKING CHANGE: DataSetStatus enum values changed. Terminated datasets
are now Active (not Terminating). Check operational state using
pdpEndEpoch or isTerminated() instead.
-`Terminating` → `Active` (terminated datasets with pieces are still Active)
21
+
- Use `pdpEndEpoch` to check if a dataset is terminated
22
+
-**Details**: `Inactive` represents non-existent datasets or datasets with no pieces yet. `Active` represents all datasets with pieces, including terminated ones.
23
+
- Use `getDataSetStatusDetails()` to check termination status separately from Active/Inactive status
24
+
- Subgraph schema updated with status enum and history tracking
Copy file name to clipboardExpand all lines: service_contracts/README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,46 @@ This directory contains the smart contracts for different Filecoin services usin
29
29
-`pdp` - PDP verifier contract (from main branch)
30
30
31
31
32
+
## Dataset Status & Lifecycle
33
+
34
+
Datasets have a simplified two-state lifecycle system to track their operational status:
35
+
36
+
### Status States
37
+
38
+
-**Inactive**: Dataset doesn't exist or has no pieces added yet (rate = 0, no proving)
39
+
-**Active**: Dataset has pieces and proving history (including terminated datasets)
40
+
41
+
**Important**: Terminated datasets remain **Active** because they still have data. Status reflects data existence, not operational state. Use `pdpEndEpoch` to check if a dataset is terminated.
42
+
43
+
### Querying Status
44
+
45
+
**From Solidity:**
46
+
```solidity
47
+
import {FilecoinWarmStorageServiceStateLibrary} from "./lib/FilecoinWarmStorageServiceStateLibrary.sol";
48
+
49
+
// Get status
50
+
DataSetStatus status = FilecoinWarmStorageServiceStateLibrary.getDataSetStatus(service, dataSetId);
0 commit comments