Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop unnecessary nolint comments #477

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions qbft/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
11 changes: 7 additions & 4 deletions qbft/timeout.go
Original file line number Diff line number Diff line change
@@ -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
GalRogozinski marked this conversation as resolved.
Show resolved Hide resolved
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)
)
Expand Down
2 changes: 1 addition & 1 deletion ssv/runner_validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (b *BaseRunner) ValidatePostConsensusMsg(runner Runner, psigMsgs *types.Par
}

// TODO https://github.com/ssvlabs/ssv-spec/issues/142 need to fix with this issue solution instead.
if b.State.DecidedValue == nil || len(b.State.DecidedValue) == 0 {
if len(b.State.DecidedValue) == 0 {
return errors.New("no decided value")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/duties/newduty/finished.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/duties/newduty/not_decided.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/preconsensus/post_decided.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/preconsensus/post_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down