Skip to content

beholder, loop: pass chip ingress retry policy through Config and LOOP env - #2441

Open
pkcll wants to merge 1 commit into
mainfrom
incident-2673-pmai-chipingress-retry-config
Open

pkcll wants to merge 1 commit into
mainfrom
incident-2673-pmai-chipingress-retry-config

Conversation

@pkcll

@pkcll pkcll commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

#2373 made the chip ingress client's gRPC retry policy configurable (WithRetryPolicy), but no caller can reach it yet: beholder builds the node's chip ingress client internally, and LOOP plugins build their own, with no retry field on either config surface. This adds the pass-through only — retries stay opt-in everywhere.

  • beholder.Config gains ChipIngressRetryPolicy (*chipingress.RetryPolicy, nil keeps retries off), applied via chipingress.WithRetryPolicy when the chip ingress emitter is enabled.
  • beholder.ChipIngressRetryConfig is the string-config-friendly form for hosts: Enabled plus optional overrides, where zero fields fall back to chipingress.DefaultRetryPolicy so a config layer that only sets Enabled still gets a valid policy instead of a zero-valued one gRPC would silently discard.
  • loop.EnvConfig gains ChipIngressRetry* fields carried over the existing CL_CHIP_INGRESS_* env channel (AsCmdEnv/parse), and the LOOP server resolves them into its own beholder client's retry policy.

Kept in the root module on purpose: the pass-through only uses API already shipped by #2373 (WithRetryPolicy, DefaultRetryPolicy, ParseStatusCodes), so no pkg/chipingress nested-module pin bump is needed.

Wiring into the chainlink node's [Telemetry] TOML config follows in the chainlink repo once this lands.

Test plan

  • pkg/beholder full suite green (incl. new chip_ingress_retry_test.go and a retry-policy construction subtest in TestNewGRPCClient_ChipIngressEmitter)
  • pkg/loop full suite green (env round-trip incl. policy resolution, parse error case for CL_CHIP_INGRESS_RETRY_BACKOFF_MULTIPLIER)
  • go build ./..., go vet on touched packages, gofmt clean
  • CI

Jira: INFOPLAT-19422

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (9)

pkg/beholder (1)
  • ChipIngressRetryConfig — ➕ Added
pkg/beholder.Config (1)
  • ChipIngressRetryPolicy — ➕ Added
pkg/beholder.writerClientConfig (1)
  • ChipIngressRetryPolicy — ➕ Added
pkg/loop.EnvConfig (6)
  • ChipIngressRetryableStatusCodes — ➕ Added

  • ChipIngressRetryBackoffMultiplier — ➕ Added

  • ChipIngressRetryEnabled — ➕ Added

  • ChipIngressRetryInitialBackoff — ➕ Added

  • ChipIngressRetryMaxAttempts — ➕ Added

  • ChipIngressRetryMaxBackoff — ➕ Added


📄 View full apidiff report

…P env

chainlink-common#2373 made the chip ingress client's gRPC retry policy
configurable (WithRetryPolicy), but no caller can reach it yet: beholder
builds the node's chip ingress client internally, and LOOP plugins build
their own, with no retry field on either config surface.

- beholder.Config gains ChipIngressRetryPolicy (*chipingress.RetryPolicy,
  nil keeps retries off), applied via chipingress.WithRetryPolicy when the
  chip ingress emitter is enabled.
- beholder.ChipIngressRetryConfig is the string-config-friendly form for
  hosts: Enabled plus optional overrides, where zero fields fall back to
  chipingress.DefaultRetryPolicy so a config layer that only sets Enabled
  still gets a valid policy instead of a zero-valued one gRPC would
  silently discard.
- loop.EnvConfig gains ChipIngressRetry* fields carried over the existing
  CL_CHIP_INGRESS_* env channel (AsCmdEnv/parse), and the LOOP server
  resolves them into its own beholder client's retry policy.

Retries stay opt-in everywhere; this only adds the pass-through. Wiring
into the chainlink node's [Telemetry] TOML config follows in the chainlink
repo once this lands.

Jira: INFOPLAT-19422
@pkcll
pkcll force-pushed the incident-2673-pmai-chipingress-retry-config branch from 91c6604 to 84edf08 Compare October 6, 2026 03:33
@pkcll
pkcll marked this pull request as ready for review October 6, 2026 03:44
@pkcll
pkcll requested review from a team as code owners October 6, 2026 03:44
Copilot AI balanced review requested due to automatic review settings October 6, 2026 03:44

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

A configured maximum of one attempt silently disables retries, and two comments reference a nonexistent configuration type.

Review effort: Balanced
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

Adds opt-in chip ingress retry configuration to beholder and LOOP clients.

Changes:

  • Adds retry-policy configuration and default resolution.
  • Passes retry settings through LOOP environment variables.
  • Adds configuration and round-trip tests.
File Description
pkg/​beholder/​chip_ingress_retry.go Resolves retry configuration.
pkg/​beholder/​chip_ingress_retry_test.go Tests policy resolution.
pkg/​beholder/​client.go Applies retry policies.
pkg/​beholder/​client_test.go Tests client construction.
pkg/​beholder/​config.go Exposes the retry policy.
pkg/​beholder/​testdata/​config-example.json Updates configuration fixture.
pkg/​loop/​config.go Adds retry environment settings.
pkg/​loop/​config_test.go Tests environment round trips.
pkg/​loop/​server.go Wires settings into beholder.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +43 to +45
if c.MaxAttempts > 0 {
p.MaxAttempts = c.MaxAttempts
}
Comment thread pkg/beholder/config.go
ChipIngressInsecureConnection bool // Disables TLS for Chip Ingress Emitter
// ChipIngressRetryPolicy enables gRPC-level retries on the chip ingress client when
// non-nil (see chipingress.WithRetryPolicy). Nil (the default) keeps retries off.
// Build it from string-based config with chipingress.RetryPolicyConfig.
Comment thread pkg/loop/config.go
Comment on lines +143 to +146
// ChipIngressRetry* configures gRPC-level retries on the LOOP's own beholder
// chip ingress client. The host sends fully resolved values; the server resolves
// them into a policy via chipingress.RetryPolicyConfig, where zero fields fall
// back to chipingress.DefaultRetryPolicy and Enabled=false keeps retries off.
@pkcll
pkcll requested a review from jmank88 October 6, 2026 03:46

This branch has not been deployed

No deployments
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.

2 participants