Add storage-id flag to proving check
This commit is contained in:
parent
734a03cf82
commit
bfcfb199a0
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/chain/store"
|
"github.com/filecoin-project/lotus/chain/store"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
lcli "github.com/filecoin-project/lotus/cli"
|
lcli "github.com/filecoin-project/lotus/cli"
|
||||||
|
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
||||||
"github.com/filecoin-project/specs-storage/storage"
|
"github.com/filecoin-project/specs-storage/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -360,6 +361,10 @@ var provingCheckProvableCmd = &cli.Command{
|
|||||||
Name: "slow",
|
Name: "slow",
|
||||||
Usage: "run slower checks",
|
Usage: "run slower checks",
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "storage-id",
|
||||||
|
Usage: "filter sectors by storage path (path id)",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
if cctx.Args().Len() != 1 {
|
if cctx.Args().Len() != 1 {
|
||||||
@ -408,6 +413,21 @@ var provingCheckProvableCmd = &cli.Command{
|
|||||||
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
||||||
_, _ = fmt.Fprintln(tw, "deadline\tpartition\tsector\tstatus")
|
_, _ = fmt.Fprintln(tw, "deadline\tpartition\tsector\tstatus")
|
||||||
|
|
||||||
|
var filter map[abi.SectorID]struct{}
|
||||||
|
|
||||||
|
if cctx.IsSet("storage-id") {
|
||||||
|
sl, err := sapi.StorageList(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
decls := sl[stores.ID(cctx.String("storage-id"))]
|
||||||
|
|
||||||
|
filter = map[abi.SectorID]struct{}{}
|
||||||
|
for _, decl := range decls {
|
||||||
|
filter[decl.SectorID] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for parIdx, par := range partitions {
|
for parIdx, par := range partitions {
|
||||||
sectors := make(map[abi.SectorNumber]struct{})
|
sectors := make(map[abi.SectorNumber]struct{})
|
||||||
|
|
||||||
@ -418,13 +438,21 @@ var provingCheckProvableCmd = &cli.Command{
|
|||||||
|
|
||||||
var tocheck []storage.SectorRef
|
var tocheck []storage.SectorRef
|
||||||
for _, info := range sectorInfos {
|
for _, info := range sectorInfos {
|
||||||
|
si := abi.SectorID{
|
||||||
|
Miner: abi.ActorID(mid),
|
||||||
|
Number: info.SectorNumber,
|
||||||
|
}
|
||||||
|
|
||||||
|
if filter != nil {
|
||||||
|
if _, found := filter[si]; !found {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sectors[info.SectorNumber] = struct{}{}
|
sectors[info.SectorNumber] = struct{}{}
|
||||||
tocheck = append(tocheck, storage.SectorRef{
|
tocheck = append(tocheck, storage.SectorRef{
|
||||||
ProofType: info.SealProof,
|
ProofType: info.SealProof,
|
||||||
ID: abi.SectorID{
|
ID: si,
|
||||||
Miner: abi.ActorID(mid),
|
|
||||||
Number: info.SectorNumber,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1899,9 +1899,10 @@ USAGE:
|
|||||||
lotus-miner proving check [command options] <deadlineIdx>
|
lotus-miner proving check [command options] <deadlineIdx>
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--only-bad print only bad sectors (default: false)
|
--only-bad print only bad sectors (default: false)
|
||||||
--slow run slower checks (default: false)
|
--slow run slower checks (default: false)
|
||||||
--help, -h show help (default: false)
|
--storage-id value filter sectors by storage path (path id)
|
||||||
|
--help, -h show help (default: false)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user