-
Notifications
You must be signed in to change notification settings - Fork 64
/
sector_states.go
109 lines (99 loc) · 2.39 KB
/
sector_states.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package gql
var (
normalSectors map[string]struct{}
normalErredSectors map[string]struct{}
snapdealsSectors map[string]struct{}
snapdealsErredSectors map[string]struct{}
allSectorStates []string
// ordered
normalSectorsList = []string{
"WaitDeals",
"AddPiece",
"Packing",
"GetTicket",
"PreCommit1",
"PreCommit2",
"PreCommitting",
"PreCommitWait",
"SubmitPreCommitBatch",
"PreCommitBatchWait",
"WaitSeed",
"Committing",
"CommitFinalize",
"CommitFinalizeFailed",
"SubmitCommit",
"CommitWait",
"SubmitCommitAggregate",
"CommitAggregateWait",
"FinalizeSector",
"Proving",
}
normalErredSectorsList = []string{
"FailedUnrecoverable",
"AddPieceFailed",
"SealPreCommit1Failed",
"SealPreCommit2Failed",
"PreCommitFailed",
"ComputeProofFailed",
"CommitFailed",
"PackingFailed",
"FinalizeFailed",
"DealsExpired",
"RecoverDealIDs",
"Faulty",
"FaultReported",
"FaultedFinal",
"Terminating",
"TerminateWait",
"TerminateFinality",
"TerminateFailed",
"Removing",
"RemoveFailed",
"Removed",
}
snapdealsSectorsList = []string{
"Available",
"SnapDealsWaitDeals",
"SnapDealsAddPiece",
"SnapDealsPacking",
"UpdateReplica",
"ProveReplicaUpdate",
"SubmitReplicaUpdate",
"ReplicaUpdateWait",
"FinalizeReplicaUpdate",
"UpdateActivating",
"ReleaseSectorKey",
}
snapdealsErredSectorsList = []string{
// snap deals error modes
"SnapDealsAddPieceFailed",
"SnapDealsDealsExpired",
"SnapDealsRecoverDealIDs",
"AbortUpgrade",
"ReplicaUpdateFailed",
"ReleaseSectorKeyFailed",
"FinalizeReplicaUpdateFailed",
}
)
func init() {
allSectorStates = append(allSectorStates, normalSectorsList...)
allSectorStates = append(allSectorStates, normalErredSectorsList...)
allSectorStates = append(allSectorStates, snapdealsSectorsList...)
allSectorStates = append(allSectorStates, snapdealsErredSectorsList...)
normalSectors = make(map[string]struct{})
normalErredSectors = make(map[string]struct{})
snapdealsSectors = make(map[string]struct{})
snapdealsErredSectors = make(map[string]struct{})
for _, s := range normalSectorsList {
normalSectors[s] = struct{}{}
}
for _, s := range normalErredSectorsList {
normalErredSectors[s] = struct{}{}
}
for _, s := range snapdealsSectorsList {
snapdealsSectors[s] = struct{}{}
}
for _, s := range snapdealsErredSectorsList {
snapdealsErredSectors[s] = struct{}{}
}
}