sealing: Handle full batches correctly

This commit is contained in:
Łukasz Magiera 2021-05-19 20:34:50 +02:00
parent e088c71b9a
commit 51139361c7
3 changed files with 12 additions and 2 deletions

View File

@ -194,6 +194,11 @@ func (b *CommitBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
})
for _, info := range infos {
if len(infos) >= cfg.MaxCommitBatch {
log.Infow("commit batch full")
break
}
proofs = append(proofs, b.todo[info.Number].proof)
}
@ -232,7 +237,7 @@ func (b *CommitBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
return nil, xerrors.Errorf("sending message failed: %w", err)
}
log.Infow("Sent ProveCommitAggregate message", "cid", mcid, "from", from, "sectors", total)
log.Infow("Sent ProveCommitAggregate message", "cid", mcid, "from", from, "todo", total, "sectors", len(infos))
err = params.SectorNumbers.ForEach(func(us uint64) error {
sn := abi.SectorNumber(us)

View File

@ -172,6 +172,11 @@ func (b *PreCommitBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
deposit := big.Zero()
for _, p := range b.todo {
if len(params.Sectors) >= cfg.MaxPreCommitBatch {
log.Infow("precommit batch full")
break
}
params.Sectors = append(params.Sectors, p.pci)
deposit = big.Add(deposit, p.deposit)
}

View File

@ -183,7 +183,7 @@ func (b *TerminateBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
Sectors: toTerminate,
})
if total >= uint64(miner.AddressedSectorsMax) {
if total >= uint64(miner.AddressedSectorsMax) || total >= cfg.TerminateBatchMax {
break
}