From 8c31ea1814168f3ab8ece2685d4993a2312c58b1 Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Mon, 1 May 2023 19:41:44 -0500 Subject: [PATCH 1/5] feat: sealing: data_cid flag untied from addpiece --- cmd/lotus-worker/main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index e0a9312747c..600e272bfd7 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -275,6 +275,11 @@ var runCmd = &cli.Command{ Name: "http-server-timeout", Value: "30s", }, + &cli.BoolFlag{ + Name: "data-cid", + Usage: "Run the data-cid task. --add-piece defaults this to true unless overridden", + Value: true, + }, }, Before: func(cctx *cli.Context) error { if cctx.IsSet("address") { @@ -379,8 +384,14 @@ 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 (cctx.IsSet("data-cid") && cctx.Bool("data-cid")) || + (!cctx.IsSet("data-cid") && ttDataCidDefault) { + taskTypes = append(taskTypes, sealtasks.TTDataCid) } if (workerType == sealtasks.WorkerSealing || cctx.IsSet("sector-download")) && cctx.Bool("sector-download") { taskTypes = append(taskTypes, sealtasks.TTDownloadSector) From a884bb15bdc921414d108cd25e14b1c7b266566e Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Tue, 2 May 2023 13:05:21 -0500 Subject: [PATCH 2/5] docs: lotus-worker data-cid --- documentation/en/cli-lotus-worker.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 8f6114f8a27..1d9f97baf3b 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -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. --add-piece defaults this to true unless overridden (default: true) --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] From 6a66a11e54291bbb5bcbc8a69e104e90f354fbd9 Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Mon, 8 May 2023 11:36:43 -0500 Subject: [PATCH 3/5] comment responses --- cmd/lotus-worker/main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index 600e272bfd7..8b4d7009be5 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -277,7 +277,7 @@ var runCmd = &cli.Command{ }, &cli.BoolFlag{ Name: "data-cid", - Usage: "Run the data-cid task. --add-piece defaults this to true unless overridden", + Usage: "Run the data-cid task. true|false (default: inherits --addpiece)", Value: true, }, }, @@ -389,9 +389,14 @@ var runCmd = &cli.Command{ taskTypes = append(taskTypes, sealtasks.TTAddPiece) ttDataCidDefault = true } - if (cctx.IsSet("data-cid") && cctx.Bool("data-cid")) || - (!cctx.IsSet("data-cid") && ttDataCidDefault) { - taskTypes = append(taskTypes, sealtasks.TTDataCid) + 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) From 30fae764aef37e389028e6906fe5cb7082e1418b Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Mon, 8 May 2023 12:22:25 -0500 Subject: [PATCH 4/5] doc --- cmd/lotus-worker/main.go | 7 ++++--- documentation/en/cli-lotus-worker.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index 8b4d7009be5..f1254e8483b 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -276,9 +276,10 @@ var runCmd = &cli.Command{ Value: "30s", }, &cli.BoolFlag{ - Name: "data-cid", - Usage: "Run the data-cid task. true|false (default: inherits --addpiece)", - Value: true, + Name: "data-cid", + Usage: "Run the data-cid task. true|false ", + Value: true, + DefaultText: "inherits --addpiece", }, }, Before: func(cctx *cli.Context) error { diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 1d9f97baf3b..285ddbda916 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -38,7 +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. --add-piece defaults this to true unless overridden (default: true) + --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] From 313c701be6f1f2d59ad3203faa65eb5eb5f99f9f Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Mon, 8 May 2023 15:39:47 -0500 Subject: [PATCH 5/5] nit: docs space --- cmd/lotus-worker/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index f1254e8483b..b7addbd9687 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -277,7 +277,7 @@ var runCmd = &cli.Command{ }, &cli.BoolFlag{ Name: "data-cid", - Usage: "Run the data-cid task. true|false ", + Usage: "Run the data-cid task. true|false", Value: true, DefaultText: "inherits --addpiece", },