From 4682e72cf4e994cf082c2e956776af11a4e59b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 21 Jan 2022 10:11:04 +0100 Subject: [PATCH] Address review --- extern/sector-storage/ffiwrapper/sealer_cgo.go | 7 ++++++- extern/sector-storage/manager_post.go | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index 74d375c4d..17f31e08e 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -935,9 +935,14 @@ func (sb *Sealer) GenerateWinningPoStWithVanilla(ctx context.Context, proofType func (sb *Sealer) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof5.PoStProof, error) { pp, err := ffi.GenerateSinglePartitionWindowPoStWithVanilla(proofType, minerID, randomness, proofs, uint(partitionIdx)) - if err != nil || pp == nil { + if err != nil { return proof5.PoStProof{}, err } + if pp == nil { + // should be impossible, but just in case do not panic + return proof5.PoStProof{}, xerrors.New("postproof was nil") + } + return proof5.PoStProof{ PoStProof: pp.PoStProof, ProofBytes: pp.ProofBytes, diff --git a/extern/sector-storage/manager_post.go b/extern/sector-storage/manager_post.go index 31d8e37e7..2ce02e96e 100644 --- a/extern/sector-storage/manager_post.go +++ b/extern/sector-storage/manager_post.go @@ -111,7 +111,7 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s // ceil(sectorInfos / maxPartitionSize) partitionCount := uint64((len(sectorInfo) + int(maxPartitionSize) - 1) / int(maxPartitionSize)) - log.Infof("generateWindowPoSt maxPartitionSize:%d partitionCount:%d \n", maxPartitionSize, partitionCount) + log.Infof("generateWindowPoSt maxPartitionSize:%d partitionCount:%d", maxPartitionSize, partitionCount) var skipped []abi.SectorID var flk sync.Mutex