diff --git a/cmd/curio/tasks/tasks.go b/cmd/curio/tasks/tasks.go index 9e36a93c7db..a35d3d2a568 100644 --- a/cmd/curio/tasks/tasks.go +++ b/cmd/curio/tasks/tasks.go @@ -8,8 +8,6 @@ import ( "github.com/samber/lo" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/cmd/curio/deps" curio "github.com/filecoin-project/lotus/curiosrc" "github.com/filecoin-project/lotus/curiosrc/chainsched" @@ -39,20 +37,6 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps) (*harmonytask.Task si := dependencies.Si var activeTasks []harmonytask.TaskInterface - // Get all miner address from config - var miners []address.Address - for _, ad := range cfg.Addresses { - ad := ad - for _, m := range ad.MinerAddresses { - m := m - maddr, err := address.NewFromString(m) - if err != nil { - return nil, xerrors.Errorf("failed to parse the miner address: %w", err) - } - miners = append(miners, maddr) - } - } - sender, sendTask := message.NewSender(full, full, db) activeTasks = append(activeTasks, sendTask) @@ -92,7 +76,7 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps) (*harmonytask.Task { // Piece handling if cfg.Subsystems.EnableParkPiece { - parkPieceTask := piece.NewParkPieceTask(db, must.One(slrLazy.Val()), cfg.Subsystems.ParkPieceMaxTasks, miners) + parkPieceTask := piece.NewParkPieceTask(db, must.One(slrLazy.Val()), cfg.Subsystems.ParkPieceMaxTasks) cleanupPieceTask := piece.NewCleanupPieceTask(db, must.One(slrLazy.Val()), 0) activeTasks = append(activeTasks, parkPieceTask, cleanupPieceTask) } diff --git a/curiosrc/ffi/task_storage.go b/curiosrc/ffi/task_storage.go index 18973164db8..4d30eaff98c 100644 --- a/curiosrc/ffi/task_storage.go +++ b/curiosrc/ffi/task_storage.go @@ -10,6 +10,7 @@ import ( "github.com/filecoin-project/lotus/lib/harmony/harmonytask" "github.com/filecoin-project/lotus/lib/harmony/resources" + storagePaths "github.com/filecoin-project/lotus/storage/paths" "github.com/filecoin-project/lotus/storage/sealer/storiface" ) @@ -68,7 +69,7 @@ func (sb *SealCalls) Storage(taskToSectorRef func(taskID harmonytask.TaskID) (Se func (t *TaskStorage) HasCapacity() bool { ctx := context.Background() - paths, err := t.sc.sectors.sindex.StorageBestAlloc(ctx, t.alloc, t.ssize, t.pathType, abi.ActorID(0)) + paths, err := t.sc.sectors.sindex.StorageBestAlloc(ctx, t.alloc, t.ssize, t.pathType, storagePaths.NoMinerFilter) if err != nil { log.Errorf("finding best alloc in HasCapacity: %+v", err) return false diff --git a/curiosrc/piece/task_park_piece.go b/curiosrc/piece/task_park_piece.go index 22823057ecb..68a94a295a0 100644 --- a/curiosrc/piece/task_park_piece.go +++ b/curiosrc/piece/task_park_piece.go @@ -9,8 +9,6 @@ import ( logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/curiosrc/ffi" "github.com/filecoin-project/lotus/curiosrc/seal" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" @@ -34,7 +32,7 @@ type ParkPieceTask struct { max int } -func NewParkPieceTask(db *harmonydb.DB, sc *ffi.SealCalls, max int, miners []address.Address) *ParkPieceTask { +func NewParkPieceTask(db *harmonydb.DB, sc *ffi.SealCalls, max int) *ParkPieceTask { pt := &ParkPieceTask{ db: db, sc: sc, diff --git a/storage/paths/db_index.go b/storage/paths/db_index.go index 948398e331f..f79e6941d03 100644 --- a/storage/paths/db_index.go +++ b/storage/paths/db_index.go @@ -738,7 +738,7 @@ func (dbi *DBIndex) StorageBestAlloc(ctx context.Context, allocate storiface.Sec for _, row := range rows { // Matching with 0 as a workaround to avoid having minerID // present when calling TaskStorage.HasCapacity() - if !(miner == NoMinerFilter) { + if miner != NoMinerFilter { allowMiners := splitString(row.AllowMiners) denyMiners := splitString(row.DenyMiners) proceed, msg, err := MinerFilter(allowMiners, denyMiners, miner)