Skip to content

Commit

Permalink
Merge pull request #10797 from filecoin-project/sealerFlagForDataCid3
Browse files Browse the repository at this point in the history
feat: sealing: flag to run data_cid untied from addpiece
  • Loading branch information
magik6k authored May 9, 2023
2 parents 106d354 + 313c701 commit 3b4fa77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cmd/lotus-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ var runCmd = &cli.Command{
Name: "http-server-timeout",
Value: "30s",
},
&cli.BoolFlag{
Name: "data-cid",
Usage: "Run the data-cid task. true|false",
Value: true,
DefaultText: "inherits --addpiece",
},
},
Before: func(cctx *cli.Context) error {
if cctx.IsSet("address") {
Expand Down Expand Up @@ -386,8 +392,19 @@ var runCmd = &cli.Command{
}
}

ttDataCidDefault := false
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("addpiece")) && cctx.Bool("addpiece") {
taskTypes = append(taskTypes, sealtasks.TTAddPiece, sealtasks.TTDataCid)
taskTypes = append(taskTypes, sealtasks.TTAddPiece)
ttDataCidDefault = true
}
if workerType == sealtasks.WorkerSealing {
if cctx.IsSet("data-cid") {
if cctx.Bool("data-cid") {
taskTypes = append(taskTypes, sealtasks.TTDataCid)
}
} else if ttDataCidDefault {
taskTypes = append(taskTypes, sealtasks.TTDataCid)
}
}
if (workerType == sealtasks.WorkerSealing || cctx.IsSet("sector-download")) && cctx.Bool("sector-download") {
taskTypes = append(taskTypes, sealtasks.TTDownloadSector)
Expand Down
1 change: 1 addition & 0 deletions documentation/en/cli-lotus-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ USAGE:
OPTIONS:
--addpiece enable addpiece (default: true) [$LOTUS_WORKER_ADDPIECE]
--commit enable commit (default: true) [$LOTUS_WORKER_COMMIT]
--data-cid Run the data-cid task. true|false (default: inherits --addpiece)
--http-server-timeout value (default: "30s")
--listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") [$LOTUS_WORKER_LISTEN]
--name value custom worker name (default: hostname) [$LOTUS_WORKER_NAME]
Expand Down

0 comments on commit 3b4fa77

Please sign in to comment.