diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index 9ec16d436..e67bd4416 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/cmd/lotus-miner/info.go b/cmd/lotus-miner/info.go index 0d254e4f1..e8d613cd6 100644 --- a/cmd/lotus-miner/info.go +++ b/cmd/lotus-miner/info.go @@ -3,7 +3,6 @@ package main import ( "context" "fmt" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "math" corebig "math/big" "os" @@ -36,6 +35,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/reward" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/journal/alerting" ) diff --git a/documentation/en/api-v0-methods-miner.md b/documentation/en/api-v0-methods-miner.md index 5122a97aa..d46236af3 100644 --- a/documentation/en/api-v0-methods-miner.md +++ b/documentation/en/api-v0-methods-miner.md @@ -4617,6 +4617,7 @@ Response: } } }, + "Tasks": null, "Enabled": true, "MemUsedMin": 0, "MemUsedMax": 0, diff --git a/extern/sector-storage/manager_test.go b/extern/sector-storage/manager_test.go index 758d297e7..9c844292e 100644 --- a/extern/sector-storage/manager_test.go +++ b/extern/sector-storage/manager_test.go @@ -513,7 +513,7 @@ func TestRestartWorker(t *testing.T) { //stm: @WORKER_STATS_001 for { - if len(m.WorkerStats()) == 0 { + if len(m.WorkerStats(ctx)) == 0 { break } @@ -576,13 +576,13 @@ func TestReenableWorker(t *testing.T) { //stm: @WORKER_STATS_001 for i := 0; i < 100; i++ { - if !m.WorkerStats()[w.session].Enabled { + if !m.WorkerStats(ctx)[w.session].Enabled { break } time.Sleep(time.Millisecond * 3) } - require.False(t, m.WorkerStats()[w.session].Enabled) + require.False(t, m.WorkerStats(ctx)[w.session].Enabled) i, _ = m.sched.Info(ctx) require.Len(t, i.(SchedDiagInfo).OpenWindows, 0) @@ -591,13 +591,13 @@ func TestReenableWorker(t *testing.T) { atomic.StoreInt64(&w.testDisable, 0) for i := 0; i < 100; i++ { - if m.WorkerStats()[w.session].Enabled { + if m.WorkerStats(ctx)[w.session].Enabled { break } time.Sleep(time.Millisecond * 3) } - require.True(t, m.WorkerStats()[w.session].Enabled) + require.True(t, m.WorkerStats(ctx)[w.session].Enabled) for i := 0; i < 100; i++ { info, _ := m.sched.Info(ctx) @@ -653,7 +653,7 @@ func TestResUse(t *testing.T) { l: for { - st := m.WorkerStats() + st := m.WorkerStats(ctx) require.Len(t, st, 1) for _, w := range st { if w.MemUsedMax > 0 { @@ -663,7 +663,7 @@ l: } } - st := m.WorkerStats() + st := m.WorkerStats(ctx) require.Len(t, st, 1) for _, w := range st { require.Equal(t, storiface.ResourceTable[sealtasks.TTAddPiece][abi.RegisteredSealProof_StackedDrg2KiBV1].MaxMemory, w.MemUsedMax) @@ -715,7 +715,7 @@ func TestResOverride(t *testing.T) { l: for { - st := m.WorkerStats() + st := m.WorkerStats(ctx) require.Len(t, st, 1) for _, w := range st { if w.MemUsedMax > 0 { @@ -725,7 +725,7 @@ l: } } - st := m.WorkerStats() + st := m.WorkerStats(ctx) require.Len(t, st, 1) for _, w := range st { require.Equal(t, uint64(99999), w.MemUsedMax)