Skip to content

Emit node job info platform events#22175

Open
gheorghestrimtu wants to merge 9 commits intodevelopfrom
RANE-4423-emit-node-transmitter-addresses
Open

Emit node job info platform events#22175
gheorghestrimtu wants to merge 9 commits intodevelopfrom
RANE-4423-emit-node-transmitter-addresses

Conversation

@gheorghestrimtu
Copy link
Copy Markdown
Collaborator

@gheorghestrimtu gheorghestrimtu commented Apr 24, 2026

Summary

Updates the node-platform job info emitter to use the new NodeJobInfo.submitter_addresses proto shape from the merged chainlink-protos/node-platform commit acccf17ece83099c7e4d91bd3e40b2d65b47b356.

The emitted entries preserve the Chainlink job source field names through field_path, including:

  • transmitterAddress
  • transmitterID
  • relayConfig.sendingKeys
  • relayConfig.dualTransmission.transmitterAddress
  • fromAddresses
  • oracle_factory.transmitter_id
  • observationSource.ethtx.from

The implementation emits one source-aware submitter address entry per chain/job/plugin/field path, with deduped sorted addresses.

Notes

  • OCR2 Mercury and LLO transmitterID values are excluded because those are offchain transmitter identities, not gas-paying on-chain submitter addresses.
  • Static job fields are covered for OCR, OCR2, VRF, BlockhashStore, BlockHeaderFeeder, LegacyGasStationServer, Standard Capabilities, and explicit static ethtx.from pipeline values.
  • Legacy Keeper job support was removed on latest develop, so the old Keeper fromAddress path is no longer emitted.
  • The chainlink-protos/node-platform dependency was updated across root and nested Go modules via make gomodtidy.

Validation

  • make gomodtidy
  • GOTOOLCHAIN=auto GOCACHE=/tmp/go-build go test -count=1 ./core/services/chainlink -run 'NodePlatform(BuildInfo|JobInfo)'
  • GOTOOLCHAIN=auto GOCACHE=/tmp/go-build go test -count=1 ./core/services/chainlink -run '^$'
  • cd system-tests/tests && GOTOOLCHAIN=auto GOCACHE=/tmp/go-build go test -run '^$' ./...
  • git diff --check

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

✅ No conflicts with other open PRs targeting develop

@gheorghestrimtu gheorghestrimtu added the build-publish Build and Publish image to SDLC label Apr 24, 2026
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 24, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@gheorghestrimtu gheorghestrimtu force-pushed the RANE-4423-emit-node-transmitter-addresses branch from 6317f74 to 7cc621c Compare April 28, 2026 17:44
@gheorghestrimtu gheorghestrimtu marked this pull request as ready for review April 30, 2026 19:22
@gheorghestrimtu gheorghestrimtu requested a review from a team as a code owner April 30, 2026 19:22
Copilot AI review requested due to automatic review settings April 30, 2026 19:22
@gheorghestrimtu gheorghestrimtu requested review from a team as code owners April 30, 2026 19:22
Copy link
Copy Markdown
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 — introduces a new always-on background service that periodically queries the jobs table and emits telemetry events.

Updates node-platform telemetry emission to support the new NodeJobInfo.submitter_addresses proto shape and exposes a new NodePlatformJobInfo health check alongside existing node-platform build info emission.

Changes:

  • Add NodePlatformJobInfoService to emit common.v1.NodeJobInfo platform events with source-aware submitter address entries derived from job specs and pipeline ETHTx tasks.
  • Wire the new service into NewApplication and update health endpoint golden test fixtures to include NodePlatformJobInfo.
  • Bump chainlink-protos/node-platform dependency (root + nested Go modules) to the commit that contains the new proto shape.

Areas requiring scrupulous human review:

  • core/services/chainlink/node_platform.go: the job enumeration strategy inside submitterAddresses() (DB load / runtime impact) and the address extraction logic from job/pipeline fields.

Reviewed changes

