Skip to content

DurableEmitter: Refactor Core Integration#22648

Draft
DylanTinianov wants to merge 16 commits into
developfrom
CRE-4422-refactor-durable-emitter
Draft

DurableEmitter: Refactor Core Integration#22648
DylanTinianov wants to merge 16 commits into
developfrom
CRE-4422-refactor-durable-emitter

Conversation

@DylanTinianov
Copy link
Copy Markdown
Contributor

@DylanTinianov DylanTinianov commented May 26, 2026

Integrates DurableEmitter with core.

Requires

DurableEmitter: Refactor with batch emitter

@DylanTinianov DylanTinianov self-assigned this May 26, 2026
@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 May 26, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 26, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@DylanTinianov DylanTinianov changed the title DurableEmitter: Refactor with batch emitter DurableEmitter: Refactor Core Integration May 26, 2026
patrickhuie19
patrickhuie19 previously approved these changes May 27, 2026
Comment thread core/services/chainlink/application.go
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)
6.28% Technical Debt Ratio on New Code (required ≤ 4%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube IDE SonarQube IDE

@pkcll
Copy link
Copy Markdown
Collaborator

pkcll commented May 28, 2026

Building on the helper added in smartcontractkit/chainlink-common#2096 (chipingress.NewHeaderProvider), here is a tight, one-file change that wires it through application.go without touching anything else.

Proposed change (one file, ~10 LOC)

File: core/services/chainlink/application.go (lines 383–386)

// before
var auth chipingress.HeaderProvider
if len(beholderAuthHeaders) > 0 {
    auth = beholder.NewStaticAuth(
        beholderAuthHeaders,
        !cfg.Telemetry().ChipIngressInsecureConnection(),
    )
}
// after
auth, err := chipingress.NewHeaderProvider(chipingress.HeaderProviderConfig{
    AuthHeaders:        beholderAuthHeaders,
    AuthHeadersTTL:     cfg.Telemetry().AuthHeadersTTL(),
    AuthPublicKeyHex:   csaPubKeyHex,
    AuthKeySigner:      csaKeystore, // already constructed at line 285
    InsecureConnection: cfg.Telemetry().ChipIngressInsecureConnection(),
})
if err != nil {
    return nil, fmt.Errorf("failed to build chip ingress auth: %w", err)
}

Why it slots in cleanly

Every input is already in scope a few lines up:

Field Source Line
AuthHeaders beholderAuthHeaders 286
AuthHeadersTTL cfg.Telemetry().AuthHeadersTTL() already on config.Telemetry (core/config/telemetry_config.go:10)
AuthPublicKeyHex csaPubKeyHex 286
AuthKeySigner csaKeystore (*keystore.CSASigner, has Sign(ctx, account, data)) 285
InsecureConnection cfg.Telemetry().ChipIngressInsecureConnection() already used at 385

Notes

  • beholder import stays — it's still used for beholder.GetMeter() (lines 280, 782) and beholder.GetEmitter() (lines 775, 830). Only the NewStaticAuth call site moves.
  • Both code paths (static-only headers and rotating auth) are now consolidated behind a single chipingress entry point, so this also covers the rotating-auth case @pkcll mentioned in #discussion_r3312550090.

Dependency

go get github.com/smartcontractkit/chainlink-common/pkg/chipingress@CRE-4422-refactor-durable-emitter-chipingress-auth

Locally verified: go build ./core/services/chainlink/... passes against the branch build of #2096.

Comment on lines +383 to +386
var auth chipingress.HeaderProvider
if len(beholderAuthHeaders) > 0 {
auth = beholder.NewStaticAuth(beholderAuthHeaders, !cfg.Telemetry().ChipIngressInsecureConnection())
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var auth chipingress.HeaderProvider
if len(beholderAuthHeaders) > 0 {
auth = beholder.NewStaticAuth(beholderAuthHeaders, !cfg.Telemetry().ChipIngressInsecureConnection())
}
auth, err := chipingress.NewHeaderProvider(chipingress.HeaderProviderConfig{
AuthHeaders: beholderAuthHeaders,
AuthHeadersTTL: cfg.Telemetry().AuthHeadersTTL(),
AuthPublicKeyHex: csaPubKeyHex,
AuthKeySigner: csaKeystore, // already constructed at line 285
InsecureConnection: cfg.Telemetry().ChipIngressInsecureConnection(),
})
if err != nil {
return nil, fmt.Errorf("failed to build chip ingress auth: %w", err)
}

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.

3 participants