diff --git a/.circleci/config.yml b/.circleci/config.yml index eae5e07c8..85bcd045c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1018,7 +1018,6 @@ workflows: suite: utest-unit-cli target: "./cli/... ./cmd/... ./api/..." get-params: true - executor: golang-2xl - test: name: test-unit-node requires: @@ -1026,7 +1025,6 @@ workflows: suite: utest-unit-node target: "./node/..." - - test: name: test-unit-rest requires: @@ -1034,7 +1032,6 @@ workflows: suite: utest-unit-rest target: "./blockstore/... ./build/... ./chain/... ./conformance/... ./gateway/... ./journal/... ./lib/... ./markets/... ./paychmgr/... ./provider/... ./tools/..." - executor: golang-2xl - test: name: test-unit-storage requires: @@ -1042,7 +1039,6 @@ workflows: suite: utest-unit-storage target: "./storage/... ./extern/..." - - test: go-test-flags: "-run=TestMulticoreSDR" requires: diff --git a/.circleci/template.yml b/.circleci/template.yml index 7bc84c218..2bfba9564 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -567,8 +567,6 @@ workflows: suite: utest-[[ $suite ]] target: "[[ $pkgs ]]" [[if eq $suite "unit-cli"]]get-params: true[[end]] - [[if eq $suite "unit-cli"]]executor: golang-2xl[[end]] - [[- if eq $suite "unit-rest"]]executor: golang-2xl[[end]] [[- end]] - test: go-test-flags: "-run=TestMulticoreSDR" diff --git a/cli/util/api.go b/cli/util/api.go index 7b06efdf3..3602b752d 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -119,7 +119,7 @@ func GetAPIInfoMulti(ctx *cli.Context, t repo.RepoType) ([]APIInfo, error) { } } - return []APIInfo{}, fmt.Errorf("could not determine API endpoint for node type: %v", t.Type()) + return []APIInfo{}, fmt.Errorf("could not determine API endpoint for node type: %v. Try setting environment variable: %s", t.Type(), primaryEnv) } func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) { @@ -168,7 +168,7 @@ func GetRawAPIMultiV2(ctx *cli.Context, ainfoCfg []string, version string) ([]Ht var httpHeads []HttpHead if len(ainfoCfg) == 0 { - return httpHeads, xerrors.Errorf("could not get API info: none configured. \nConsider getting base.toml with './lotus-provider config get base >base.toml' \nthen adding \n[APIs] \n FULLNODE_API_INFO = [\" result_from lotus auth api-info --perm=admin \"]\n and updating it with './lotus-provider config set base.toml'") + return httpHeads, xerrors.Errorf("could not get API info: none configured. \nConsider getting base.toml with './lotus-provider config get base >/tmp/base.toml' \nthen adding \n[APIs] \n ChainApiInfo = [\" result_from lotus auth api-info --perm=admin \"]\n and updating it with './lotus-provider config set /tmp/base.toml'") } for _, i := range ainfoCfg { ainfo := ParseApiInfo(i) diff --git a/cmd/lotus-provider/run.go b/cmd/lotus-provider/run.go index 005cb9ebf..29825f7db 100644 --- a/cmd/lotus-provider/run.go +++ b/cmd/lotus-provider/run.go @@ -204,7 +204,10 @@ var runCmd = &cli.Command{ sa, err := StorageAuth(cfg.Apis.StorageRPCSecret) if err != nil { - return xerrors.Errorf("parsing Apis.StorageRPCSecret config: %w", err) + return xerrors.Errorf(`'%w' while parsing the config toml's + [Apis] + StorageRPCSecret=%v +Get it from the JSON documents in ~/.lotus-miner/keystore called .PrivateKey`, err, cfg.Apis.StorageRPCSecret) } al := alerting.NewAlertingSystem(j) diff --git a/lib/harmony/harmonydb/sql/20230823.sql b/lib/harmony/harmonydb/sql/20230823.sql index 1865f6afe..c6f993d76 100644 --- a/lib/harmony/harmonydb/sql/20230823.sql +++ b/lib/harmony/harmonydb/sql/20230823.sql @@ -37,12 +37,12 @@ create table wdpost_proofs create table wdpost_recovery_tasks ( task_id bigint not null - constraint wdpost_partition_tasks_pk + constraint wdpost_recovery_tasks_pk primary key, sp_id bigint not null, proving_period_start bigint not null, deadline_index bigint not null, partition_index bigint not null, - constraint wdpost_partition_tasks_identity_key + constraint wdpost_recovery_tasks_identity_key unique (sp_id, proving_period_start, deadline_index, partition_index) ); \ No newline at end of file diff --git a/lib/harmony/harmonydb/sql/20231113.sql b/lib/harmony/harmonydb/sql/20231113.sql new file mode 100644 index 000000000..7a71d98ae --- /dev/null +++ b/lib/harmony/harmonydb/sql/20231113.sql @@ -0,0 +1 @@ +ALTER TABLE harmony_task_history ADD COLUMN completed_by_host_and_port varchar(300) NOT NULL; \ No newline at end of file diff --git a/lib/harmony/harmonytask/harmonytask.go b/lib/harmony/harmonytask/harmonytask.go index bb25be549..595e5b63a 100644 --- a/lib/harmony/harmonytask/harmonytask.go +++ b/lib/harmony/harmonytask/harmonytask.go @@ -106,6 +106,7 @@ type TaskEngine struct { follows map[string][]followStruct lastFollowTime time.Time lastCleanup atomic.Value + hostAndPort string } type followStruct struct { f func(TaskID, AddTaskFunc) (bool, error) @@ -129,13 +130,14 @@ func New( } ctx, grace := context.WithCancel(context.Background()) e := &TaskEngine{ - ctx: ctx, - grace: grace, - db: db, - reg: reg, - ownerID: reg.Resources.MachineID, // The current number representing "hostAndPort" - taskMap: make(map[string]*taskTypeHandler, len(impls)), - follows: make(map[string][]followStruct), + ctx: ctx, + grace: grace, + db: db, + reg: reg, + ownerID: reg.Resources.MachineID, // The current number representing "hostAndPort" + taskMap: make(map[string]*taskTypeHandler, len(impls)), + follows: make(map[string][]followStruct), + hostAndPort: hostnameAndPort, } e.lastCleanup.Store(time.Now()) for _, c := range impls { diff --git a/lib/harmony/harmonytask/task_type_handler.go b/lib/harmony/harmonytask/task_type_handler.go index 09540913d..7ec47d32a 100644 --- a/lib/harmony/harmonytask/task_type_handler.go +++ b/lib/harmony/harmonytask/task_type_handler.go @@ -198,8 +198,8 @@ func (h *taskTypeHandler) recordCompletion(tID TaskID, workStart time.Time, done } } _, err = tx.Exec(`INSERT INTO harmony_task_history - (task_id, name, posted, work_start, work_end, result, err) - VALUES ($1, $2, $3, $4, $5, $6, $7)`, tID, h.Name, postedTime, workStart, workEnd, done, result) + (task_id, name, posted, work_start, work_end, result, by_host_and_port, err) +VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`, tID, h.Name, postedTime, workStart, workEnd, done, h.TaskEngine.hostAndPort, result) if err != nil { return false, fmt.Errorf("could not write history: %w", err) } diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index a65bd8746..7d7c1eb51 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -31,10 +31,10 @@ var Doc = map[string][]DocField{ }, "ApisConfig": { { - Name: "FULLNODE_API_INFO", + Name: "ChainApiInfo", Type: "[]string", - Comment: `FULLNODE_API_INFO is the API endpoint for the Lotus daemon.`, + Comment: `ChainApiInfo is the API endpoint for the Lotus daemon.`, }, { Name: "StorageRPCSecret", diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index bd3e2fe27..d8e41fb2b 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -346,7 +346,7 @@ func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) { f, err := os.Open(p) if os.IsNotExist(err) { - return nil, ErrNoAPIEndpoint + return nil, xerrors.Errorf("No file (%s): %w", p, ErrNoAPIEndpoint) } else if err != nil { return nil, err } diff --git a/provider/lpwindow/compute_do.go b/provider/lpwindow/compute_do.go index d36541e8e..ba13cdc2b 100644 --- a/provider/lpwindow/compute_do.go +++ b/provider/lpwindow/compute_do.go @@ -3,8 +3,6 @@ package lpwindow import ( "bytes" "context" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/storage/sealer" "sort" "sync" "time" @@ -25,7 +23,9 @@ import ( proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" types "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/storage/sealer" "github.com/filecoin-project/lotus/storage/sealer/storiface" ) diff --git a/provider/lpwindow/recover_task.go b/provider/lpwindow/recover_task.go index d50fddc0e..fafe76e56 100644 --- a/provider/lpwindow/recover_task.go +++ b/provider/lpwindow/recover_task.go @@ -2,11 +2,15 @@ package lpwindow import ( "context" + + "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/dline" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" @@ -21,7 +25,6 @@ import ( "github.com/filecoin-project/lotus/storage/ctladdr" "github.com/filecoin-project/lotus/storage/sealer" "github.com/filecoin-project/lotus/storage/wdpost" - "golang.org/x/xerrors" ) type WdPostRecoverDeclareTask struct {