lotus/extern/storage-sealing/sector_state.go

96 lines
3.5 KiB
Go
Raw Normal View History

package sealing
2020-04-06 20:23:37 +00:00
type SectorState string
2020-09-17 02:38:07 +00:00
var ExistSectorStateList = map[SectorState]struct{}{
Empty: {},
WaitDeals: {},
Packing: {},
2020-11-26 09:53:31 +00:00
GetTicket: {},
2020-09-17 02:38:07 +00:00
PreCommit1: {},
PreCommit2: {},
PreCommitting: {},
PreCommitWait: {},
WaitSeed: {},
Committing: {},
SubmitCommit: {},
CommitWait: {},
FinalizeSector: {},
Proving: {},
FailedUnrecoverable: {},
SealPreCommit1Failed: {},
SealPreCommit2Failed: {},
PreCommitFailed: {},
ComputeProofFailed: {},
CommitFailed: {},
PackingFailed: {},
FinalizeFailed: {},
DealsExpired: {},
RecoverDealIDs: {},
Faulty: {},
FaultReported: {},
FaultedFinal: {},
2021-01-14 11:44:27 +00:00
Terminating: {},
TerminateWait: {},
TerminateFinality: {},
TerminateFailed: {},
2020-09-17 02:38:07 +00:00
Removing: {},
RemoveFailed: {},
Removed: {},
}
2020-09-16 11:49:45 +00:00
const (
2020-04-06 20:23:37 +00:00
UndefinedSectorState SectorState = ""
// happy path
2020-04-06 20:23:37 +00:00
Empty SectorState = "Empty"
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
2020-09-29 07:57:36 +00:00
GetTicket SectorState = "GetTicket" // generate ticket
2020-04-06 20:23:37 +00:00
PreCommit1 SectorState = "PreCommit1" // do PreCommit1
PreCommit2 SectorState = "PreCommit2" // do PreCommit2
2020-04-06 20:23:37 +00:00
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" // compute PoRep
SubmitCommit SectorState = "SubmitCommit" // send commit message to the chain
CommitWait SectorState = "CommitWait" // wait for the commit message to land on chain
2020-04-06 20:23:37 +00:00
FinalizeSector SectorState = "FinalizeSector"
Proving SectorState = "Proving"
// error modes
FailedUnrecoverable SectorState = "FailedUnrecoverable"
SealPreCommit1Failed SectorState = "SealPreCommit1Failed"
SealPreCommit2Failed SectorState = "SealPreCommit2Failed"
PreCommitFailed SectorState = "PreCommitFailed"
ComputeProofFailed SectorState = "ComputeProofFailed"
CommitFailed SectorState = "CommitFailed"
PackingFailed SectorState = "PackingFailed" // TODO: deprecated, remove
FinalizeFailed SectorState = "FinalizeFailed"
DealsExpired SectorState = "DealsExpired"
RecoverDealIDs SectorState = "RecoverDealIDs"
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
2021-01-12 23:42:01 +00:00
Terminating SectorState = "Terminating"
TerminateWait SectorState = "TerminateWait"
TerminateFinality SectorState = "TerminateFinality"
TerminateFailed SectorState = "TerminateFailed"
2020-06-22 16:42:38 +00:00
Removing SectorState = "Removing"
RemoveFailed SectorState = "RemoveFailed"
Removed SectorState = "Removed"
)
func toStatState(st SectorState) statSectorState {
switch st {
case Empty, WaitDeals, Packing, GetTicket, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, WaitSeed, Committing, SubmitCommit, CommitWait, FinalizeSector:
return sstSealing
2021-01-14 11:44:27 +00:00
case Proving, Removed, Removing, Terminating, TerminateWait, TerminateFinality, TerminateFailed:
return sstProving
}
return sstFailed
}