diff --git a/cmd/lotus-provider/run.go b/cmd/lotus-provider/run.go index 24241eab1..6c3a191e8 100644 --- a/cmd/lotus-provider/run.go +++ b/cmd/lotus-provider/run.go @@ -10,7 +10,6 @@ import ( "github.com/gin-contrib/pprof" "github.com/gin-gonic/gin" - "github.com/ipfs/go-datastore/namespace" "github.com/pkg/errors" "github.com/urfave/cli/v2" "go.opencensus.io/stats" @@ -19,8 +18,6 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc/auth" - "github.com/filecoin-project/go-statestore" - "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" lcli "github.com/filecoin-project/lotus/cli" @@ -254,24 +251,13 @@ var runCmd = &cli.Command{ return err } + // todo fetch limit config stor := paths.NewRemote(lstor, si, http.Header(sa), 10, &paths.DefaultPartialFileHandler{}) - mds, err := lr.Datastore(ctx, "/metadata") - if err != nil { - return err - } - wsts := statestore.New(namespace.Wrap(mds, modules.WorkerCallsPrefix)) - smsts := statestore.New(namespace.Wrap(mds, modules.ManagerWorkPrefix)) - sealer, err := sealer.New(ctx, lstor, stor, lr, si, cfg.SealerConfig, config.ProvingConfig{}, wsts, smsts) - if err != nil { - return err - } - - //ds, dsCloser, err := modules.DatastoreV2(ctx, false, lr) - if err != nil { - return err - } - //defer dsCloser() + // todo localWorker isn't the abstraction layer we want to use here, we probably want to go straight to ffiwrapper + // maybe with a lotus-provider specific abstraction. LocalWorker does persistent call tracking which we probably + // don't need (ehh.. maybe we do, the async callback system may actually work decently well with harmonytask) + lw := sealer.NewLocalWorker(sealer.WorkerConfig{}, stor, localStore, si, nil, nil) var maddrs []dtypes.MinerAddress for _, s := range cfg.Addresses.MinerAddresses { @@ -283,8 +269,8 @@ var runCmd = &cli.Command{ } if cfg.Subsystems.EnableWindowPost { - wdPostTask, err := provider.WindowPostScheduler(ctx, cfg.Fees, cfg.Proving, full, sealer, verif, j, - as, maddrs, db, cfg.Subsystems.WindowPostMaxTasks) + wdPostTask, err := provider.WindowPostScheduler(ctx, cfg.Fees, cfg.Proving, full, verif, lw, + as, maddrs, db, stor, si) if err != nil { return err } diff --git a/provider/lpwindow/task.go b/provider/lpwindow/task.go index e3cfa017b..67d6c328c 100644 --- a/provider/lpwindow/task.go +++ b/provider/lpwindow/task.go @@ -375,8 +375,7 @@ func (t *WdPostTask) addTaskToDB(taskId harmonytask.TaskID, taskIdent wdTaskIden sp_id, proving_period_start, deadline_index, - partition_index, - + partition_index ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10 , $11, $12, $13, $14)`, taskId, taskIdent.Sp_id,