Merge pull request #5270 from filcloud/deal-duration

use deal duration from actors
This commit is contained in:
Łukasz Magiera 2021-03-29 20:17:34 +02:00 committed by GitHub
commit bf6ee88539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -118,5 +118,5 @@ const PackingEfficiencyNum = 4
const PackingEfficiencyDenom = 5
// Actor consts
// TODO: Pull from actors when its made not private
var MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
// TODO: pieceSize unused from actors
var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)

View File

@ -72,8 +72,8 @@ var (
}()
// Actor consts
// TODO: Pull from actors when its made not private
MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
// TODO: pieceSize unused from actors
MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)
PackingEfficiencyNum int64 = 4
PackingEfficiencyDenom int64 = 5

View File

@ -136,6 +136,10 @@ func DealProviderCollateralBounds(
}
}
func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch) {
return market2.DealDurationBounds(pieceSize)
}
// Sets the challenge window and scales the proving period to match (such that
// there are always 48 challenge windows in a proving period).
func SetWPoStChallengeWindow(period abi.ChainEpoch) {

View File

@ -387,6 +387,9 @@ var clientDealCmd = &cli.Command{
if abi.ChainEpoch(dur) < build.MinDealDuration {
return xerrors.Errorf("minimum deal duration is %d blocks", build.MinDealDuration)
}
if abi.ChainEpoch(dur) > build.MaxDealDuration {
return xerrors.Errorf("maximum deal duration is %d blocks", build.MaxDealDuration)
}
var a address.Address
if from := cctx.String("from"); from != "" {