From 0a15c68a8e26b8c0f1da6785deb3a175a05a9e16 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Wed, 16 Oct 2024 16:50:41 +0100 Subject: [PATCH] Shorten GPBFT settings for a more responsive timing Defaults are based on epoch of 30s and real RTT. Shorten Delta and rebroadcast times. --- itests/f3_test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/itests/f3_test.go b/itests/f3_test.go index 9d5d6494ebe..a2d183dc75a 100644 --- a/itests/f3_test.go +++ b/itests/f3_test.go @@ -230,6 +230,12 @@ func (e *testEnv) waitFor(f func(n *kit.TestFullNode) bool, timeout time.Duratio // a miner. The last return value is the manifest sender for the network. func setup(t *testing.T, blocktime time.Duration) *testEnv { manif := lf3.NewManifest(BaseNetworkName+"/1", DefaultFinality, DefaultBootstrapEpoch, blocktime, cid.Undef) + manif.Gpbft.Delta = 250 * time.Millisecond + manif.Gpbft.DeltaBackOffExponent = 1.3 + manif.Gpbft.RebroadcastBackoffBase = manif.Gpbft.Delta * 2 + manif.Gpbft.RebroadcastBackoffMax = manif.Gpbft.RebroadcastBackoffBase * 2 + manif.Gpbft.RebroadcastBackoffExponent = manif.Gpbft.DeltaBackOffExponent + return setupWithStaticManifest(t, manif, false) } @@ -295,7 +301,6 @@ func setupWithStaticManifest(t *testing.T, manif *manifest.Manifest, testBootstr err = n.NetConnect(ctx, e.ms.PeerInfo()) require.NoError(t, err) } - errgrp.Go(func() error { defer func() { require.NoError(t, manifestServerHost.Close()) @@ -303,6 +308,16 @@ func setupWithStaticManifest(t *testing.T, manif *manifest.Manifest, testBootstr return e.ms.Run(ctx) }) + // Update initial manifest params to shorten the timeouts and backoff for + // testing. + m.Gpbft.Delta = 250 * time.Millisecond + m.Gpbft.DeltaBackOffExponent = 1.3 + m.Gpbft.RebroadcastBackoffBase = manif.Gpbft.Delta * 2 + m.Gpbft.RebroadcastBackoffMax = manif.Gpbft.RebroadcastBackoffBase * 2 + m.Gpbft.RebroadcastBackoffExponent = manif.Gpbft.DeltaBackOffExponent + e.ms.UpdateManifest(m) + e.waitTillManifestChange(m, 20*time.Second) + return e }