diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 404b98dba..20ec7b46f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -39,7 +39,7 @@ jobs: - name: Golangci-lint uses: golangci/golangci-lint-action@v2 with: - args: --print-issued-lines --sort-results --no-config --timeout=10m --disable-all -E deadcode --skip-files=validator/web/site_data.go + args: --print-issued-lines --sort-results --no-config --timeout=10m --disable-all -E deadcode -E errcheck -E gosimple --skip-files=validator/web/site_data.go build: name: Build diff --git a/beacon-chain/core/altair/upgrade_test.go b/beacon-chain/core/altair/upgrade_test.go index 530bc7afe..44e020322 100644 --- a/beacon-chain/core/altair/upgrade_test.go +++ b/beacon-chain/core/altair/upgrade_test.go @@ -9,7 +9,6 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/core/altair" "github.com/prysmaticlabs/prysm/beacon-chain/core/helpers" "github.com/prysmaticlabs/prysm/beacon-chain/core/time" - "github.com/prysmaticlabs/prysm/beacon-chain/state" stateAltair "github.com/prysmaticlabs/prysm/beacon-chain/state/v2" "github.com/prysmaticlabs/prysm/config/params" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" @@ -79,8 +78,6 @@ func TestUpgradeToAltair(t *testing.T) { preForkState := st.Copy() aState, err := altair.UpgradeToAltair(context.Background(), st) require.NoError(t, err) - _, ok := aState.(state.BeaconStateAltair) - require.Equal(t, true, ok) require.Equal(t, preForkState.GenesisTime(), aState.GenesisTime()) require.DeepSSZEqual(t, preForkState.GenesisValidatorRoot(), aState.GenesisValidatorRoot()) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go index 811660bc2..4a47bd047 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go @@ -9,6 +9,7 @@ import ( "github.com/prysmaticlabs/prysm/config/params" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" aggtesting "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/attestation/aggregation/testing" + "github.com/prysmaticlabs/prysm/testing/require" ) func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { @@ -49,7 +50,8 @@ func BenchmarkProposerAtts_sortByProfitability(b *testing.B) { for i, att := range atts { attsCopy[i] = ethpb.CopyAttestation(att) } - attsCopy.sortByProfitability() + _, err := attsCopy.sortByProfitability() + require.NoError(b, err, "Could not sort attestations by profitability") } for _, tt := range tests { diff --git a/beacon-chain/sync/batch_verifier.go b/beacon-chain/sync/batch_verifier.go index f62c58ad1..7c412cc40 100644 --- a/beacon-chain/sync/batch_verifier.go +++ b/beacon-chain/sync/batch_verifier.go @@ -79,7 +79,7 @@ func (s *Service) validateWithBatchVerifier(ctx context.Context, message string, } func verifyBatch(verifierBatch []*signatureVerifier) { - if verifierBatch == nil || len(verifierBatch) == 0 { + if len(verifierBatch) == 0 { return } aggSet := verifierBatch[0].set diff --git a/crypto/bls/blst/public_key.go b/crypto/bls/blst/public_key.go index c9d7da69f..95119a6d5 100644 --- a/crypto/bls/blst/public_key.go +++ b/crypto/bls/blst/public_key.go @@ -57,7 +57,7 @@ func AggregatePublicKeys(pubs [][]byte) (common.PublicKey, error) { if features.Get().SkipBLSVerify { return &PublicKey{}, nil } - if pubs == nil || len(pubs) == 0 { + if len(pubs) == 0 { return nil, errors.New("nil or empty public keys") } agg := new(blstAggregatePublicKey)