sealing: Handle full batches correctly
This commit is contained in:
parent
e088c71b9a
commit
51139361c7
7
extern/storage-sealing/commit_batch.go
vendored
7
extern/storage-sealing/commit_batch.go
vendored
@ -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
extern/storage-sealing/precommit_batch.go
vendored
5
extern/storage-sealing/precommit_batch.go
vendored
@ -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)
|
||||
}
|
||||
|
2
extern/storage-sealing/terminate_batch.go
vendored
2
extern/storage-sealing/terminate_batch.go
vendored
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user