sealing: Add MakeCCSectorsAvailable config
This commit is contained in:
parent
1158a928ec
commit
d3cec2f0d1
@ -365,6 +365,12 @@
|
|||||||
# env var: LOTUS_SEALING_FINALIZEEARLY
|
# env var: LOTUS_SEALING_FINALIZEEARLY
|
||||||
#FinalizeEarly = false
|
#FinalizeEarly = false
|
||||||
|
|
||||||
|
# After sealing CC sectors, make them available for upgrading with deals
|
||||||
|
#
|
||||||
|
# type: bool
|
||||||
|
# env var: LOTUS_SEALING_MAKECCSECTORSAVAILABLE
|
||||||
|
#MakeCCSectorsAvailable = false
|
||||||
|
|
||||||
# Whether to use available miner balance for sector collateral instead of sending it with each message
|
# Whether to use available miner balance for sector collateral instead of sending it with each message
|
||||||
#
|
#
|
||||||
# type: bool
|
# type: bool
|
||||||
|
2
extern/storage-sealing/fsm.go
vendored
2
extern/storage-sealing/fsm.go
vendored
@ -111,6 +111,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
|||||||
Committing: planCommitting,
|
Committing: planCommitting,
|
||||||
CommitFinalize: planOne(
|
CommitFinalize: planOne(
|
||||||
on(SectorFinalized{}, SubmitCommit),
|
on(SectorFinalized{}, SubmitCommit),
|
||||||
|
on(SectorFinalizedAvailable{}, SubmitCommit),
|
||||||
on(SectorFinalizeFailed{}, CommitFinalizeFailed),
|
on(SectorFinalizeFailed{}, CommitFinalizeFailed),
|
||||||
),
|
),
|
||||||
SubmitCommit: planOne(
|
SubmitCommit: planOne(
|
||||||
@ -136,6 +137,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
|||||||
|
|
||||||
FinalizeSector: planOne(
|
FinalizeSector: planOne(
|
||||||
on(SectorFinalized{}, Proving),
|
on(SectorFinalized{}, Proving),
|
||||||
|
on(SectorFinalizedAvailable{}, Available),
|
||||||
on(SectorFinalizeFailed{}, FinalizeFailed),
|
on(SectorFinalizeFailed{}, FinalizeFailed),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
4
extern/storage-sealing/fsm_events.go
vendored
4
extern/storage-sealing/fsm_events.go
vendored
@ -286,6 +286,10 @@ type SectorFinalized struct{}
|
|||||||
|
|
||||||
func (evt SectorFinalized) apply(*SectorInfo) {}
|
func (evt SectorFinalized) apply(*SectorInfo) {}
|
||||||
|
|
||||||
|
type SectorFinalizedAvailable struct{}
|
||||||
|
|
||||||
|
func (evt SectorFinalizedAvailable) apply(*SectorInfo) {}
|
||||||
|
|
||||||
type SectorRetryFinalize struct{}
|
type SectorRetryFinalize struct{}
|
||||||
|
|
||||||
func (evt SectorRetryFinalize) apply(*SectorInfo) {}
|
func (evt SectorRetryFinalize) apply(*SectorInfo) {}
|
||||||
|
2
extern/storage-sealing/sealiface/config.go
vendored
2
extern/storage-sealing/sealiface/config.go
vendored
@ -20,6 +20,8 @@ type Config struct {
|
|||||||
|
|
||||||
MakeNewSectorForDeals bool
|
MakeNewSectorForDeals bool
|
||||||
|
|
||||||
|
MakeCCSectorsAvailable bool
|
||||||
|
|
||||||
WaitDealsDelay time.Duration
|
WaitDealsDelay time.Duration
|
||||||
|
|
||||||
CommittedCapacitySectorLifetime time.Duration
|
CommittedCapacitySectorLifetime time.Duration
|
||||||
|
3
extern/storage-sealing/states_sealing.go
vendored
3
extern/storage-sealing/states_sealing.go
vendored
@ -782,5 +782,8 @@ func (m *Sealing) handleFinalizeSector(ctx statemachine.Context, sector SectorIn
|
|||||||
return ctx.Send(SectorFinalizeFailed{xerrors.Errorf("finalize sector: %w", err)})
|
return ctx.Send(SectorFinalizeFailed{xerrors.Errorf("finalize sector: %w", err)})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.MakeCCSectorsAvailable && !sector.hasDeals() {
|
||||||
|
return ctx.Send(SectorFinalizedAvailable{})
|
||||||
|
}
|
||||||
return ctx.Send(SectorFinalized{})
|
return ctx.Send(SectorFinalized{})
|
||||||
}
|
}
|
||||||
|
@ -750,6 +750,12 @@ avoid the relatively high cost of unsealing the data later, at the cost of more
|
|||||||
|
|
||||||
Comment: `Run sector finalization before submitting sector proof to the chain`,
|
Comment: `Run sector finalization before submitting sector proof to the chain`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "MakeCCSectorsAvailable",
|
||||||
|
Type: "bool",
|
||||||
|
|
||||||
|
Comment: `After sealing CC sectors, make them available for upgrading with deals`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "CollateralFromMinerBalance",
|
Name: "CollateralFromMinerBalance",
|
||||||
Type: "bool",
|
Type: "bool",
|
||||||
|
@ -250,6 +250,9 @@ type SealingConfig struct {
|
|||||||
// Run sector finalization before submitting sector proof to the chain
|
// Run sector finalization before submitting sector proof to the chain
|
||||||
FinalizeEarly bool
|
FinalizeEarly bool
|
||||||
|
|
||||||
|
// After sealing CC sectors, make them available for upgrading with deals
|
||||||
|
MakeCCSectorsAvailable bool
|
||||||
|
|
||||||
// Whether to use available miner balance for sector collateral instead of sending it with each message
|
// Whether to use available miner balance for sector collateral instead of sending it with each message
|
||||||
CollateralFromMinerBalance bool
|
CollateralFromMinerBalance bool
|
||||||
// Minimum available balance to keep in the miner actor before sending it with messages
|
// Minimum available balance to keep in the miner actor before sending it with messages
|
||||||
|
@ -897,6 +897,7 @@ func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error
|
|||||||
MaxSealingSectorsForDeals: cfg.MaxSealingSectorsForDeals,
|
MaxSealingSectorsForDeals: cfg.MaxSealingSectorsForDeals,
|
||||||
CommittedCapacitySectorLifetime: config.Duration(cfg.CommittedCapacitySectorLifetime),
|
CommittedCapacitySectorLifetime: config.Duration(cfg.CommittedCapacitySectorLifetime),
|
||||||
WaitDealsDelay: config.Duration(cfg.WaitDealsDelay),
|
WaitDealsDelay: config.Duration(cfg.WaitDealsDelay),
|
||||||
|
MakeCCSectorsAvailable: cfg.MakeCCSectorsAvailable,
|
||||||
AlwaysKeepUnsealedCopy: cfg.AlwaysKeepUnsealedCopy,
|
AlwaysKeepUnsealedCopy: cfg.AlwaysKeepUnsealedCopy,
|
||||||
FinalizeEarly: cfg.FinalizeEarly,
|
FinalizeEarly: cfg.FinalizeEarly,
|
||||||
|
|
||||||
@ -935,6 +936,7 @@ func ToSealingConfig(cfg *config.StorageMiner) sealiface.Config {
|
|||||||
MakeNewSectorForDeals: cfg.Dealmaking.MakeNewSectorForDeals,
|
MakeNewSectorForDeals: cfg.Dealmaking.MakeNewSectorForDeals,
|
||||||
CommittedCapacitySectorLifetime: time.Duration(cfg.Sealing.CommittedCapacitySectorLifetime),
|
CommittedCapacitySectorLifetime: time.Duration(cfg.Sealing.CommittedCapacitySectorLifetime),
|
||||||
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
|
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
|
||||||
|
MakeCCSectorsAvailable: cfg.Sealing.MakeCCSectorsAvailable,
|
||||||
AlwaysKeepUnsealedCopy: cfg.Sealing.AlwaysKeepUnsealedCopy,
|
AlwaysKeepUnsealedCopy: cfg.Sealing.AlwaysKeepUnsealedCopy,
|
||||||
FinalizeEarly: cfg.Sealing.FinalizeEarly,
|
FinalizeEarly: cfg.Sealing.FinalizeEarly,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user