From 642d9d2a2d34fc6da9633e984af3337846fe83bc Mon Sep 17 00:00:00 2001 From: MatheusFranco99 <48058141+MatheusFranco99@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:12:13 +0100 Subject: [PATCH] Meta - Drop unnecessary nolint comments (#477) * Remove nolint comment and export timeout variables * Drop unnecessary nolint * Add comment * Fix lint issue --- qbft/instance.go | 2 -- qbft/timeout.go | 11 +++++++---- .../runner/duties/newduty/consensus_not_started.go | 2 -- ssv/spectest/tests/runner/duties/newduty/finished.go | 2 -- .../tests/runner/duties/newduty/not_decided.go | 2 -- .../runner/duties/newduty/post_future_decided.go | 2 -- .../tests/runner/preconsensus/post_decided.go | 2 -- ssv/spectest/tests/runner/preconsensus/post_finish.go | 2 -- 8 files changed, 7 insertions(+), 18 deletions(-) diff --git a/qbft/instance.go b/qbft/instance.go index 76a4cd458..ba2ef75f0 100644 --- a/qbft/instance.go +++ b/qbft/instance.go @@ -67,11 +67,9 @@ func (i *Instance) Start(value []byte, height Height) { // propose if this node is the proposer if proposer(i.State, i.GetConfig(), FirstRound) == i.State.CommitteeMember.OperatorID { proposal, err := CreateProposal(i.State, i.signer, i.StartValue, nil, nil) - // nolint if err != nil { fmt.Printf("%s\n", err.Error()) } - // nolint if err := i.Broadcast(proposal); err != nil { fmt.Printf("%s\n", err.Error()) } diff --git a/qbft/timeout.go b/qbft/timeout.go index c575e9c85..58caf4931 100644 --- a/qbft/timeout.go +++ b/qbft/timeout.go @@ -1,14 +1,17 @@ package qbft import ( - "github.com/pkg/errors" "time" + + "github.com/pkg/errors" ) +// At the moment, these variables are useful for the node implementation +// TODO: It's usage should be updated in the PR https://github.com/ssvlabs/ssv-spec/pull/352 var ( - quickTimeoutThreshold = Round(8) //nolint - quickTimeout = 2 * time.Second //nolint - slowTimeout = 2 * time.Minute //nolint + QuickTimeoutThreshold = Round(8) + QuickTimeout = 2 * time.Second + SlowTimeout = 2 * time.Minute // CutoffRound which round the instance should stop its timer and progress no further CutoffRound = 12 // stop processing attestations after 8*2+120*3 = 6.2 min (~ 1 epoch) ) diff --git a/ssv/spectest/tests/runner/duties/newduty/consensus_not_started.go b/ssv/spectest/tests/runner/duties/newduty/consensus_not_started.go index 304cd4faf..ed4655c91 100644 --- a/ssv/spectest/tests/runner/duties/newduty/consensus_not_started.go +++ b/ssv/spectest/tests/runner/duties/newduty/consensus_not_started.go @@ -12,8 +12,6 @@ import ( func ConsensusNotStarted() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check error - // nolint startRunner := func(r ssv.Runner, duty types.Duty) ssv.Runner { r.GetBaseRunner().State = ssv.NewRunnerState(3, duty) return r diff --git a/ssv/spectest/tests/runner/duties/newduty/finished.go b/ssv/spectest/tests/runner/duties/newduty/finished.go index 451a136e0..f92e18275 100644 --- a/ssv/spectest/tests/runner/duties/newduty/finished.go +++ b/ssv/spectest/tests/runner/duties/newduty/finished.go @@ -14,8 +14,6 @@ import ( func Finished() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check error - // nolint finishRunner := func(r ssv.Runner, duty types.Duty, finishController bool) ssv.Runner { r.GetBaseRunner().State = ssv.NewRunnerState(3, duty) diff --git a/ssv/spectest/tests/runner/duties/newduty/not_decided.go b/ssv/spectest/tests/runner/duties/newduty/not_decided.go index 8f6bd8174..3f796ed15 100644 --- a/ssv/spectest/tests/runner/duties/newduty/not_decided.go +++ b/ssv/spectest/tests/runner/duties/newduty/not_decided.go @@ -16,8 +16,6 @@ import ( func NotDecided() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check error - // nolint startRunner := func(r ssv.Runner, duty types.Duty) ssv.Runner { r.GetBaseRunner().State = ssv.NewRunnerState(3, duty) r.GetBaseRunner().State.RunningInstance = qbft.NewInstance( diff --git a/ssv/spectest/tests/runner/duties/newduty/post_future_decided.go b/ssv/spectest/tests/runner/duties/newduty/post_future_decided.go index 32ef225f8..dc121e836 100644 --- a/ssv/spectest/tests/runner/duties/newduty/post_future_decided.go +++ b/ssv/spectest/tests/runner/duties/newduty/post_future_decided.go @@ -17,8 +17,6 @@ import ( func PostFutureDecided() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check error - // nolint futureDecide := func(r ssv.Runner, duty types.Duty) ssv.Runner { r.GetBaseRunner().State = ssv.NewRunnerState(3, duty) r.GetBaseRunner().State.RunningInstance = qbft.NewInstance( diff --git a/ssv/spectest/tests/runner/preconsensus/post_decided.go b/ssv/spectest/tests/runner/preconsensus/post_decided.go index eeba2978f..a2e6ba89f 100644 --- a/ssv/spectest/tests/runner/preconsensus/post_decided.go +++ b/ssv/spectest/tests/runner/preconsensus/post_decided.go @@ -16,8 +16,6 @@ import ( func PostDecided() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check errors - // nolint decideRunner := func(r ssv.Runner, duty *types.ValidatorDuty, decidedValue *types.ValidatorConsensusData, preMsgs []*types.PartialSignatureMessages) ssv.Runner { r.GetBaseRunner().State = ssv.NewRunnerState(3, duty) for _, msg := range preMsgs { diff --git a/ssv/spectest/tests/runner/preconsensus/post_finish.go b/ssv/spectest/tests/runner/preconsensus/post_finish.go index c5300b66c..d1a572a22 100644 --- a/ssv/spectest/tests/runner/preconsensus/post_finish.go +++ b/ssv/spectest/tests/runner/preconsensus/post_finish.go @@ -15,8 +15,6 @@ import ( func PostFinish() tests.SpecTest { ks := testingutils.Testing4SharesSet() - // TODO: check errors - // nolint finishRunner := func(runner ssv.Runner, duty *types.ValidatorDuty) ssv.Runner { runner.GetBaseRunner().State = ssv.NewRunnerState(3, duty) runner.GetBaseRunner().State.Finished = true