Skip to content

[CRE-491] Cleanup LLO folder: testutils + logger#21692

Merged
pavel-raykov merged 3 commits intodevelopfrom
clean-llo
Mar 25, 2026
Merged

[CRE-491] Cleanup LLO folder: testutils + logger#21692
pavel-raykov merged 3 commits intodevelopfrom
clean-llo

Conversation

@pavel-raykov
Copy link
Collaborator

No description provided.

@pavel-raykov pavel-raykov changed the title [CRE-491] Cleanup LLO folder: t.Context + logger [CRE-491] Cleanup LLO folder: testutils + logger Mar 25, 2026
@github-actions
Copy link
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link

trunk-io bot commented Mar 25, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link

@pavel-raykov pavel-raykov marked this pull request as ready for review March 25, 2026 13:56
@pavel-raykov pavel-raykov requested review from a team as code owners March 25, 2026 13:56
@pavel-raykov pavel-raykov requested review from Copilot and jmank88 March 25, 2026 13:56
@pavel-raykov pavel-raykov requested review from brunotm and removed request for mchain0 March 25, 2026 13:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Risk Rating: MEDIUM

This PR cleans up the LLO code/tests to use chainlink-common logger + test helpers (instead of core/logger and core/internal/testutils) and scopes a previously shared HTTP backoff helper into the channel definitions cache.

Changes:

  • Migrates LLO-related tests to testing.T.Context() and chainlink-common/pkg/logger + chainlink-common/pkg/utils/tests.
  • Updates mercury transmitter server to use logger.Nop() instead of the core null logger.
  • Removes core/utils.NewHTTPFetchBackoff and adds an equivalent private helper in the channel definitions cache; removes MustRandBytes from core/internal/testutils.

Scrupulous human review areas:

  • core/services/llo/keyring.go: logger type/behavior change (logger.Sugared(lggr).Named(...)) in a security-adjacent component (sign/verify).
  • core/services/llo/mercurytransmitter/server.go: change from corelogger.NullLogger to logger.Nop() (ensure equivalent behavior for codec logging).
  • core/services/llo/channeldefinitions/onchain_channel_definition_cache.go: retry/backoff behavior relocation (ensure no behavioral drift in fetch retry timing).

Suggested reviewers (per CODEOWNERS):

  • /core/services/llo/**: @smartcontractkit/data-streams-engineers, @smartcontractkit/core
  • core/utils/** (falls back to root): @smartcontractkit/foundations, @smartcontractkit/core

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
core/utils/utils.go Removes shared NewHTTPFetchBackoff helper from core utils.
core/services/llo/retirement/retirement_report_cache_test.go Switches to chainlink-common logger in tests.
core/services/llo/report_codecs_test.go Uses chainlink-common test logger helper.
core/services/llo/orm_test.go Replaces internal testutils usage with t.Context() and evm testutils address helper.
core/services/llo/mercurytransmitter/transmitter_test.go Migrates logger/context/timeout helpers to chainlink-common.
core/services/llo/mercurytransmitter/server.go Swaps null logger to logger.Nop() and uses chainlink-common/pkg/utils.
core/services/llo/mercurytransmitter/queue_test.go Migrates observed logger + log assertions to chainlink-common helpers.
core/services/llo/mercurytransmitter/persistence_manager_test.go Migrates observed logger + context/log assertions to chainlink-common.
core/services/llo/mercurytransmitter/orm_test.go Uses t.Context() instead of internal testutils.
core/services/llo/keyring_test.go Switches to chainlink-common logger and replaces removed random-bytes helper.
core/services/llo/keyring.go Switches logger import to chainlink-common and adjusts logger wrapping.
core/services/llo/cre/transmitter_test.go Migrates tests to chainlink-common logger helper.
core/services/llo/cleanup_test.go Migrates cleanup tests to t.Context() and chainlink-common logger.
core/services/llo/channeldefinitions/static_channel_definitions_cache.go Import cleanup/reorder while standardizing logger usage.
core/services/llo/channeldefinitions/onchain_channel_definition_cache_test.go Uses evm testutils import for addresses.
core/services/llo/channeldefinitions/onchain_channel_definition_cache.go Replaces core utils backoff call with local helper; import cleanup.
core/services/llo/channeldefinitions/channel_definition_cache_factory_test.go Migrates test logger to chainlink-common.
core/services/llo/bm/dummy_transmitter_test.go Migrates benchmark transmitter test to chainlink-common logger/tests helpers.
core/internal/testutils/testutils.go Removes MustRandBytes from internal testutils.

Comment on lines 13 to 16
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types"
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file imports github.com/smartcontractkit/libocr/offchainreporting2plus/types twice (once unaliased as types and again as ocrtypes). Duplicate import paths are a compile error. Keep a single import (either use types.* everywhere or alias it once, e.g. ocrtypes, and update types.OnchainPublicKey accordingly).

Copilot uses AI. Check for mistakes.
@@ -14,10 +14,9 @@ import (
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import block includes github.com/smartcontractkit/libocr/offchainreporting2plus/types twice (unaliased and as ocrtypes). Go forbids importing the same path multiple times, so this test will not compile. Import it once and use a single package name throughout (e.g. replace ocrtypes.Report with types.Report, or vice versa).

Suggested change
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 17
llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo"
"github.com/smartcontractkit/chainlink-data-streams/llo/reportcodecs/evm"

"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink/v2/core/utils/crypto"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/smartcontractkit/libocr/offchainreporting2plus/types is imported twice in this file (once as types and again as ocrtypes). That is a compile error. Import the package only once (choose one name) and update the types.*/ocrtypes.* references accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 25
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo"
"github.com/smartcontractkit/chainlink-common/pkg/utils"
"github.com/smartcontractkit/chainlink-data-streams/llo"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import block currently includes github.com/smartcontractkit/libocr/offchainreporting2plus/types twice (once as types and once as ocr2types). Go does not allow duplicate import paths, so this file will not compile. Import it once (e.g. as ocr2types) and update the single types.ConfigDigest usage to the chosen name.

Copilot uses AI. Check for mistakes.
@@ -10,7 +10,7 @@ import (
ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types"
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import block brings in github.com/smartcontractkit/libocr/offchainreporting2plus/types twice (as ocr2types and ocrtypes). Go does not allow duplicate import paths, so this test will not compile. Import it once (pick one alias) and update the references accordingly.

Suggested change
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

Copilot uses AI. Check for mistakes.
@pavel-raykov pavel-raykov enabled auto-merge March 25, 2026 16:24
@pavel-raykov pavel-raykov added this pull request to the merge queue Mar 25, 2026
Merged via the queue into develop with commit 9a03597 Mar 25, 2026
217 of 219 checks passed
@pavel-raykov pavel-raykov deleted the clean-llo branch March 25, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants