Merge pull request #8382 from filecoin-project/jen/v1513

chore: backport: #8381 #8378
This commit is contained in:
Jiaying Wang 2022-03-27 19:17:28 -04:00 committed by GitHub
commit 04458ea12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 27 deletions

View File

@ -233,10 +233,17 @@ func NewFVM(ctx context.Context, opts *VMOpts) (*FVM, error) {
} }
} }
fvm, err := ffi.CreateFVM(0, fvmOpts := ffi.FVMOpts{
&FvmExtern{Rand: opts.Rand, Blockstore: opts.Bstore, lbState: opts.LookbackState, base: opts.StateBase, epoch: opts.Epoch}, FVMVersion: 0,
opts.Epoch, opts.BaseFee, circToReport, opts.NetworkVersion, opts.StateBase, 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 { if err != nil {
return nil, err return nil, err
} }

View File

@ -173,14 +173,6 @@
# env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION # env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION
#ExpectedSealDuration = "24h0m0s" #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 # Maximum amount of time proposed deal StartEpoch can be in future
# #
# type: Duration # type: Duration
@ -365,6 +357,14 @@
# env var: LOTUS_SEALING_FINALIZEEARLY # env var: LOTUS_SEALING_FINALIZEEARLY
#FinalizeEarly = false #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 # After sealing CC sectors, make them available for upgrading with deals
# #
# type: bool # type: bool

2
extern/filecoin-ffi vendored

@ -1 +1 @@
Subproject commit e81d302831f5dcd0c5b7b9415c353f8b43291b8c Subproject commit 7f93fe5cf63aee1c6c21986903e870b02e337a16

View File

@ -110,6 +110,7 @@ func DefaultStorageMiner() *StorageMiner {
WaitDealsDelay: Duration(time.Hour * 6), WaitDealsDelay: Duration(time.Hour * 6),
AlwaysKeepUnsealedCopy: true, AlwaysKeepUnsealedCopy: true,
FinalizeEarly: false, FinalizeEarly: false,
MakeNewSectorForDeals: true,
CollateralFromMinerBalance: false, CollateralFromMinerBalance: false,
AvailableBalanceBuffer: types.FIL(big.Zero()), AvailableBalanceBuffer: types.FIL(big.Zero()),
@ -163,7 +164,6 @@ func DefaultStorageMiner() *StorageMiner {
ConsiderVerifiedStorageDeals: true, ConsiderVerifiedStorageDeals: true,
ConsiderUnverifiedStorageDeals: true, ConsiderUnverifiedStorageDeals: true,
PieceCidBlocklist: []cid.Cid{}, PieceCidBlocklist: []cid.Cid{},
MakeNewSectorForDeals: true,
// TODO: It'd be nice to set this based on sector size // TODO: It'd be nice to set this based on sector size
MaxDealStartDelay: Duration(time.Hour * 24 * 14), MaxDealStartDelay: Duration(time.Hour * 24 * 14),
ExpectedSealDuration: Duration(time.Hour * 24), ExpectedSealDuration: Duration(time.Hour * 24),

View File

@ -253,14 +253,6 @@ Default value: 1 minute.`,
Comment: `Maximum expected amount of time getting the deal into a sealed sector will take 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 This includes the time the deal will need to get transferred and published
before being assigned to a sector`, 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", 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`, 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", Name: "MakeCCSectorsAvailable",
Type: "bool", Type: "bool",

View File

@ -128,10 +128,6 @@ type DealmakingConfig struct {
// This includes the time the deal will need to get transferred and published // This includes the time the deal will need to get transferred and published
// before being assigned to a sector // before being assigned to a sector
ExpectedSealDuration Duration 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 // Maximum amount of time proposed deal StartEpoch can be in future
MaxDealStartDelay Duration MaxDealStartDelay Duration
// When a deal is ready to publish, the amount of time to wait for more // 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 // Run sector finalization before submitting sector proof to the chain
FinalizeEarly bool 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 // After sealing CC sectors, make them available for upgrading with deals
MakeCCSectorsAvailable bool MakeCCSectorsAvailable bool

View File

@ -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),
MakeNewSectorForDeals: cfg.MakeNewSectorForDeals,
MakeCCSectorsAvailable: cfg.MakeCCSectorsAvailable, MakeCCSectorsAvailable: cfg.MakeCCSectorsAvailable,
AlwaysKeepUnsealedCopy: cfg.AlwaysKeepUnsealedCopy, AlwaysKeepUnsealedCopy: cfg.AlwaysKeepUnsealedCopy,
FinalizeEarly: cfg.FinalizeEarly, FinalizeEarly: cfg.FinalizeEarly,
@ -933,7 +934,7 @@ func ToSealingConfig(cfg *config.StorageMiner) sealiface.Config {
MaxSealingSectors: cfg.Sealing.MaxSealingSectors, MaxSealingSectors: cfg.Sealing.MaxSealingSectors,
MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals, MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals,
StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer), StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer),
MakeNewSectorForDeals: cfg.Dealmaking.MakeNewSectorForDeals, MakeNewSectorForDeals: cfg.Sealing.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, MakeCCSectorsAvailable: cfg.Sealing.MakeCCSectorsAvailable,