From 5ca41177d1ff0efa96857f6455e0b0dea324a49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 26 Mar 2022 15:50:21 -0400 Subject: [PATCH] feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin --- .../en/default-lotus-miner-config.toml | 16 ++--- node/config/def.go | 2 +- node/config/doc_gen.go | 16 ++--- node/config/types.go | 9 +-- node/modules/storageminer.go | 65 ++++++++++--------- 5 files changed, 56 insertions(+), 52 deletions(-) diff --git a/documentation/en/default-lotus-miner-config.toml b/documentation/en/default-lotus-miner-config.toml index d00d790c5f1..8e1d4ce0b95 100644 --- a/documentation/en/default-lotus-miner-config.toml +++ b/documentation/en/default-lotus-miner-config.toml @@ -173,14 +173,6 @@ # env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION #ExpectedSealDuration = "24h0m0s" - # Whether new sectors are created to pack incoming deals - # When this is set to false no new sectors will be created for sealing incoming deals - # This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade - # - # type: bool - # env var: LOTUS_DEALMAKING_MAKENEWSECTORFORDEALS - #MakeNewSectorForDeals = true - # Maximum amount of time proposed deal StartEpoch can be in future # # type: Duration @@ -365,6 +357,14 @@ # env var: LOTUS_SEALING_FINALIZEEARLY #FinalizeEarly = false + # Whether new sectors are created to pack incoming deals + # When this is set to false no new sectors will be created for sealing incoming deals + # This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade + # + # type: bool + # env var: LOTUS_SEALING_MAKENEWSECTORFORDEALS + #MakeNewSectorForDeals = true + # After sealing CC sectors, make them available for upgrading with deals # # type: bool diff --git a/node/config/def.go b/node/config/def.go index c70ab212900..86f655e3750 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -110,6 +110,7 @@ func DefaultStorageMiner() *StorageMiner { WaitDealsDelay: Duration(time.Hour * 6), AlwaysKeepUnsealedCopy: true, FinalizeEarly: false, + MakeNewSectorForDeals: true, CollateralFromMinerBalance: false, AvailableBalanceBuffer: types.FIL(big.Zero()), @@ -163,7 +164,6 @@ func DefaultStorageMiner() *StorageMiner { ConsiderVerifiedStorageDeals: true, ConsiderUnverifiedStorageDeals: true, PieceCidBlocklist: []cid.Cid{}, - MakeNewSectorForDeals: true, // TODO: It'd be nice to set this based on sector size MaxDealStartDelay: Duration(time.Hour * 24 * 14), ExpectedSealDuration: Duration(time.Hour * 24), diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index 972c196f792..d1aa69ff7dc 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -253,14 +253,6 @@ Default value: 1 minute.`, Comment: `Maximum expected amount of time getting the deal into a sealed sector will take This includes the time the deal will need to get transferred and published before being assigned to a sector`, - }, - { - Name: "MakeNewSectorForDeals", - Type: "bool", - - Comment: `Whether new sectors are created to pack incoming deals -When this is set to false no new sectors will be created for sealing incoming deals -This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade`, }, { Name: "MaxDealStartDelay", @@ -750,6 +742,14 @@ 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`, }, + { + Name: "MakeNewSectorForDeals", + Type: "bool", + + Comment: `Whether new sectors are created to pack incoming deals +When this is set to false no new sectors will be created for sealing incoming deals +This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade`, + }, { Name: "MakeCCSectorsAvailable", Type: "bool", diff --git a/node/config/types.go b/node/config/types.go index 2e9357993e1..d8c01e85ba4 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -128,10 +128,6 @@ type DealmakingConfig struct { // This includes the time the deal will need to get transferred and published // before being assigned to a sector ExpectedSealDuration Duration - // Whether new sectors are created to pack incoming deals - // When this is set to false no new sectors will be created for sealing incoming deals - // This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade - MakeNewSectorForDeals bool // Maximum amount of time proposed deal StartEpoch can be in future MaxDealStartDelay Duration // When a deal is ready to publish, the amount of time to wait for more @@ -250,6 +246,11 @@ type SealingConfig struct { // Run sector finalization before submitting sector proof to the chain FinalizeEarly bool + // Whether new sectors are created to pack incoming deals + // When this is set to false no new sectors will be created for sealing incoming deals + // This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade + MakeNewSectorForDeals bool + // After sealing CC sectors, make them available for upgrading with deals MakeCCSectorsAvailable bool diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 05d41a42742..514c218f57d 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -897,6 +897,7 @@ func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error MaxSealingSectorsForDeals: cfg.MaxSealingSectorsForDeals, CommittedCapacitySectorLifetime: config.Duration(cfg.CommittedCapacitySectorLifetime), WaitDealsDelay: config.Duration(cfg.WaitDealsDelay), + MakeNewSectorForDeals: cfg.MakeNewSectorForDeals, MakeCCSectorsAvailable: cfg.MakeCCSectorsAvailable, AlwaysKeepUnsealedCopy: cfg.AlwaysKeepUnsealedCopy, FinalizeEarly: cfg.FinalizeEarly, @@ -929,37 +930,39 @@ func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error func ToSealingConfig(cfg *config.StorageMiner) sealiface.Config { return sealiface.Config{ - MaxWaitDealsSectors: cfg.Sealing.MaxWaitDealsSectors, - MaxSealingSectors: cfg.Sealing.MaxSealingSectors, - MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals, - StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer), - MakeNewSectorForDeals: cfg.Dealmaking.MakeNewSectorForDeals, - CommittedCapacitySectorLifetime: time.Duration(cfg.Sealing.CommittedCapacitySectorLifetime), - WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay), - MakeCCSectorsAvailable: cfg.Sealing.MakeCCSectorsAvailable, - AlwaysKeepUnsealedCopy: cfg.Sealing.AlwaysKeepUnsealedCopy, - FinalizeEarly: cfg.Sealing.FinalizeEarly, - - CollateralFromMinerBalance: cfg.Sealing.CollateralFromMinerBalance, - AvailableBalanceBuffer: types.BigInt(cfg.Sealing.AvailableBalanceBuffer), - DisableCollateralFallback: cfg.Sealing.DisableCollateralFallback, - - BatchPreCommits: cfg.Sealing.BatchPreCommits, - MaxPreCommitBatch: cfg.Sealing.MaxPreCommitBatch, - PreCommitBatchWait: time.Duration(cfg.Sealing.PreCommitBatchWait), - PreCommitBatchSlack: time.Duration(cfg.Sealing.PreCommitBatchSlack), - - AggregateCommits: cfg.Sealing.AggregateCommits, - MinCommitBatch: cfg.Sealing.MinCommitBatch, - MaxCommitBatch: cfg.Sealing.MaxCommitBatch, - CommitBatchWait: time.Duration(cfg.Sealing.CommitBatchWait), - CommitBatchSlack: time.Duration(cfg.Sealing.CommitBatchSlack), - AggregateAboveBaseFee: types.BigInt(cfg.Sealing.AggregateAboveBaseFee), - BatchPreCommitAboveBaseFee: types.BigInt(cfg.Sealing.BatchPreCommitAboveBaseFee), - - TerminateBatchMax: cfg.Sealing.TerminateBatchMax, - TerminateBatchMin: cfg.Sealing.TerminateBatchMin, - TerminateBatchWait: time.Duration(cfg.Sealing.TerminateBatchWait), + MaxWaitDealsSectors: sealingCfg.MaxWaitDealsSectors, + MaxSealingSectors: sealingCfg.MaxSealingSectors, + MaxSealingSectorsForDeals: sealingCfg.MaxSealingSectorsForDeals, + PreferNewSectorsForDeals: sealingCfg.PreferNewSectorsForDeals, + MaxUpgradingSectors: sealingCfg.MaxUpgradingSectors, + StartEpochSealingBuffer: abi.ChainEpoch(dealmakingCfg.StartEpochSealingBuffer), + MakeNewSectorForDeals: sealingCfg.MakeNewSectorForDeals, + CommittedCapacitySectorLifetime: time.Duration(sealingCfg.CommittedCapacitySectorLifetime), + WaitDealsDelay: time.Duration(sealingCfg.WaitDealsDelay), + MakeCCSectorsAvailable: sealingCfg.MakeCCSectorsAvailable, + AlwaysKeepUnsealedCopy: sealingCfg.AlwaysKeepUnsealedCopy, + FinalizeEarly: sealingCfg.FinalizeEarly, + + CollateralFromMinerBalance: sealingCfg.CollateralFromMinerBalance, + AvailableBalanceBuffer: types.BigInt(sealingCfg.AvailableBalanceBuffer), + DisableCollateralFallback: sealingCfg.DisableCollateralFallback, + + BatchPreCommits: sealingCfg.BatchPreCommits, + MaxPreCommitBatch: sealingCfg.MaxPreCommitBatch, + PreCommitBatchWait: time.Duration(sealingCfg.PreCommitBatchWait), + PreCommitBatchSlack: time.Duration(sealingCfg.PreCommitBatchSlack), + + AggregateCommits: sealingCfg.AggregateCommits, + MinCommitBatch: sealingCfg.MinCommitBatch, + MaxCommitBatch: sealingCfg.MaxCommitBatch, + CommitBatchWait: time.Duration(sealingCfg.CommitBatchWait), + CommitBatchSlack: time.Duration(sealingCfg.CommitBatchSlack), + AggregateAboveBaseFee: types.BigInt(sealingCfg.AggregateAboveBaseFee), + BatchPreCommitAboveBaseFee: types.BigInt(sealingCfg.BatchPreCommitAboveBaseFee), + + TerminateBatchMax: sealingCfg.TerminateBatchMax, + TerminateBatchMin: sealingCfg.TerminateBatchMin, + TerminateBatchWait: time.Duration(sealingCfg.TerminateBatchWait), } }