Copilot reviewed 16 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
testdata/scripts/health/multi-chain.txtar Updates golden health output to include NodePlatformJobInfo.
testdata/scripts/health/multi-chain-loopp.txtar Updates golden health output to include NodePlatformJobInfo.
testdata/scripts/health/default.txtar Updates golden health output to include NodePlatformJobInfo.
core/web/testdata/body/health.txt Updates plain-text health fixture with NodePlatformJobInfo.
core/web/testdata/body/health.json Updates JSON health fixture with NodePlatformJobInfo check block.
core/web/testdata/body/health.html Updates HTML health fixture with NodePlatformJobInfo section.
core/services/chainlink/node_platform.go Implements NodePlatformJobInfoService + submitter-address extraction helpers; renames build-info entity const.
core/services/chainlink/node_platform_test.go Adds unit test covering submitter address extraction/emission behavior.
core/services/chainlink/application.go Wires NodePlatformJobInfoService into application service list.
go.mod Bumps chainlink-protos/node-platform version.
go.sum Updates checksums for new chainlink-protos/node-platform version.
deployment/go.mod Bumps chainlink-protos/node-platform (indirect).
deployment/go.sum Updates checksums for dependency bump.
core/scripts/go.mod Bumps chainlink-protos/node-platform (indirect).
core/scripts/go.sum Updates checksums for dependency bump.
integration-tests/go.mod Bumps chainlink-protos/node-platform (indirect).
integration-tests/go.sum Updates checksums for dependency bump.
integration-tests/load/go.mod Bumps chainlink-protos/node-platform (indirect).
integration-tests/load/go.sum Updates checksums for dependency bump.
system-tests/lib/go.mod Bumps chainlink-protos/node-platform (indirect).
system-tests/lib/go.sum Updates checksums for dependency bump.
system-tests/tests/go.mod Bumps chainlink-protos/node-platform (indirect).
system-tests/tests/go.sum Updates checksums for dependency bump.

Comment on lines +250 to +262
func (s *NodePlatformJobInfoService) submitterAddresses(ctx context.Context) []*commonv1.NodeSubmitterAddress {
if s.opts.JobReader == nil {
return nil
}

jobs, _, err := s.opts.JobReader.FindJobs(ctx, 0, math.MaxInt)
if err != nil {
s.eng.Warnw("failed to resolve node-platform submitter addresses", "err", err)
return nil
}

return nodeSubmitterAddressesFromJobs(jobs)
}
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

submitterAddresses calls FindJobs(ctx, 0, math.MaxInt), which loads all jobs (and FindJobs also loads job type details) every beat. On nodes with many jobs this can cause large DB queries, high memory usage, and long emit latencies. Consider paging through jobs with a reasonable limit (e.g., 500/1000) using the returned count, or adding a lighter-weight query on the JobReader that returns only the fields needed for submitter address extraction.

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link
Copy Markdown

Comment on lines +27 to +29
nodePlatformBuildInfoEntity = "common.v1.NodeBuildInfo"
nodePlatformJobInfoEntity = "common.v1.NodeJobInfo"
nodePlatformDataSchema = "/node-platform/common/v1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does common mean in this context?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a an example of the raw structure being emitted? I'm having trouble reading all the nested helper funcs.

addNodeSubmitterAddress(bySource, spec.OracleFactory.ChainID, jobType(jb, job.StandardCapabilities), "", nodeSubmitterFieldOracleFactoryTransmitterID, spec.OracleFactory.TransmitterID)
}

func addPipelineETHTxSubmitterAddresses(bySource map[nodeSubmitterAddressKey]map[string]struct{}, jb job.Job) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we find a way to have these funcs produce a result instead of modify an argument? If you are worried about efficiency, then iter.Seq2s can be used. Otherwise, a basic builder type with methods would help.

Comment on lines +587 to +594
addresses := make([]string, 0, len(bySource[key]))
for address := range bySource[key] {
addresses = append(addresses, address)
}
sort.Strings(addresses)
if len(addresses) == 0 {
continue
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
addresses := make([]string, 0, len(bySource[key]))
for address := range bySource[key] {
addresses = append(addresses, address)
}
sort.Strings(addresses)
if len(addresses) == 0 {
continue
}
if len(bySource[key]) == 0 {
continue
}
addresses := slices.Sorted(maps.Keys(bySource[key])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-publish Build and Publish image to SDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants