Skip to content

Commit

Permalink
lotus-miner default config: don't allow finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
codefather-filestar committed Jun 29, 2021
1 parent fb62d28 commit 73cfbb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/lotus-storage-miner/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
AllowPreCommit2: true,
AllowCommit: true,
AllowUnseal: true,
AllowFinalize: true,
}, nil, sa, wsts, smsts)
if err != nil {
return err
Expand Down
7 changes: 6 additions & 1 deletion extern/sector-storage/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type SealerConfig struct {
AllowPreCommit2 bool
AllowCommit bool
AllowUnseal bool
AllowFinalize bool
}

type StorageAuth http.Header
Expand Down Expand Up @@ -141,7 +142,7 @@ func New(ctx context.Context, ls stores.LocalStorage, si stores.SectorIndex, sc
go m.sched.runSched()

localTasks := []sealtasks.TaskType{
sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFetch, sealtasks.TTReadUnsealed,
sealtasks.TTFetch, sealtasks.TTReadUnsealed,
}
if sc.AllowAddPiece {
localTasks = append(localTasks, sealtasks.TTAddPiece)
Expand All @@ -153,11 +154,15 @@ func New(ctx context.Context, ls stores.LocalStorage, si stores.SectorIndex, sc
localTasks = append(localTasks, sealtasks.TTPreCommit2)
}
if sc.AllowCommit {
localTasks = append(localTasks, sealtasks.TTCommit1)
localTasks = append(localTasks, sealtasks.TTCommit2)
}
if sc.AllowUnseal {
localTasks = append(localTasks, sealtasks.TTUnseal)
}
if sc.AllowFinalize {
localTasks = append(localTasks, sealtasks.TTFinalize)
}

err = m.AddWorker(ctx, NewLocalWorker(WorkerConfig{
TaskTypes: localTasks,
Expand Down
1 change: 1 addition & 0 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func DefaultStorageMiner() *StorageMiner {
AllowPreCommit2: false,
AllowCommit: false,
AllowUnseal: false,
AllowFinalize: false,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down

0 comments on commit 73cfbb8

Please sign in to comment.