Fix some aggregation bugs

This commit is contained in:
Łukasz Magiera 2021-05-17 22:51:29 +02:00
parent 2afe725933
commit ba2032c642
3 changed files with 18 additions and 3 deletions

View File

@ -188,6 +188,12 @@ func pledgeSectors(t *testing.T, ctx context.Context, miner TestStorageNode, n,
}
for len(toCheck) > 0 {
cb, err := miner.SectorCommitFlush(ctx)
require.NoError(t, err)
if cb != nil {
fmt.Printf("BATCH: %s\n", *cb)
}
for n := range toCheck {
st, err := miner.SectorsStatus(ctx, n, false)
require.NoError(t, err)

View File

@ -141,11 +141,11 @@ func (b *CommitBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
}
spt := b.todo[0].spt
proofs := make([][]byte, total)
proofs := make([][]byte, 0, total)
for id, p := range b.todo {
params.SectorNumbers.Set(uint64(id))
proofs[id] = p.proof
proofs = append(proofs, p.proof)
}
params.AggregateProof, err = b.verif.AggregateSealProofs(spt, arp, proofs)

View File

@ -11,6 +11,7 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/go-statemachine"
"github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
"github.com/filecoin-project/specs-storage/storage"
@ -457,8 +458,16 @@ func (m *Sealing) handleSubmitCommit(ctx statemachine.Context, sector SectorInfo
if err != nil {
return xerrors.Errorf("getting config: %w", err)
}
if cfg.AggregateCommits {
return ctx.Send(SectorSubmitCommitAggregate{})
nv, err := m.api.StateNetworkVersion(ctx.Context(), nil)
if err != nil {
return xerrors.Errorf("getting network version: %w", err)
}
if nv >= network.Version13 {
return ctx.Send(SectorSubmitCommitAggregate{})
}
}
tok, _, err := m.api.ChainHead(ctx.Context())