diff --git a/activation/activation_multi_test.go b/activation/activation_multi_test.go index 6368f50427..ce795e53b5 100644 --- a/activation/activation_multi_test.go +++ b/activation/activation_multi_test.go @@ -232,10 +232,7 @@ func TestRegossip(t *testing.T) { } func Test_Builder_Multi_InitialPost(t *testing.T) { - tab := newTestBuilder(t, 5, WithPoetConfig( - PoetConfig{ - PhaseShift: layerDuration * 4, - })) + tab := newTestBuilder(t, 5, WithPoetConfig(PoetConfig{PhaseShift: layerDuration * 4})) var eg errgroup.Group for _, sig := range tab.signers { @@ -274,11 +271,7 @@ func Test_Builder_Multi_InitialPost(t *testing.T) { func Test_Builder_Multi_HappyPath(t *testing.T) { layerDuration := 2 * time.Second - tab := newTestBuilder(t, 3, WithPoetConfig( - PoetConfig{ - PhaseShift: layerDuration * 4, - CycleGap: layerDuration, - })) + tab := newTestBuilder(t, 3, WithPoetConfig(PoetConfig{PhaseShift: layerDuration * 4, CycleGap: layerDuration})) // step 1: build initial posts initialPostChan := make(chan struct{}) diff --git a/activation/activation_test.go b/activation/activation_test.go index 70f8436928..a3c696cb24 100644 --- a/activation/activation_test.go +++ b/activation/activation_test.go @@ -344,10 +344,7 @@ func TestBuilder_StopSmeshing_failsWhenNotStarted(t *testing.T) { } func TestBuilder_PublishActivationTx_HappyFlow(t *testing.T) { - tab := newTestBuilder(t, 1, WithPoetConfig( - PoetConfig{ - PhaseShift: layerDuration, - })) + tab := newTestBuilder(t, 1, WithPoetConfig(PoetConfig{PhaseShift: layerDuration})) sig := maps.Values(tab.signers)[0] posEpoch := postGenesisEpoch @@ -383,9 +380,7 @@ func TestBuilder_PublishActivationTx_HappyFlow(t *testing.T) { // failing with ErrATXChallengeExpired. func TestBuilder_Loop_WaitsOnStaleChallenge(t *testing.T) { // Arrange - tab := newTestBuilder(t, 1, WithPoetConfig(PoetConfig{ - PhaseShift: layerDuration * 4, - })) + tab := newTestBuilder(t, 1, WithPoetConfig(PoetConfig{PhaseShift: layerDuration * 4})) sig := maps.Values(tab.signers)[0] // current layer is too late to be able to build a nipost on time @@ -434,9 +429,7 @@ func TestBuilder_Loop_WaitsOnStaleChallenge(t *testing.T) { } func TestBuilder_PublishActivationTx_FaultyNet(t *testing.T) { - tab := newTestBuilder(t, 1, WithPoetConfig(PoetConfig{ - PhaseShift: layerDuration * 4, - })) + tab := newTestBuilder(t, 1, WithPoetConfig(PoetConfig{PhaseShift: layerDuration * 4})) sig := maps.Values(tab.signers)[0] posEpoch := postGenesisEpoch @@ -508,7 +501,9 @@ func TestBuilder_PublishActivationTx_FaultyNet(t *testing.T) { } func TestBuilder_PublishActivationTx_UsesExistingChallengeOnLatePublish(t *testing.T) { - poetCfg := PoetConfig{PhaseShift: layerDuration * 4} + poetCfg := PoetConfig{ + PhaseShift: layerDuration * 4, + } tab := newTestBuilder(t, 1, WithPoetConfig(poetCfg)) sig := maps.Values(tab.signers)[0] diff --git a/activation/e2e/activation_test.go b/activation/e2e/activation_test.go index 2732daed61..e2bd4dd098 100644 --- a/activation/e2e/activation_test.go +++ b/activation/e2e/activation_test.go @@ -85,12 +85,12 @@ func Test_BuilderWithMultipleClients(t *testing.T) { epoch := layerDuration * layersPerEpoch genesis := time.Now().Add(layerDuration).Round(layerDuration) poetCfg := activation.PoetConfig{ - RequestTimeout: epoch / 5, - RequestRetryDelay: epoch / 50, - MaxRequestRetries: 10, PhaseShift: epoch, CycleGap: 3 * epoch / 4, GracePeriod: epoch / 4, + RequestTimeout: epoch / 5, + RequestRetryDelay: epoch / 50, + MaxRequestRetries: 10, } scrypt := testPostSetupOpts(t).Scrypt diff --git a/activation/poet_client_test.go b/activation/poet_client_test.go index e0744fca9a..6b8e5126f6 100644 --- a/activation/poet_client_test.go +++ b/activation/poet_client_test.go @@ -30,22 +30,20 @@ func Test_HTTPPoetClient_ParsesURL(t *testing.T) { t.Run("add http if missing", func(t *testing.T) { t.Parallel() - client, err := NewHTTPPoetClient(types.PoetServer{Address: "bla"}, - PoetConfig{ - PhaseShift: cfg.PhaseShift, - CycleGap: cfg.CycleGap, - }) + client, err := NewHTTPPoetClient(types.PoetServer{Address: "bla"}, PoetConfig{ + PhaseShift: cfg.PhaseShift, + CycleGap: cfg.CycleGap, + }) require.NoError(t, err) require.Equal(t, "http://bla", client.baseURL.String()) }) t.Run("do not change scheme if present", func(t *testing.T) { t.Parallel() - client, err := NewHTTPPoetClient(types.PoetServer{Address: "https://bla"}, - PoetConfig{ - PhaseShift: cfg.PhaseShift, - CycleGap: cfg.CycleGap, - }) + client, err := NewHTTPPoetClient(types.PoetServer{Address: "https://bla"}, PoetConfig{ + PhaseShift: cfg.PhaseShift, + CycleGap: cfg.CycleGap, + }) require.NoError(t, err) require.Equal(t, "https://bla", client.baseURL.String()) }) @@ -115,11 +113,10 @@ func Test_HTTPPoetClient_Address_Mainnet(t *testing.T) { for _, url := range poETServers { t.Run(url, func(t *testing.T) { - client, err := NewHTTPPoetClient(types.PoetServer{Address: url}, - PoetConfig{ - PhaseShift: poetCfg.PhaseShift, - CycleGap: poetCfg.CycleGap, - }) + client, err := NewHTTPPoetClient(types.PoetServer{Address: url}, PoetConfig{ + PhaseShift: poetCfg.PhaseShift, + CycleGap: poetCfg.CycleGap, + }) require.NoError(t, err) require.Equal(t, url, client.Address()) }) diff --git a/config/presets/fastnet.go b/config/presets/fastnet.go index d645a53c10..6ea5ee5fe4 100644 --- a/config/presets/fastnet.go +++ b/config/presets/fastnet.go @@ -94,7 +94,7 @@ func fastnet() config.Config { conf.POET.GracePeriod = 10 * time.Second conf.POET.CycleGap = 30 * time.Second conf.POET.PhaseShift = 30 * time.Second - conf.POET.PositioningATXSelectionTimeout = 25 * time.Minute + conf.POET.PositioningATXSelectionTimeout = 25 * time.Second // RequestTimeout = RequestRetryDelay * 2 * MaxRequestRetries*(MaxRequestRetries+1)/2 conf.POET.RequestTimeout = 12 * time.Second conf.POET.RequestRetryDelay = 1 * time.Second