2020-04-06 18:07:26 +00:00
|
|
|
package sealing
|
|
|
|
|
2020-04-06 20:23:37 +00:00
|
|
|
type SectorState string
|
2020-04-06 18:07:26 +00:00
|
|
|
|
|
|
|
const (
|
2020-04-06 20:23:37 +00:00
|
|
|
UndefinedSectorState SectorState = ""
|
2020-04-06 18:07:26 +00:00
|
|
|
|
|
|
|
// happy path
|
2020-04-06 20:23:37 +00:00
|
|
|
Empty SectorState = "Empty"
|
2020-06-23 19:59:57 +00:00
|
|
|
WaitDeals SectorState = "WaitDeals" // waiting for more pieces (deals) to be added to the sector
|
2020-04-06 20:23:37 +00:00
|
|
|
Packing SectorState = "Packing" // sector not in sealStore, and not on chain
|
|
|
|
PreCommit1 SectorState = "PreCommit1" // do PreCommit1
|
|
|
|
PreCommit2 SectorState = "PreCommit2" // do PreCommit1
|
|
|
|
PreCommitting SectorState = "PreCommitting" // on chain pre-commit
|
2020-05-18 22:49:21 +00:00
|
|
|
PreCommitWait SectorState = "PreCommitWait" // waiting for precommit to land on chain
|
2020-04-06 20:23:37 +00:00
|
|
|
WaitSeed SectorState = "WaitSeed" // waiting for seed
|
|
|
|
Committing SectorState = "Committing"
|
|
|
|
CommitWait SectorState = "CommitWait" // waiting for message to land on chain
|
|
|
|
FinalizeSector SectorState = "FinalizeSector"
|
|
|
|
Proving SectorState = "Proving"
|
2020-04-06 18:07:26 +00:00
|
|
|
// error modes
|
2020-06-04 15:29:31 +00:00
|
|
|
FailedUnrecoverable SectorState = "FailedUnrecoverable"
|
|
|
|
SealPreCommit1Failed SectorState = "SealPreCommit1Failed"
|
|
|
|
SealPreCommit2Failed SectorState = "SealPreCommit2Failed"
|
|
|
|
PreCommitFailed SectorState = "PreCommitFailed"
|
|
|
|
ComputeProofFailed SectorState = "ComputeProofFailed"
|
|
|
|
CommitFailed SectorState = "CommitFailed"
|
|
|
|
PackingFailed SectorState = "PackingFailed"
|
|
|
|
FinalizeFailed SectorState = "FinalizeFailed"
|
2020-06-03 21:42:13 +00:00
|
|
|
|
|
|
|
Faulty SectorState = "Faulty" // sector is corrupted or gone for some reason
|
|
|
|
FaultReported SectorState = "FaultReported" // sector has been declared as a fault on chain
|
|
|
|
FaultedFinal SectorState = "FaultedFinal" // fault declared on chain
|
2020-06-22 16:42:38 +00:00
|
|
|
|
|
|
|
Removing SectorState = "Removing"
|
|
|
|
RemoveFailed SectorState = "RemoveFailed"
|
|
|
|
Removed SectorState = "Removed"
|
2020-04-06 18:07:26 +00:00
|
|
|
)
|
2020-08-18 14:54:05 +00:00
|
|
|
|
|
|
|
func toStatState(st SectorState) statSectorState {
|
|
|
|
switch st {
|
|
|
|
case Empty, WaitDeals, Packing, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, WaitSeed, Committing, CommitWait, FinalizeSector:
|
|
|
|
return sstSealing
|
|
|
|
case Proving, Removed, Removing:
|
|
|
|
return sstProving
|
|
|
|
}
|
|
|
|
|
|
|
|
return sstFailed
|
|
|
|
}
|