diff --git a/extern/storage-sealing/commit_batch.go b/extern/storage-sealing/commit_batch.go index 72a56e797..f1cbb15ad 100644 --- a/extern/storage-sealing/commit_batch.go +++ b/extern/storage-sealing/commit_batch.go @@ -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) diff --git a/extern/storage-sealing/precommit_batch.go b/extern/storage-sealing/precommit_batch.go index 4430fdda9..f16e5c5ee 100644 --- a/extern/storage-sealing/precommit_batch.go +++ b/extern/storage-sealing/precommit_batch.go @@ -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) } diff --git a/extern/storage-sealing/terminate_batch.go b/extern/storage-sealing/terminate_batch.go index 2bb2dc76a..d545f443f 100644 --- a/extern/storage-sealing/terminate_batch.go +++ b/extern/storage-sealing/terminate_batch.go @@ -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 }