diff --git a/common/client/transaction_sender_test.go b/common/client/transaction_sender_test.go index 656791b7e86..14dc0799a6a 100644 --- a/common/client/transaction_sender_test.go +++ b/common/client/transaction_sender_test.go @@ -258,7 +258,6 @@ func TestTransactionSender_SendTransaction(t *testing.T) { _, txSender = newTestTransactionSender(t, chainID, logger.Test(t), []Node[types.ID, TestSendTxRPCClient]{fastNode, slowNode}, []SendOnlyNode[types.ID, TestSendTxRPCClient]{slowSendOnly}) - }) t.Run("Returns error if there is no healthy primary nodes", func(t *testing.T) { chainID := types.RandomID() diff --git a/core/capabilities/ccip/launcher/deployment.go b/core/capabilities/ccip/launcher/deployment.go index 870c0409494..c2d59a19cf2 100644 --- a/core/capabilities/ccip/launcher/deployment.go +++ b/core/capabilities/ccip/launcher/deployment.go @@ -2,6 +2,7 @@ package launcher import ( "fmt" + mapset "github.com/deckarep/golang-set/v2" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "golang.org/x/exp/maps" diff --git a/core/capabilities/ccip/launcher/launcher.go b/core/capabilities/ccip/launcher/launcher.go index 76a6c204058..1e5a6228266 100644 --- a/core/capabilities/ccip/launcher/launcher.go +++ b/core/capabilities/ccip/launcher/launcher.go @@ -294,7 +294,6 @@ func (l *launcher) processRemoved(removed map[registrysyncer.DonID]registrysynce if err := p.CloseAll(); err != nil { return fmt.Errorf("failed to shutdown oracles for CCIP DON %d: %w", id, err) - } // after a successful shutdown we can safely remove the DON deployment from the map. diff --git a/core/chains/evm/client/simulated_backend_client.go b/core/chains/evm/client/simulated_backend_client.go index a67670df318..fd645203856 100644 --- a/core/chains/evm/client/simulated_backend_client.go +++ b/core/chains/evm/client/simulated_backend_client.go @@ -363,7 +363,7 @@ func (c *SimulatedBackendClient) SubscribeToHeads( } head = &evmtypes.Head{ Difficulty: h.Difficulty, - Timestamp: time.Unix(int64(h.Time), 0), //nolint:gosec // G115 false positive + Timestamp: time.Unix(int64(h.Time), 0), Number: h.Number.Int64(), Hash: h.Hash(), ParentHash: h.ParentHash, diff --git a/core/cmd/nodes_commands.go b/core/cmd/nodes_commands.go index 2afff31ace0..0420ef66ec4 100644 --- a/core/cmd/nodes_commands.go +++ b/core/cmd/nodes_commands.go @@ -6,9 +6,10 @@ import ( "slices" "strings" + "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" - "github.com/urfave/cli" ) func initNodeSubCmds(s *Shell) []cli.Command { diff --git a/core/services/llo/mercurytransmitter/orm.go b/core/services/llo/mercurytransmitter/orm.go index 045161395b5..f557e2293a5 100644 --- a/core/services/llo/mercurytransmitter/orm.go +++ b/core/services/llo/mercurytransmitter/orm.go @@ -72,7 +72,7 @@ func (o *orm) Insert(ctx context.Context, transmissions []*Transmission) error { DonID: o.donID, ServerURL: t.ServerURL, ConfigDigest: t.ConfigDigest, - SeqNr: int64(t.SeqNr), //nolint:gosec // G115 false positive + SeqNr: int64(t.SeqNr), Report: t.Report.Report, LifecycleStage: string(t.Report.Info.LifeCycleStage), ReportFormat: uint32(t.Report.Info.ReportFormat), diff --git a/core/services/llo/onchain_channel_definition_cache.go b/core/services/llo/onchain_channel_definition_cache.go index 78078d5c36e..461c309a73a 100644 --- a/core/services/llo/onchain_channel_definition_cache.go +++ b/core/services/llo/onchain_channel_definition_cache.go @@ -279,7 +279,6 @@ func (c *channelDefinitionCache) readLogs(ctx context.Context) (err error) { c.newLogCh <- unpacked } c.newLogMu.Unlock() - } return nil diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 98f56d2a724..d98a57c7182 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -683,9 +683,9 @@ func (d *Delegate) newServicesGenericPlugin( providerClientConn = providerConn.ClientConn() } else { // We chose to deal with the difference between a LOOP provider and an embedded provider here rather than - //in NewServerAdapter because this has a smaller blast radius, as the scope of this workaround is to - //enable the medianpoc for EVM and not touch the other providers. - //TODO: remove this workaround when the EVM relayer is running inside of an LOOPP + // in NewServerAdapter because this has a smaller blast radius, as the scope of this workaround is to + // enable the medianpoc for EVM and not touch the other providers. + // TODO: remove this workaround when the EVM relayer is running inside of an LOOPP d.lggr.Info("provider is not a LOOPP provider, switching to provider server") ps, err2 := loop.NewProviderServer(provider, types.OCR2PluginType(pCfg.ProviderType), d.lggr) diff --git a/core/services/ocr2/validate/validate.go b/core/services/ocr2/validate/validate.go index c2f3e455232..27a5a885369 100644 --- a/core/services/ocr2/validate/validate.go +++ b/core/services/ocr2/validate/validate.go @@ -269,8 +269,8 @@ func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc loopID := fmt.Sprintf("%s-%s-%s", p.PluginName, spec.ContractID, spec.GetID()) // Starting and stopping a LOOPP isn't efficient; ideally, we'd initiate the LOOPP once and then reference - //it later to conserve resources. This code will be revisited once BCF-3126 is implemented, and we have - //the ability to reference the LOOPP for future use. + // it later to conserve resources. This code will be revisited once BCF-3126 is implemented, and we have + // the ability to reference the LOOPP for future use. cmdFn, grpcOpts, err := rc.RegisterLOOP(plugins.CmdConfig{ ID: loopID, Cmd: command, diff --git a/core/services/registrysyncer/syncer.go b/core/services/registrysyncer/syncer.go index 461824b403b..d6fd2f7c89c 100644 --- a/core/services/registrysyncer/syncer.go +++ b/core/services/registrysyncer/syncer.go @@ -76,7 +76,6 @@ func New( registryAddress string, orm ORM, ) (RegistrySyncer, error) { - metricLabeler, err := newSyncerMetricLabeler() if err != nil { return nil, fmt.Errorf("failed to create syncer metric labeler: %w", err) diff --git a/core/services/relay/evm/commit_provider.go b/core/services/relay/evm/commit_provider.go index 1a9260120f3..95d7371ab16 100644 --- a/core/services/relay/evm/commit_provider.go +++ b/core/services/relay/evm/commit_provider.go @@ -225,7 +225,7 @@ func (p *SrcCommitProvider) Start(ctx context.Context) error { if p.startBlock > math.MaxInt64 { return fmt.Errorf("start block overflows int64: %d", p.startBlock) } - return p.lp.Replay(ctx, int64(p.startBlock)) //nolint:gosec // G115 false positive + return p.lp.Replay(ctx, int64(p.startBlock)) } return nil } @@ -236,7 +236,7 @@ func (p *DstCommitProvider) Start(ctx context.Context) error { if p.startBlock > math.MaxInt64 { return fmt.Errorf("start block overflows int64: %d", p.startBlock) } - return p.lp.Replay(ctx, int64(p.startBlock)) //nolint:gosec // G115 false positive + return p.lp.Replay(ctx, int64(p.startBlock)) } return nil } diff --git a/core/services/relay/evm/mercury/transmitter.go b/core/services/relay/evm/mercury/transmitter.go index 745eb1db646..be500593bf3 100644 --- a/core/services/relay/evm/mercury/transmitter.go +++ b/core/services/relay/evm/mercury/transmitter.go @@ -289,7 +289,6 @@ func (s *server) runQueueLoop(stopCh services.StopChan, wg *sync.WaitGroup, feed const TransmitQueueMaxSize = 10_000 // hardcode this for legacy transmitter since we want the config var to apply only to LLO func newServer(lggr logger.Logger, cfg TransmitterConfig, client wsrpc.Client, pm *PersistenceManager, serverURL, feedIDHex string) *server { - return &server{ logger.Sugared(lggr), cfg.TransmitTimeout().Duration(), diff --git a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go index 98ca510a9ca..8b88ad73ea9 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go @@ -139,23 +139,6 @@ func TestVRFV08_CompareFieldHash(t *testing.T) { } } -// randomKey deterministically generates a secp256k1 key. -// -// Never use this if cryptographic security is required -//func randomKey(t *testing.T, r *mrand.Rand) *ecdsa.PrivateKey { -// secretKey := vrfkey.FieldSize -// for secretKey.Cmp(vrfkey.FieldSize) >= 0 { // Keep picking until secretKey < fieldSize -// secretKey = randomUint256(t, r) -// } -// cKey := crypto.ToECDSAUnsafe(secretKey.Bytes()) -// return cKey -//} -// -// pair returns the inputs as a length-2 big.Int array. Useful for translating -// coordinates to the uint256[2]'s VRF.sol uses to represent secp256k1 points. -//func pair(x, y *big.Int) [2]*big.Int { return [2]*big.Int{x, y} } -//func asPair(p kyber.Point) [2]*big.Int { return pair(secp256k1.Coordinates(p)) } - func TestVRFV08_CompareHashToCurve(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(4)) @@ -173,40 +156,6 @@ func TestVRFV08_CompareHashToCurve(t *testing.T) { } } -// randomPoint deterministically simulates a uniform sample of secp256k1 points, -// given r's seed -// -// Never use this if cryptographic security is required -//func randomPoint(t *testing.T, r *mrand.Rand) kyber.Point { -// p, err := vrfkey.HashToCurve(vrfkey.Generator, randomUint256(t, r), func(*big.Int) {}) -// require.NoError(t, err, -// "failed to hash random value to secp256k1 while generating random point") -// if r.Int63n(2) == 1 { // Uniform sample of ±p -// p.Neg(p) -// } -// return p -//} -// -//// randomPointWithPair returns a random secp256k1, both as a kyber.Point and as -//// a pair of *big.Int's. Useful for translating between the types needed by the -//// golang contract wrappers. -//func randomPointWithPair(t *testing.T, r *mrand.Rand) (kyber.Point, [2]*big.Int) { -// p := randomPoint(t, r) -// return p, asPair(p) -//} - -// randomScalar deterministically simulates a uniform sample of secp256k1 -// scalars, given r's seed -// -// Never use this if cryptographic security is required -//func randomScalar(t *testing.T, r *mrand.Rand) kyber.Scalar { -// s := randomUint256(t, r) -// for s.Cmp(secp256k1.GroupOrder) >= 0 { -// s = randomUint256(t, r) -// } -// return secp256k1.IntToScalar(s) -//} - func TestVRFV08_CheckSolidityPointAddition(t *testing.T) { t.Parallel() r := mrand.New(mrand.NewSource(5)) diff --git a/core/store/migrate/migrations/0036_external_job_id.go b/core/store/migrate/migrations/0036_external_job_id.go index 47442124a33..a32ff470d67 100644 --- a/core/store/migrate/migrations/0036_external_job_id.go +++ b/core/store/migrate/migrations/0036_external_job_id.go @@ -56,7 +56,6 @@ func Up36(ctx context.Context, tx *sql.Tx) error { stmt += ` AS vals(external_job_id, id) WHERE vals.id = j.id` if _, err := tx.ExecContext(ctx, stmt); err != nil { return err - } }