diff --git a/cmd/lotus-storage-miner/info.go b/cmd/lotus-storage-miner/info.go index b16b4dde884..8612fa27a08 100644 --- a/cmd/lotus-storage-miner/info.go +++ b/cmd/lotus-storage-miner/info.go @@ -253,6 +253,7 @@ var stateList = []stateMeta{ {col: color.FgRed, state: sealing.UndefinedSectorState}, {col: color.FgYellow, state: sealing.Packing}, + {col: color.FgYellow, state: sealing.GetTicket}, {col: color.FgYellow, state: sealing.PreCommit1}, {col: color.FgYellow, state: sealing.PreCommit2}, {col: color.FgYellow, state: sealing.PreCommitting}, diff --git a/extern/storage-sealing/fsm.go b/extern/storage-sealing/fsm.go index cf0be4cd4ef..740e4243a4d 100644 --- a/extern/storage-sealing/fsm.go +++ b/extern/storage-sealing/fsm.go @@ -159,8 +159,12 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto on(SectorFaultReported{}, FaultReported), ), + FaultReported: final, // not really supported right now + FaultedFinal: final, Removed: final, + + FailedUnrecoverable: final, } func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(statemachine.Context, SectorInfo) error, uint64, error) { diff --git a/extern/storage-sealing/fsm_test.go b/extern/storage-sealing/fsm_test.go index 5b4541f7516..ac71588a5b8 100644 --- a/extern/storage-sealing/fsm_test.go +++ b/extern/storage-sealing/fsm_test.go @@ -160,3 +160,18 @@ func TestPlanCommittingHandlesSectorCommitFailed(t *testing.T) { require.Equal(t, CommitFailed, m.state.State) } + +func TestPlannerList(t *testing.T) { + for state := range ExistSectorStateList { + _, ok := fsmPlanners[state] + require.True(t, ok, "state %s", state) + } + + for state := range fsmPlanners { + if state == UndefinedSectorState { + continue + } + _, ok := ExistSectorStateList[state] + require.True(t, ok, "state %s", state) + } +} diff --git a/extern/storage-sealing/sector_state.go b/extern/storage-sealing/sector_state.go index 8b0bff24a70..ed32a110bff 100644 --- a/extern/storage-sealing/sector_state.go +++ b/extern/storage-sealing/sector_state.go @@ -6,6 +6,7 @@ var ExistSectorStateList = map[SectorState]struct{}{ Empty: {}, WaitDeals: {}, Packing: {}, + GetTicket: {}, PreCommit1: {}, PreCommit2: {}, PreCommitting: {}, @@ -75,7 +76,7 @@ const ( func toStatState(st SectorState) statSectorState { switch st { - case Empty, WaitDeals, Packing, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, WaitSeed, Committing, CommitWait, FinalizeSector: + case Empty, WaitDeals, Packing, GetTicket, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, WaitSeed, Committing, SubmitCommit, CommitWait, FinalizeSector: return sstSealing case Proving, Removed, Removing: return sstProving