From c663c4e70cdaa93a5cfb2760a156d85e19844a77 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Wed, 17 Jul 2024 13:37:59 +0400 Subject: [PATCH] use correct expiration in precommit --- tasks/seal/task_submit_precommit.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/seal/task_submit_precommit.go b/tasks/seal/task_submit_precommit.go index e78a4213d..fdd28f53f 100644 --- a/tasks/seal/task_submit_precommit.go +++ b/tasks/seal/task_submit_precommit.go @@ -158,6 +158,7 @@ func (s *SubmitPrecommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bo } if len(pieces) > 0 { + var endEpoch abi.ChainEpoch params.Sectors[0].UnsealedCid = &unsealedCID for _, p := range pieces { if p.DealStartEpoch > 0 && abi.ChainEpoch(p.DealStartEpoch) < head.Height() { @@ -170,10 +171,13 @@ func (s *SubmitPrecommitTask) Do(taskID harmonytask.TaskID, stillOwned func() bo } return true, xerrors.Errorf("deal start epoch is in the past") } - if p.DealEndEpoch > 0 && abi.ChainEpoch(p.DealEndEpoch) > params.Sectors[0].Expiration { - params.Sectors[0].Expiration = abi.ChainEpoch(p.DealEndEpoch) + if p.DealEndEpoch > 0 && abi.ChainEpoch(p.DealEndEpoch) > endEpoch { + endEpoch = abi.ChainEpoch(p.DealEndEpoch) } } + if endEpoch != params.Sectors[0].Expiration { + params.Sectors[0].Expiration = endEpoch + } } }