From 209bf761690a26b02ef8609252905d8624e07465 Mon Sep 17 00:00:00 2001 From: tycho garen Date: Wed, 9 Mar 2022 17:14:16 -0500 Subject: [PATCH] fix lint --- internal/consensus/byzantine_test.go | 2 +- internal/consensus/common_test.go | 8 +++++--- internal/consensus/reactor_test.go | 2 +- internal/consensus/state.go | 1 - internal/p2p/conn/connection.go | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/consensus/byzantine_test.go b/internal/consensus/byzantine_test.go index 25d6c740d..05b8dee8f 100644 --- a/internal/consensus/byzantine_test.go +++ b/internal/consensus/byzantine_test.go @@ -100,7 +100,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) { cs.SetPrivValidator(ctx, pv) cs.SetTimeoutTicker(tickerFunc()) - cs.Start(ctx) + require.NoError(t, cs.Start(ctx)) states[i] = cs }() diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index afc534697..7e547a6ed 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -500,7 +500,9 @@ func newStateWithConfigAndBlockStore( t.Fatal(err) } cs.SetPrivValidator(ctx, pv) - cs.Start(ctx) + if err := cs.Start(ctx); err != nil { + t.Fatal(err) + } return cs } @@ -819,7 +821,7 @@ func makeConsensusState( l := logger.With("validator", i, "module", "consensus") css[i] = newStateWithConfigAndBlockStore(ctx, t, l, thisConfig, state, privVals[i], app, blockStore) css[i].SetTimeoutTicker(tickerFunc()) - css[i].Start(ctx) + require.NoError(t, css[i].Start(ctx)) } return css, func() { @@ -888,7 +890,7 @@ func randConsensusNetWithPeers( css[i] = newStateWithConfig(ctx, t, logger.With("validator", i, "module", "consensus"), thisConfig, state, privVal, app) css[i].SetTimeoutTicker(tickerFunc()) - css[i].Start(ctx) + require.NoError(t, css[i].Start(ctx)) } return css, genDoc, peer0Config, func() { for _, dir := range configRootDirs { diff --git a/internal/consensus/reactor_test.go b/internal/consensus/reactor_test.go index b1bf95cf2..d05c6f63f 100644 --- a/internal/consensus/reactor_test.go +++ b/internal/consensus/reactor_test.go @@ -517,7 +517,7 @@ func TestReactorWithEvidence(t *testing.T) { cs.SetPrivValidator(ctx, pv) cs.SetTimeoutTicker(tickerFunc()) - cs.Start(ctx) + require.NoError(t, cs.Start(ctx)) states[i] = cs } diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 860017131..853817cfb 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -482,7 +482,6 @@ func (cs *State) OnStart(ctx context.Context) error { // // this is only used in tests. func (cs *State) startRoutines(ctx context.Context, maxSteps int) { - return err := cs.timeoutTicker.Start(ctx) if err != nil { cs.logger.Error("failed to start timeout ticker", "err", err) diff --git a/internal/p2p/conn/connection.go b/internal/p2p/conn/connection.go index 693a7ce58..75320e206 100644 --- a/internal/p2p/conn/connection.go +++ b/internal/p2p/conn/connection.go @@ -45,8 +45,8 @@ const ( defaultSendRate = int64(512000) // 500KB/s defaultRecvRate = int64(512000) // 500KB/s defaultSendTimeout = 10 * time.Second - defaultPingInterval = 60 * time.Second - defaultPongTimeout = 90 * time.Second + defaultPingInterval = 30 * time.Second + defaultPongTimeout = 5 * time.Minute ) type receiveCbFunc func(ctx context.Context, chID ChannelID, msgBytes []byte)