Skip to content

fix: prevent eager I/O - #1492

Draft
tt-cll wants to merge 3 commits into
mainfrom
tt/ctor
Draft

tt-cll wants to merge 3 commits into
mainfrom
tt/ctor

Conversation

@tt-cll

@tt-cll tt-cll commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Description

Testing

Checklist

  • Breaking changes documented in changelog (see changelog directory)
  • Cross link related PRs (in this or other repositories)

tt-cll added 2 commits October 6, 2026 11:32
…failures

- sourcereader.Service.Start no longer reads the DB/chain inline; init
  retries in the background and Ready() reports until it succeeds.
- Coordinator.Start skips a chain whose source reader fails to start,
  keeps the failure visible in HealthReport, and only fails when no
  chain started at all.
- cursechecker.PollerService runs its initial RMN poll in the
  background goroutine instead of blocking Start.
…alyzer

Remaining eager-I/O-at-startup fixes beyond the verifier:
- coordinator filterConfiguredSourceReaders degrades to unknown statuses
  instead of failing startup on a transient DB error.
- cursechecker runs its initial RMN poll in the background.
- token verifier factory skips a failing verifier (fails only if none
  start); unknown verifier type is a returned config error, not Fatalw.
- indexer main skips a failing verifier reader or discovery source
  (fails only if none start).
- pricer skips a chain that fails to start and surfaces it via the new
  HealthReport; fails only if no chain starts.
- aggregator NewServer returns errors instead of Fatalf (signature
  change: (*Server, error)); main owns the fail-fast decision.

Regression prevention:
- tools/noeagerio: go/analysis linter flagging I/O (RPC/DB/HTTP/keystore)
  in New* constructors and Start methods, with intra-package taint
  propagation and //nolint:noeagerio as the documented escape hatch.
  Deliberate fail-fast sites (bootstrap DB/keystore, JD job load, signer
  key load, aggregator storage, replay tool) are annotated.
- Wired into just lint-noeagerio and the golangci-lint CI workflow.
- Policy recorded in AGENTS.md.
Comment thread aggregator/cmd/main.go Fixed
…rently

Audit follow-ups:
- EnsureDBConnectionContext / RunPostgresMigrationsContext /
  RunMigrationsContext: ping retries and goose migrations now honor the
  caller's context (previously ~40s of unbounded retry, and migrations
  with no ctx at all). Old signatures kept as deprecated wrappers.
- ConnectToPostgresDB takes a ctx so a degraded Postgres cannot blow the
  verifier startup budget.
- Verifier (committee + token) and executor factories build chain
  accessors concurrently with a 30s per-chain timeout: a slow RPC pool
  no longer serializes away the shared startup budget.
- messagerules initial poll uses the service-lifetime ctx instead of the
  startup ctx bootstrap cancels on return.
- Coordinator startup chain-status read is bounded (5s) and non-fatal.
- noeagerio denylist gains GetAccessor (accessor construction dials).
Comment thread aggregator/cmd/main.go

server, err := aggregator.NewServer(ctx, sugaredLggr, config, aggMonitoring)
if err != nil {
sugaredLggr.Fatalw("failed to create CCV data service", "error", err)
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Code coverage report:

Package main tt/ctor Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 44.18% 44.17% -0.01%
github.com/smartcontractkit/chainlink-ccv/bootstrap 64.76% 65.07% +0.31%
github.com/smartcontractkit/chainlink-ccv/cli 54.90% 54.90% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 33.67% 41.16% +7.49%
github.com/smartcontractkit/chainlink-ccv/common 45.87% 45.87% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 42.14% 42.14% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 34.27% 34.32% +0.05%
github.com/smartcontractkit/chainlink-ccv/integration 61.95% 61.99% +0.04%
github.com/smartcontractkit/chainlink-ccv/internal 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/migration 78.70% 78.70% +0.00%
github.com/smartcontractkit/chainlink-ccv/pkg 84.62% 84.62% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 66.31% 66.31% +0.00%
github.com/smartcontractkit/chainlink-ccv/tools 38.36% 47.90% +9.54%
github.com/smartcontractkit/chainlink-ccv/verifier 36.55% 37.21% +0.66%
Total 50.50% 51.00% +0.50%

Files added (in tt/ctor):

  • github.com/smartcontractkit/chainlink-ccv/tools/noeagerio/analyzer.go
  • github.com/smartcontractkit/chainlink-ccv/tools/noeagerio/cmd/noeagerio/main.go

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