Skip to content

Commit

Permalink
Merge pull request #8382 from filecoin-project/jen/v1513
Browse files Browse the repository at this point in the history
chore: backport: #8381 #8378
  • Loading branch information
jennijuju committed Mar 27, 2022
2 parents b2dbe8d + c951e34 commit 04458ea
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 27 deletions.
15 changes: 11 additions & 4 deletions chain/vm/fvm.go
Expand Up @@ -233,10 +233,17 @@ func NewFVM(ctx context.Context, opts *VMOpts) (*FVM, error) {
}
}

fvm, err := ffi.CreateFVM(0,
&FvmExtern{Rand: opts.Rand, Blockstore: opts.Bstore, lbState: opts.LookbackState, base: opts.StateBase, epoch: opts.Epoch},
opts.Epoch, opts.BaseFee, circToReport, opts.NetworkVersion, opts.StateBase,
)
fvmOpts := ffi.FVMOpts{
FVMVersion: 0,
Externs: &FvmExtern{Rand: opts.Rand, Blockstore: opts.Bstore, lbState: opts.LookbackState, base: opts.StateBase, epoch: opts.Epoch},
Epoch: opts.Epoch,
BaseFee: opts.BaseFee,
BaseCircSupply: circToReport,
NetworkVersion: opts.NetworkVersion,
StateBase: opts.StateBase,
}

fvm, err := ffi.CreateFVM(&fvmOpts)
if err != nil {
return nil, err
}
Expand Down
16 changes: 8 additions & 8 deletions documentation/en/default-lotus-miner-config.toml
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion node/config/def.go
Expand Up @@ -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()),
Expand Down Expand Up @@ -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),
Expand Down
16 changes: 8 additions & 8 deletions node/config/doc_gen.go

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

9 changes: 5 additions & 4 deletions node/config/types.go
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion node/modules/storageminer.go
Expand Up @@ -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,
Expand Down Expand Up @@ -933,7 +934,7 @@ func ToSealingConfig(cfg *config.StorageMiner) sealiface.Config {
MaxSealingSectors: cfg.Sealing.MaxSealingSectors,
MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals,
StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer),
MakeNewSectorForDeals: cfg.Dealmaking.MakeNewSectorForDeals,
MakeNewSectorForDeals: cfg.Sealing.MakeNewSectorForDeals,
CommittedCapacitySectorLifetime: time.Duration(cfg.Sealing.CommittedCapacitySectorLifetime),
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
MakeCCSectorsAvailable: cfg.Sealing.MakeCCSectorsAvailable,
Expand Down

0 comments on commit 04458ea

Please sign in to comment.