From ad4556e020ff1dca6cc3bb11097f40e60fcea89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 9 Nov 2023 18:11:10 +0100 Subject: [PATCH 1/2] lotus miner config to entirely disable WindowPoSt --- node/builder.go | 13 ------------- node/builder_miner.go | 2 +- node/config/types.go | 7 +++++++ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/node/builder.go b/node/builder.go index efc5fc459..128a99f87 100644 --- a/node/builder.go +++ b/node/builder.go @@ -345,19 +345,6 @@ func Repo(r repo.Repo) Option { } } -func Provider(r repo.Repo) Option { - return func(settings *Settings) error { - return Options( - func(s *Settings) error { s.Base = true; return nil }, // mark Base as applied - ApplyIf(func(s *Settings) bool { return s.Config }, - Error(errors.New("the Base() option must be set before Config option")), - ), - //ApplyIf(IsType(repo.WdPost), ConfigWdPost(c)), - //ApplyIf(IsType(repo.WinPost), ConfigWinPost(c)), - )(settings) - } -} - type StopFunc func(context.Context) error // New builds and starts new Filecoin node diff --git a/node/builder_miner.go b/node/builder_miner.go index e31cbe584..4ba5f05b5 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -126,7 +126,7 @@ func ConfigStorageMiner(c interface{}) Option { Override(PreflightChecksKey, modules.PreflightChecks), Override(new(*sealing.Sealing), modules.SealingPipeline(cfg.Fees)), - Override(new(*wdpost.WindowPoStScheduler), modules.WindowPostScheduler(cfg.Fees, cfg.Proving)), + If(!cfg.Subsystems.DisableWindowPoSt, Override(new(*wdpost.WindowPoStScheduler), modules.WindowPostScheduler(cfg.Fees, cfg.Proving))), Override(new(sectorblocks.SectorBuilder), From(new(*sealing.Sealing))), ), diff --git a/node/config/types.go b/node/config/types.go index d59bb5d71..591e970b5 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -149,6 +149,13 @@ type MinerSubsystemConfig struct { SealerApiInfo string // if EnableSealing == false SectorIndexApiInfo string // if EnableSectorStorage == false + + // When window post is enabled, the miner will automatically submit window post proofs + // for all sectors that are eligible for window post + // IF WINDOW POST IS DISABLED, THE MINER WILL NOT SUBMIT WINDOW POST PROOFS + // THIS WILL RESULT IN FAULTS AND PENALTIES IF NO OTHER MECHANISM IS RUNNING + // TO SUBMIT WINDOW POST PROOFS + DisableWindowPoSt bool } type DealmakingConfig struct { From 2bb49409921899eaa33420b89561a7693951d3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 9 Nov 2023 18:22:08 +0100 Subject: [PATCH 2/2] config codegen --- documentation/en/default-lotus-miner-config.toml | 15 +++++++++++++++ node/config/doc_gen.go | 15 +++++++++++++++ node/config/types.go | 7 ++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/documentation/en/default-lotus-miner-config.toml b/documentation/en/default-lotus-miner-config.toml index 7b1d0e2e9..f7699e635 100644 --- a/documentation/en/default-lotus-miner-config.toml +++ b/documentation/en/default-lotus-miner-config.toml @@ -161,6 +161,21 @@ # env var: LOTUS_SUBSYSTEMS_SECTORINDEXAPIINFO #SectorIndexApiInfo = "" + # When window post is enabled, the miner will automatically submit window post proofs + # for all sectors that are eligible for window post + # IF WINDOW POST IS DISABLED, THE MINER WILL NOT SUBMIT WINDOW POST PROOFS + # THIS WILL RESULT IN FAULTS AND PENALTIES IF NO OTHER MECHANISM IS RUNNING + # TO SUBMIT WINDOW POST PROOFS. + # Note: This option is entirely disabling the window post scheduler, + # not just the builtin PoSt computation like Proving.DisableBuiltinWindowPoSt. + # This option will stop lotus-miner from performing any actions related + # to window post, including scheduling, submitting proofs, and recovering + # sectors. + # + # type: bool + # env var: LOTUS_SUBSYSTEMS_DISABLEWINDOWPOST + #DisableWindowPoSt = false + [Dealmaking] # When enabled, the miner can accept online deals diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index ce9d7f5b9..a65bd8746 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -962,6 +962,21 @@ This is useful to allow workers to bypass the lotus miner to access sector infor Comment: ``, }, + { + Name: "DisableWindowPoSt", + Type: "bool", + + Comment: `When window post is enabled, the miner will automatically submit window post proofs +for all sectors that are eligible for window post +IF WINDOW POST IS DISABLED, THE MINER WILL NOT SUBMIT WINDOW POST PROOFS +THIS WILL RESULT IN FAULTS AND PENALTIES IF NO OTHER MECHANISM IS RUNNING +TO SUBMIT WINDOW POST PROOFS. +Note: This option is entirely disabling the window post scheduler, +not just the builtin PoSt computation like Proving.DisableBuiltinWindowPoSt. +This option will stop lotus-miner from performing any actions related +to window post, including scheduling, submitting proofs, and recovering +sectors.`, + }, }, "ProviderSubsystemsConfig": { { diff --git a/node/config/types.go b/node/config/types.go index 591e970b5..e52549379 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -154,7 +154,12 @@ type MinerSubsystemConfig struct { // for all sectors that are eligible for window post // IF WINDOW POST IS DISABLED, THE MINER WILL NOT SUBMIT WINDOW POST PROOFS // THIS WILL RESULT IN FAULTS AND PENALTIES IF NO OTHER MECHANISM IS RUNNING - // TO SUBMIT WINDOW POST PROOFS + // TO SUBMIT WINDOW POST PROOFS. + // Note: This option is entirely disabling the window post scheduler, + // not just the builtin PoSt computation like Proving.DisableBuiltinWindowPoSt. + // This option will stop lotus-miner from performing any actions related + // to window post, including scheduling, submitting proofs, and recovering + // sectors. DisableWindowPoSt bool }