feat: Add lane off-chain readiness preflight - #1432
Conversation
New preflight package checks that the verifier and executor jobs serving a lane chain exist, are approved, and that their deployed spec covers that chain. The lane changesets in chainlink-ccip cannot read this job state, so this closes the gap before a lane is wired up.
|
👋 athegaul, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
…ead of string concatenation
|
Code coverage report:
|
There was a problem hiding this comment.
🟡 Changes recommended
Job selection and deployed-spec validation can produce incorrect or nondeterministic readiness results.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds preflight validation for off-chain lane readiness.
Changes:
- Checks verifier and executor jobs for existence, approval, and chain coverage.
- Adds tests for missing, unapproved, and incomplete jobs.
File summaries
| File | Description |
|---|---|
deployment/preflight/lane_prereqs.go |
Implements lane readiness checks. |
deployment/preflight/lane_prereqs_test.go |
Tests readiness outcomes. |
Review details
Suppressed comments (2)
deployment/preflight/lane_prereqs.go:129
- Qualifier matching is not position-aware. For example, qualifier
defaultalso matchesnop-default-other-verifierbecausedefaultappears in the alias/aggregator portion, even though that job belongs to committeeother. This can select a job from the wrong scope; the existing scope implementations indeployment/shared/types.go:127-129and:193-195match the complete trailing scope instead.
return strings.HasSuffix(jobID, "-"+kind) && strings.Contains(jobID, "-"+qualifier+"-")
deployment/preflight/lane_prereqs.go:123
JobInfo.Specis the locally desired spec, not necessarily the deployed one: JD's proposal specs are stored inProposals, and sync explicitly permits/report spec drift without replacing this field. Consequently, an approved job whose deployed spec omits this chain can pass if the local desired spec contains it. Also, a raw substring can match the selector in unrelated values or as part of another selector. Read the active proposal's spec and parse the relevant verifier/executor chain-config map to test an exact key.
if !strings.Contains(found.Spec, chainKey) {
return fmt.Errorf("NOP %q job %q: %w", alias, found.JobID, ErrJobMissingChain)
}
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| for jobID, info := range jobs[alias] { | ||
| if jobMatches(string(jobID), kind, qualifier) { | ||
| found = &info | ||
| break | ||
| } |
New preflight package checks that the verifier and executor jobs serving a lane chain exist, are approved, and that their deployed spec covers that chain. The lane changesets in chainlink-ccip cannot read this job state, so this closes the gap before a lane is wired up.