Skip to content

Commit

Permalink
use correct expiration in precommit (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr authored Jul 17, 2024
1 parent 24b4c11 commit fadcde3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tasks/seal/task_submit_precommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
}
}
}

Expand Down

0 comments on commit fadcde3

Please sign in to comment.