From 4bdb6b34b31be33f05739b478547b69e3bc59a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 19 Apr 2023 15:43:50 +0200 Subject: [PATCH] fix: sealing pipeline: Allow nil message in TerminateWait --- storage/pipeline/states_proving.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/pipeline/states_proving.go b/storage/pipeline/states_proving.go index bed61a452..500dcab48 100644 --- a/storage/pipeline/states_proving.go +++ b/storage/pipeline/states_proving.go @@ -81,7 +81,12 @@ func (m *Sealing) handleTerminating(ctx statemachine.Context, sector SectorInfo) func (m *Sealing) handleTerminateWait(ctx statemachine.Context, sector SectorInfo) error { if sector.TerminateMessage == nil { - return xerrors.New("entered TerminateWait with nil TerminateMessage") + ts, err := m.Api.ChainHead(ctx.Context()) + if err != nil { + return ctx.Send(SectorTerminateFailed{xerrors.Errorf("getting chain head: %w", err)}) + } + + return ctx.Send(SectorTerminated{TerminatedAt: ts.Height()}) } mw, err := m.Api.StateWaitMsg(ctx.Context(), *sector.TerminateMessage, build.MessageConfidence, api.LookbackNoLimit, true)