sealing: Handle full batches correctly
This commit is contained in:
+6
-1
@@ -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)
|
||||
|
||||
+5
@@ -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)
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user