From 00618672f5838c93c89f5ee378981942c365bde3 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Tue, 22 Jun 2021 13:08:36 +0200 Subject: [PATCH] policy.SetPreCommitChallengeDelay to reduce WaitSeed stage time --- itests/deals_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/itests/deals_test.go b/itests/deals_test.go index a80eb3268..f378263b0 100644 --- a/itests/deals_test.go +++ b/itests/deals_test.go @@ -13,6 +13,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/builtin/market" + "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/itests/kit" @@ -30,6 +31,12 @@ func TestDealCyclesConcurrent(t *testing.T) { kit.QuietMiningLogs() + oldDelay := policy.GetPreCommitChallengeDelay() + policy.SetPreCommitChallengeDelay(5) + t.Cleanup(func() { + policy.SetPreCommitChallengeDelay(oldDelay) + }) + blockTime := 10 * time.Millisecond // For these tests where the block time is artificially short, just use @@ -107,6 +114,12 @@ func TestDealsWithSealingAndRPC(t *testing.T) { kit.QuietMiningLogs() + oldDelay := policy.GetPreCommitChallengeDelay() + policy.SetPreCommitChallengeDelay(5) + t.Cleanup(func() { + policy.SetPreCommitChallengeDelay(oldDelay) + }) + var blockTime = 1 * time.Second client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.WithAllSubsystems()) // no mock proofs. @@ -224,6 +237,12 @@ func TestPublishDealsBatching(t *testing.T) { startEpoch = abi.ChainEpoch(2 << 12) ) + oldDelay := policy.GetPreCommitChallengeDelay() + policy.SetPreCommitChallengeDelay(5) + t.Cleanup(func() { + policy.SetPreCommitChallengeDelay(oldDelay) + }) + kit.QuietMiningLogs() opts := node.Override(new(*storageadapter.DealPublisher), @@ -365,6 +384,12 @@ func TestOfflineDealFlow(t *testing.T) { // so that the deal starts sealing in time startEpoch := abi.ChainEpoch(2 << 12) + oldDelay := policy.GetPreCommitChallengeDelay() + policy.SetPreCommitChallengeDelay(5) + t.Cleanup(func() { + policy.SetPreCommitChallengeDelay(oldDelay) + }) + runTest := func(t *testing.T, fastRet bool) { ctx := context.Background() client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) @@ -447,6 +472,12 @@ func TestZeroPricePerByteRetrieval(t *testing.T) { t.Skip("skipping test in short mode") } + oldDelay := policy.GetPreCommitChallengeDelay() + policy.SetPreCommitChallengeDelay(5) + t.Cleanup(func() { + policy.SetPreCommitChallengeDelay(oldDelay) + }) + kit.QuietMiningLogs() var (