Import precommit batcher
This commit is contained in:
+25
-6
@@ -82,9 +82,21 @@ type SealingConfig struct {
|
||||
|
||||
AlwaysKeepUnsealedCopy bool
|
||||
|
||||
BatchPreCommits bool
|
||||
MaxPreCommitBatch int
|
||||
MinPreCommitBatch int
|
||||
PreCommitBatchWait Duration
|
||||
PreCommitBatchSlack Duration
|
||||
|
||||
AggregateCommits bool
|
||||
MinCommitBatch int
|
||||
MaxCommitBatch int
|
||||
CommitBatchWait Duration
|
||||
CommitBatchSlack Duration
|
||||
|
||||
TerminateBatchMax uint64
|
||||
TerminateBatchMin uint64
|
||||
TerminateBatchWait Duration
|
||||
|
||||
// Keep this many sectors in sealing pipeline, start CC if needed
|
||||
// todo TargetSealingSectors uint64
|
||||
@@ -242,14 +254,21 @@ func DefaultStorageMiner() *StorageMiner {
|
||||
WaitDealsDelay: Duration(time.Hour * 6),
|
||||
AlwaysKeepUnsealedCopy: true,
|
||||
|
||||
AggregateCommits: true,
|
||||
MinCommitBatch: 1, // we must have at least one proof to aggregate
|
||||
MaxCommitBatch: 204, // this is the maximum aggregation per FIP13
|
||||
CommitBatchWait: time.Day, // this can be up to 6 days
|
||||
CommitBatchSlack: 8 * time.Hour,
|
||||
BatchPreCommits: true,
|
||||
MinPreCommitBatch: 1, // we must have at least one proof to aggregate
|
||||
MaxPreCommitBatch: 204, // todo max?
|
||||
PreCommitBatchWait: Duration(24 * time.Hour), // this can be up to 6 days
|
||||
PreCommitBatchSlack: Duration(8 * time.Hour),
|
||||
|
||||
AggregateCommits: true,
|
||||
MinCommitBatch: 1, // we must have at least one proof to aggregate
|
||||
MaxCommitBatch: 204, // this is the maximum aggregation per FIP13
|
||||
CommitBatchWait: Duration(24 * time.Hour), // this can be up to 6 days
|
||||
CommitBatchSlack: Duration(8 * time.Hour),
|
||||
|
||||
TerminateBatchMin: 1,
|
||||
TerminateBatchMax: 100,
|
||||
TerminateBatchWait: 5 * time.Minute,
|
||||
TerminateBatchWait: Duration(5 * time.Minute),
|
||||
},
|
||||
|
||||
Storage: sectorstorage.SealerConfig{
|
||||
|
||||
@@ -374,6 +374,14 @@ func (sm *StorageMinerAPI) SectorTerminatePending(ctx context.Context) ([]abi.Se
|
||||
return sm.Miner.TerminatePending(ctx)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorPreCommitFlush(ctx context.Context) (*cid.Cid, error) {
|
||||
return sm.Miner.SectorPreCommitFlush(ctx)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorPreCommitPending(ctx context.Context) ([]abi.SectorID, error) {
|
||||
return sm.Miner.SectorPreCommitPending(ctx)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error {
|
||||
return sm.Miner.MarkForUpgrade(id)
|
||||
}
|
||||
|
||||
@@ -847,14 +847,22 @@ func NewGetSealConfigFunc(r repo.LockedRepo) (dtypes.GetSealingConfigFunc, error
|
||||
MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals,
|
||||
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
|
||||
AlwaysKeepUnsealedCopy: cfg.Sealing.AlwaysKeepUnsealedCopy,
|
||||
AggregateCommits: cfg.Sealing.AggregateCommits,
|
||||
MinCommitBatch: cfg.Sealing.MinCommitBatch,
|
||||
MaxCommitBatch: cfg.Sealing.MaxCommitBatch,
|
||||
CommitBatchWait: cfg.Sealing.CommitBatchWait,
|
||||
CommitBatchSlack: cfg.Sealing.CommitBatchSlack,
|
||||
TerminateBatchMax: cfg.Sealing.TerminateBatchMax,
|
||||
TerminateBatchMin: cfg.Sealing.TerminateBatchMin,
|
||||
TerminateBatchWait: cfg.Sealing.TerminateBatchWait,
|
||||
|
||||
BatchPreCommits: cfg.Sealing.BatchPreCommits,
|
||||
MinPreCommitBatch: cfg.Sealing.MinPreCommitBatch,
|
||||
MaxPreCommitBatch: cfg.Sealing.MaxPreCommitBatch,
|
||||
PreCommitBatchWait: time.Duration(cfg.Sealing.PreCommitBatchWait),
|
||||
PreCommitBatchSlack: time.Duration(cfg.Sealing.PreCommitBatchSlack),
|
||||
|
||||
AggregateCommits: cfg.Sealing.AggregateCommits,
|
||||
MinCommitBatch: cfg.Sealing.MinCommitBatch,
|
||||
MaxCommitBatch: cfg.Sealing.MaxCommitBatch,
|
||||
CommitBatchWait: time.Duration(cfg.Sealing.CommitBatchWait),
|
||||
CommitBatchSlack: time.Duration(cfg.Sealing.CommitBatchSlack),
|
||||
|
||||
TerminateBatchMax: cfg.Sealing.TerminateBatchMax,
|
||||
TerminateBatchMin: cfg.Sealing.TerminateBatchMin,
|
||||
TerminateBatchWait: time.Duration(cfg.Sealing.TerminateBatchWait),
|
||||
}
|
||||
})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user