sealer: Config for disabling builtin PoSt

This commit is contained in:
Łukasz Magiera 2022-07-01 21:24:54 +02:00
parent 0277ff4239
commit 84881f64ad
6 changed files with 71 additions and 15 deletions

View File

@ -309,12 +309,28 @@
[Proving] [Proving]
# Maximum number of sector checks to run in parallel. (0 = unlimited) # WARNING: Setting this value too high may make the node crash by running out of stack
# WARNING: Setting this value too low may make sector challenge reading much slower, resulting in failed PoSt due
# to late submission.
# #
# type: int # type: int
# env var: LOTUS_PROVING_PARALLELCHECKLIMIT # env var: LOTUS_PROVING_PARALLELCHECKLIMIT
#ParallelCheckLimit = 128 #ParallelCheckLimit = 128
# WARNING: If no windowPoSt workers are connected, window PoSt WILL FAIL resulting in faulty sectors which will need
# to be recovered. Before enabling this option, make sure your PoSt workers work correctly.
#
# type: bool
# env var: LOTUS_PROVING_DISABLEBUILTINWINDOWPOST
#DisableBuiltinWindowPoSt = false
# WARNING: If no WinningPoSt workers are connected, Winning PoSt WILL FAIL resulting in lost block rewards.
# Before enabling this option, make sure your PoSt workers work correctly.
#
# type: bool
# env var: LOTUS_PROVING_DISABLEBUILTINWINNINGPOST
#DisableBuiltinWinningPoSt = false
[Sealing] [Sealing]
# Upper bound on how many sectors can be waiting for more deals to be packed in it before it begins sealing at any given time. # Upper bound on how many sectors can be waiting for more deals to be packed in it before it begins sealing at any given time.

View File

