Skip to content

Commit

Permalink
sealer: Config for disabling builtin PoSt
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jul 1, 2022
1 parent 0277ff4 commit 84881f6
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 15 deletions.
18 changes: 17 additions & 1 deletion documentation/en/default-lotus-miner-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,28 @@


[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
# env var: LOTUS_PROVING_PARALLELCHECKLIMIT
#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]
# 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.
Expand Down
18 changes: 17 additions & 1 deletion node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion node/config/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func (c *StorageMiner) StorageManager() sealer.Config {

Assigner: c.Storage.Assigner,

ParallelCheckLimit: c.Proving.ParallelCheckLimit,
ParallelCheckLimit: c.Proving.ParallelCheckLimit,
DisableBuiltinWindowPoSt: c.Proving.DisableBuiltinWindowPoSt,
DisableBuiltinWinningPoSt: c.Proving.DisableBuiltinWinningPoSt,
}
}
16 changes: 15 additions & 1 deletion node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,23 @@ type RetrievalPricingDefault struct {

type ProvingConfig struct {
// 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

// 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 {
Expand Down
16 changes: 11 additions & 5 deletions storage/sealer/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ type Manager struct {
workLk sync.Mutex
work *statestore.StateStore

parallelCheckLimit int
disallowRemoteFinalize bool
parallelCheckLimit int
disableBuiltinWindowPoSt bool
disableBuiltinWinningPoSt bool
disallowRemoteFinalize bool

callToWork map[storiface.CallID]WorkID
// used when we get an early return and there's no callToWork mapping
Expand Down Expand Up @@ -120,7 +122,9 @@ type Config struct {
ResourceFiltering ResourceFilteringStrategy

// PoSt config
ParallelCheckLimit int
ParallelCheckLimit int
DisableBuiltinWindowPoSt bool
DisableBuiltinWinningPoSt bool

DisallowRemoteFinalize bool

Expand Down Expand Up @@ -156,8 +160,10 @@ func New(ctx context.Context, lstor *paths.Local, stor paths.Store, ls paths.Loc

localProver: prover,

parallelCheckLimit: sc.ParallelCheckLimit,
disallowRemoteFinalize: sc.DisallowRemoteFinalize,
parallelCheckLimit: sc.ParallelCheckLimit,
disableBuiltinWindowPoSt: sc.DisableBuiltinWindowPoSt,
disableBuiltinWinningPoSt: sc.DisableBuiltinWinningPoSt,
disallowRemoteFinalize: sc.DisallowRemoteFinalize,

work: mss,
callToWork: map[storiface.CallID]WorkID{},
Expand Down
14 changes: 8 additions & 6 deletions storage/sealer/manager_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import (
)

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")
return m.localProver.GenerateWinningPoSt(ctx, minerID, sectorInfo, randomness)
}
Expand Down Expand Up @@ -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) {
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")
return m.localProver.GenerateWindowPoSt(ctx, minerID, sectorInfo, randomness)
}
Expand Down Expand Up @@ -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) {
//TODO implement me
panic("implement me")
panic("worker-level api shouldn't be called at this level")
}

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("implement me")
panic("worker-level api shouldn't be called at this level")
}

0 comments on commit 84881f6

Please sign in to comment.