Skip to content

Commit 0a15c68

Browse files
committed
Shorten GPBFT settings for a more responsive timing
Defaults are based on epoch of 30s and real RTT. Shorten Delta and rebroadcast times.
1 parent 4192741 commit 0a15c68

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

itests/f3_test.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ func (e *testEnv) waitFor(f func(n *kit.TestFullNode) bool, timeout time.Duratio
230230
// a miner. The last return value is the manifest sender for the network.
231231
func setup(t *testing.T, blocktime time.Duration) *testEnv {
232232
manif := lf3.NewManifest(BaseNetworkName+"/1", DefaultFinality, DefaultBootstrapEpoch, blocktime, cid.Undef)
233+
manif.Gpbft.Delta = 250 * time.Millisecond
234+
manif.Gpbft.DeltaBackOffExponent = 1.3
235+
manif.Gpbft.RebroadcastBackoffBase = manif.Gpbft.Delta * 2
236+
manif.Gpbft.RebroadcastBackoffMax = manif.Gpbft.RebroadcastBackoffBase * 2
237+
manif.Gpbft.RebroadcastBackoffExponent = manif.Gpbft.DeltaBackOffExponent
238+
233239
return setupWithStaticManifest(t, manif, false)
234240
}
235241

@@ -295,14 +301,23 @@ func setupWithStaticManifest(t *testing.T, manif *manifest.Manifest, testBootstr
295301
err = n.NetConnect(ctx, e.ms.PeerInfo())
296302
require.NoError(t, err)
297303
}
298-
299304
errgrp.Go(func() error {
300305
defer func() {
301306
require.NoError(t, manifestServerHost.Close())
302307
}()
303308
return e.ms.Run(ctx)
304309
})
305310

311+
// Update initial manifest params to shorten the timeouts and backoff for
312+
// testing.
313+
m.Gpbft.Delta = 250 * time.Millisecond
314+
m.Gpbft.DeltaBackOffExponent = 1.3
315+
m.Gpbft.RebroadcastBackoffBase = manif.Gpbft.Delta * 2
316+
m.Gpbft.RebroadcastBackoffMax = manif.Gpbft.RebroadcastBackoffBase * 2
317+
m.Gpbft.RebroadcastBackoffExponent = manif.Gpbft.DeltaBackOffExponent
318+
e.ms.UpdateManifest(m)
319+
e.waitTillManifestChange(m, 20*time.Second)
320+
306321
return e
307322
}
308323

0 commit comments

Comments
 (0)