Address review

This commit is contained in:
Łukasz Magiera 2022-01-21 10:11:04 +01:00
parent 1e5e69ec9d
commit 4682e72cf4
2 changed files with 7 additions and 2 deletions

View File

@ -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) { 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)) pp, err := ffi.GenerateSinglePartitionWindowPoStWithVanilla(proofType, minerID, randomness, proofs, uint(partitionIdx))
if err != nil || pp == nil { if err != nil {
return proof5.PoStProof{}, err 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{ return proof5.PoStProof{
PoStProof: pp.PoStProof, PoStProof: pp.PoStProof,
ProofBytes: pp.ProofBytes, ProofBytes: pp.ProofBytes,

View File

@ -111,7 +111,7 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
// ceil(sectorInfos / maxPartitionSize) // ceil(sectorInfos / maxPartitionSize)
partitionCount := uint64((len(sectorInfo) + int(maxPartitionSize) - 1) / int(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 skipped []abi.SectorID
var flk sync.Mutex var flk sync.Mutex