From f2ef006abd582a8c0c6ed21e7b5795f5faf9fc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 11 Nov 2023 12:19:58 +0100 Subject: [PATCH] lotus-miner: add config for disabling winning post --- node/builder_miner.go | 8 ++++++-- node/config/types.go | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/node/builder_miner.go b/node/builder_miner.go index 4ba5f05b5..dd35c6bec 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -121,8 +121,12 @@ func ConfigStorageMiner(c interface{}) Option { // Mining / proving Override(new(*slashfilter.SlashFilter), modules.NewSlashFilter), - Override(new(*miner.Miner), modules.SetupBlockProducer), - Override(new(gen.WinningPoStProver), storage.NewWinningPoStProver), + + If(!cfg.Subsystems.DisableWinningPoSt, + Override(new(*miner.Miner), modules.SetupBlockProducer), + Override(new(gen.WinningPoStProver), storage.NewWinningPoStProver), + ), + Override(PreflightChecksKey, modules.PreflightChecks), Override(new(*sealing.Sealing), modules.SealingPipeline(cfg.Fees)), diff --git a/node/config/types.go b/node/config/types.go index 172de1d7d..2152e0795 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -162,6 +162,13 @@ type MinerSubsystemConfig struct { // to window post, including scheduling, submitting proofs, and recovering // sectors. DisableWindowPoSt bool + + // When winning post is disabled, the miner process will NOT attempt to mine + // blocks. This should only be set when there's an external process mining + // blocks on behalf of the miner. + // When disabled and no external block producers are configured, all potential + // block rewards will be missed! + DisableWinningPoSt bool } type DealmakingConfig struct {