itests: Fix deal provider collateral flakiness
This commit is contained in:
parent
ee97aa0a8a
commit
2dc27d6ab4
Binary file not shown.
@ -196,6 +196,30 @@ func GetMaxProveCommitDuration(ver actors.Version, t abi.RegisteredSealProof) ab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetProviderCollateralSupplyTarget(num, denom big.Int) {
|
||||||
|
|
||||||
|
market2.ProviderCollateralSupplyTarget = builtin2.BigFrac{
|
||||||
|
Numerator: num,
|
||||||
|
Denominator: denom,
|
||||||
|
}
|
||||||
|
|
||||||
|
market3.ProviderCollateralSupplyTarget = builtin3.BigFrac{
|
||||||
|
Numerator: num,
|
||||||
|
Denominator: denom,
|
||||||
|
}
|
||||||
|
|
||||||
|
market4.ProviderCollateralSupplyTarget = builtin4.BigFrac{
|
||||||
|
Numerator: num,
|
||||||
|
Denominator: denom,
|
||||||
|
}
|
||||||
|
|
||||||
|
market5.ProviderCollateralSupplyTarget = builtin5.BigFrac{
|
||||||
|
Numerator: num,
|
||||||
|
Denominator: denom,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func DealProviderCollateralBounds(
|
func DealProviderCollateralBounds(
|
||||||
size abi.PaddedPieceSize, verified bool,
|
size abi.PaddedPieceSize, verified bool,
|
||||||
rawBytePower, qaPower, baselinePower abi.StoragePower,
|
rawBytePower, qaPower, baselinePower abi.StoragePower,
|
||||||
|
@ -132,6 +132,17 @@ func GetMaxProveCommitDuration(ver actors.Version, t abi.RegisteredSealProof) ab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetProviderCollateralSupplyTarget(num, denom big.Int) {
|
||||||
|
{{range .versions}}
|
||||||
|
{{if (ge . 2)}}
|
||||||
|
market{{.}}.ProviderCollateralSupplyTarget = builtin{{.}}.BigFrac{
|
||||||
|
Numerator: num,
|
||||||
|
Denominator: denom,
|
||||||
|
}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
}
|
||||||
|
|
||||||
func DealProviderCollateralBounds(
|
func DealProviderCollateralBounds(
|
||||||
size abi.PaddedPieceSize, verified bool,
|
size abi.PaddedPieceSize, verified bool,
|
||||||
rawBytePower, qaPower, baselinePower abi.StoragePower,
|
rawBytePower, qaPower, baselinePower abi.StoragePower,
|
||||||
|
@ -227,6 +227,7 @@ Response:
|
|||||||
"PreCommitControl": null,
|
"PreCommitControl": null,
|
||||||
"CommitControl": null,
|
"CommitControl": null,
|
||||||
"TerminateControl": null,
|
"TerminateControl": null,
|
||||||
|
"DealPublishControl": null,
|
||||||
"DisableOwnerFallback": true,
|
"DisableOwnerFallback": true,
|
||||||
"DisableWorkerFallback": true
|
"DisableWorkerFallback": true
|
||||||
}
|
}
|
||||||
|
@ -73,9 +73,13 @@ func runTestCCUpgrade(t *testing.T, upgradeHeight abi.ChainEpoch) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
exp, err := client.StateSectorExpiration(ctx, maddr, CC, types.EmptyTSK)
|
exp, err := client.StateSectorExpiration(ctx, maddr, CC, types.EmptyTSK)
|
||||||
require.NoError(t, err)
|
if err != nil {
|
||||||
require.NotNil(t, exp)
|
require.Contains(t, err.Error(), "failed to find sector 3") // already cleaned up
|
||||||
require.Greater(t, 50000, int(exp.OnTime))
|
} else {
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotNil(t, exp)
|
||||||
|
require.Greater(t, 50000, int(exp.OnTime))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
exp, err := client.StateSectorExpiration(ctx, maddr, Upgraded, types.EmptyTSK)
|
exp, err := client.StateSectorExpiration(ctx, maddr, Upgraded, types.EmptyTSK)
|
||||||
|
@ -2,12 +2,13 @@ package kit
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/ipfs/go-cid"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/go-state-types/big"
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
@ -13,6 +14,8 @@ import (
|
|||||||
func init() {
|
func init() {
|
||||||
_ = logging.SetLogLevel("*", "INFO")
|
_ = logging.SetLogLevel("*", "INFO")
|
||||||
|
|
||||||
|
policy.SetProviderCollateralSupplyTarget(big.Zero(), big.NewInt(1))
|
||||||
|
|
||||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
||||||
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
|
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
|
||||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||||
|
Loading…
Reference in New Issue
Block a user