@ -627,7 +627,23 @@ over the worker address if this flag is set.`,
Name: "ParallelCheckLimit", Name: "ParallelCheckLimit",
Type: "int", Type: "int",
Comment: `Maximum number of sector checks to run in parallel. (0 = unlimited)`, Comment: `WARNING: Setting this value too high may make the node crash by running out of stack
WARNING: Setting this value too low may make sector challenge reading much slower, resulting in failed PoSt due
to late submission.`,
},
{
Name: "DisableBuiltinWindowPoSt",
Type: "bool",
Comment: `WARNING: If no windowPoSt workers are connected, window PoSt WILL FAIL resulting in faulty sectors which will need
to be recovered. Before enabling this option, make sure your PoSt workers work correctly.`,
},
{
Name: "DisableBuiltinWinningPoSt",
Type: "bool",
Comment: `WARNING: If no WinningPoSt workers are connected, Winning PoSt WILL FAIL resulting in lost block rewards.
Before enabling this option, make sure your PoSt workers work correctly.`,
}, },
}, },
"Pubsub": []DocField{ "Pubsub": []DocField{

View File

@ -68,5 +68,7 @@ func (c *StorageMiner) StorageManager() sealer.Config {
Assigner: c.Storage.Assigner, Assigner: c.Storage.Assigner,
ParallelCheckLimit: c.Proving.ParallelCheckLimit, ParallelCheckLimit: c.Proving.ParallelCheckLimit,
DisableBuiltinWindowPoSt: c.Proving.DisableBuiltinWindowPoSt,
DisableBuiltinWinningPoSt: c.Proving.DisableBuiltinWinningPoSt,
} }
} }

View File

@ -221,9 +221,23 @@ type RetrievalPricingDefault struct {
type ProvingConfig struct { type ProvingConfig struct {
// Maximum number of sector checks to run in parallel. (0 = unlimited) // Maximum number of sector checks to run in parallel. (0 = unlimited)
//
// WARNING: Setting this value too high may make the node crash by running out of stack
// WARNING: Setting this value too low may make sector challenge reading much slower, resulting in failed PoSt due
// to late submission.
ParallelCheckLimit int ParallelCheckLimit int
// todo disable builtin post // Disable Window PoSt computation on the lotus-miner process even if no window PoSt workers are present.
//
// WARNING: If no windowPoSt workers are connected, window PoSt WILL FAIL resulting in faulty sectors which will need
// to be recovered. Before enabling this option, make sure your PoSt workers work correctly.
DisableBuiltinWindowPoSt bool
// Disable Winning PoSt computation on the lotus-miner process even if no winning PoSt workers are present.
//
// WARNING: If no WinningPoSt workers are connected, Winning PoSt WILL FAIL resulting in lost block rewards.
// Before enabling this option, make sure your PoSt workers work correctly.
DisableBuiltinWinningPoSt bool
} }
type SealingConfig struct { type SealingConfig struct {

View File

@ -70,6 +70,8 @@ type Manager struct {
work *statestore.StateStore work *statestore.StateStore
parallelCheckLimit int parallelCheckLimit int
disableBuiltinWindowPoSt bool
disableBuiltinWinningPoSt bool
disallowRemoteFinalize bool disallowRemoteFinalize bool
callToWork map[storiface.CallID]WorkID callToWork map[storiface.CallID]WorkID
@ -121,6 +123,8 @@ type Config struct {
// PoSt config // PoSt config
ParallelCheckLimit int ParallelCheckLimit int
DisableBuiltinWindowPoSt bool
DisableBuiltinWinningPoSt bool
DisallowRemoteFinalize bool DisallowRemoteFinalize bool
@ -157,6 +161,8 @@ func New(ctx context.Context, lstor *paths.Local, stor paths.Store, ls paths.Loc
localProver: prover, localProver: prover,
parallelCheckLimit: sc.ParallelCheckLimit, parallelCheckLimit: sc.ParallelCheckLimit,
disableBuiltinWindowPoSt: sc.DisableBuiltinWindowPoSt,
disableBuiltinWinningPoSt: sc.DisableBuiltinWinningPoSt,
disallowRemoteFinalize: sc.DisallowRemoteFinalize, disallowRemoteFinalize: sc.DisallowRemoteFinalize,
work: mss, work: mss,

View File

@ -17,7 +17,9 @@ import (
) )
func (m *Manager) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) { func (m *Manager) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) {
if !m.winningPoStSched.CanSched(ctx) { if !m.disableBuiltinWinningPoSt && !m.winningPoStSched.CanSched(ctx) {
// if builtin PoSt isn't disabled, and there are no workers, compute the PoSt locally
log.Info("GenerateWinningPoSt run at lotus-miner") log.Info("GenerateWinningPoSt run at lotus-miner")
return m.localProver.GenerateWinningPoSt(ctx, minerID, sectorInfo, randomness) return m.localProver.GenerateWinningPoSt(ctx, minerID, sectorInfo, randomness)
} }
@ -76,7 +78,9 @@ func (m *Manager) generateWinningPoSt(ctx context.Context, minerID abi.ActorID,
} }
func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) { func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) {
if !m.windowPoStSched.CanSched(ctx) { if !m.disableBuiltinWindowPoSt && !m.windowPoStSched.CanSched(ctx) {
// if builtin PoSt isn't disabled, and there are no workers, compute the PoSt locally
log.Info("GenerateWindowPoSt run at lotus-miner") log.Info("GenerateWindowPoSt run at lotus-miner")
return m.localProver.GenerateWindowPoSt(ctx, minerID, sectorInfo, randomness) return m.localProver.GenerateWindowPoSt(ctx, minerID, sectorInfo, randomness)
} }
@ -230,11 +234,9 @@ func (m *Manager) generatePartitionWindowPost(ctx context.Context, spt abi.Regis
} }
func (m *Manager) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]proof.PoStProof, error) { func (m *Manager) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]proof.PoStProof, error) {
//TODO implement me panic("worker-level api shouldn't be called at this level")
panic("implement me")
} }
func (m *Manager) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error) { func (m *Manager) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error) {
//TODO implement me panic("worker-level api shouldn't be called at this level")
panic("implement me")
} }